Git Product home page Git Product logo

network_anomaly_detection's Introduction

网络服务异常检测系统

基于Django Restframework和Spark的异常检测系统,数据库为MySQL、Redis,
消息队列为Celery,分析服务为Spark SQL和Spark Mllib;
每天0点1分自动运行定时job从全量数据中导入正常的cat数据,该数据用于kmeans做模型训练

Fork项目

把项目fork到用户目录。

安装运行环境

$ sudo apt-get install redis-server
$ sudo apt-get install python3 python3-pip
$ sudo pip3 install virtualenv
$ sudo apt-get install python3-dev libmysqlclient-dev

$ git clone git_url
$ virtualenv -p python3 env_py3_spark

# 激活环境后安装依赖库
$ pip install -r requirements.txt
$ pre-commit install

本地配置文件 settings_local

进入web目录,创建新的配置文件settings_local.py。然后根据自己的环境进行配置。 例如:

"""
本地开发的配置文件
"""
from web.settings import *

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.mysql",
        "HOST": "127.0.0.1",
        "USER": "root",
        "NAME": "test_cpass",
        "PASSWORD": "password",
        "PORT": "",
    },
}

Celery任务启动

$ celery -A web worker -l info  启动celery
$ celery flower -A web --address=0.0.0.0 --port=6666  启动celery flower

新增用户管理模块,JWT TOKEN登录验证

nt_user 用户管理模块

新增接入第三方登录Oauth2.0,授权微博、QQ、微信登录

social_core social_django 第三方登录

新增Senty监控服务告警 服务500错误邮件告警

raven senty

增加websocket channels模块

遵从asgi协议,灵活支持同步和异步

新增django-haystack和elasticsearch

支持自动从django orm映射index  signal自动更新index;
缺陷是只支持ES 2.x及以下  比较鸡肋,建议还是用DSL或Elasticsearch

cache_page缓存接口返回的结果

缓存get请求返回的结果1个小时
@method_decorator(cache_page(60 * 60), name='get')

部署方式可采用异步的方式部署,提高并发

nginx+tornado+daphne+supervisor

network_anomaly_detection's People

Contributors

harvardfly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.