Open-falcon building
Environmental preparation
Yum install-y redis
Yum install-y mysql-server### install and boot self-boot #
Export HOME=/home/workexport WORKSPACE=$HOME/open-falconmkdir-p $WORKSPACEcd $WORKSPACEgit clone https://github.com/open-falcon/scripts.gitcd. / scripts/mysql-h localhost-u root-- password= ""
< db_schema/graph-db-schema.sqlmysql -h localhost -u root --password="" < db_schema/dashboard-db-schema.sql mysql -h localhost -u root --password="" < db_schema/portal-db-schema.sqlmysql -h localhost -u root --password="" < db_schema/links-db-schema.sqlmysql -h localhost -u root --password="" < db_schema/uic-db-schema.sql ####数据库密码为空#### mkdir ./tmp 导入安装包open-falcon-v0.1.0.tar.gz Shell脚本执行 tar -zxf open-falcon-latest.tar.gz -C ./tmp/for x in `find ./tmp/ -name "*.tar.gz"`;do \ app=`echo $x|cut -d '-' -f2`; \ mkdir -p $app; \tar -zxf $x -C $app; \done 安装go环境 cd ~wget http://dinp.qiniudn.com/go1.4.1.linux-amd64.tar.gztar zxf go1.4.1.linux-amd64.tar.gzmkdir -p workspace/srcecho "" >> .bashrcecho 'export GOROOT=$HOME/go' > > .bashrcecho' export GOPATH=$HOME/workspace' > > .bashrcecho 'export PATH=$GOROOT/bin:$GOPATH/bin:$PATH' > > .bashrcecho "> > .bashrcsource .bashrc
Next, the clone code for later use
Cd $GOPATH/srcmkdir github.comcd github.comgit clone-- recursive https://github.com/open-falcon/of-release.git
Install agent (collect machine monitoring indicators)
Cd $GOPATH/src/github.com/open-falcon/agent
# all component configuration files must be called cfg.json and can be modified based on cfg.example.json
/ control start start the process. / control stop stop the process. / control restart restart the process. / control status to check the process status. / control tail uses tail-f to check var/app.log./falcon-agent-check to check whether it can run normally on the current machine.
Install Transfer (data forwarding Service) Cd transfervim cfg.json
{"debug": false, "minStep": 30, "http": {"enabled": true, "listen": "0.0.0.0enabled 6060"}, "rpc": {"enabled": true, "listen": "0.0.0.0virtual 8433"}, "socket": {"enabled": false "listen": "0.0.0.0 true 4444", "timeout": 3600}, "judge": {"enabled": true, "batch": 1000, "connTimeout": 1000, "callTimeout": 5000, "maxConns": 32, "maxIdle": 32, "replicas": 1000 "cluster": {"judge-00": "127.0.0.1 graph"}, "graph": {"enabled": true, "batch": 200," connTimeout ": 1000," callTimeout ": 5000," maxConns ": 32," maxIdle ": 32," replicas ": 5000 "cluster": {"graph-00": "127.0.0.1 tsdb"}, "tsdb": {"enabled": true, "batch": 200," connTimeout ": 1000," callTimeout ": 5000," maxConns ": 32," maxIdle ": 32," retry ": 3 "address": "127.0.0.1 8088"}}
Start. / control startcurl-s "127.0.0.1:6060/health" check
Cd graphmv cfg.example.json cfg.jsonvim cfg.json {"debug": false, "http": {"enabled": true, "listen": "0.0.0.0 enabled 6071"}, "rpc": {"enabled": true, "listen": "0.0.0.0 false 6070"} "rrd": {"storage": "/ home/work/data/6070"}, "db": {"dsn": "root:@tcp (127.0.0.1 home/work/data/6070 3306) / graph?loc=Local&parseTime=true", "maxIdle": 4}, "callTimeout": 5000 "migrate": {"enabled": false, "concurrency": 2, "replicas": 500,500, "cluster": {"graph-00": "127.0.0.1 false 6070"}
. / control startcurl-s "127.0.0.1:6071/health"
Cd.. / quephmv cfg.example.json cfg.jsonvim cfg.json {"debug": "false", "http": {"enabled": true, "listen": "0.0.0.0 http"}, "graph": {"connTimeout": 1000, "callTimeout": 5000, "maxConns": 32, "maxIdle": 32, "replicas": 500 "cluster": {"graph-00": "127.0.0.1 cluster 6070"}}, "api": {"query": "http://127.0.0.1:9966"," dashboard ":" http://127.0.0.1:8081", "max": 500 after service startup You can view the running status of the service through the log, and the log file address is. / var/app.log. You can read the drawing data through the query script. / scripts/query, such as running bash. / scripts/query "ur.endpoint"ur.counter" to query the drawing data corresponding to Endpoint= "ur.endpoint" & Counter= "ur.counter".
Note: please make sure that the contents of graph.replicas and graph.cluster are exactly the same as the configuration of transfer
Install dashboardyum install-y python-virtualenvcd / path/to/dashboard/virtualenv. / env./env/bin/pip install-r pip_requirements.txt### where MySQL-Python will make an error. Remove MySQL-Python from pip_requirements.txt and install it separately. Reference address: http://blog.csdn.net/winsonyuan/article/details/65447796
Vim. / gunicorn.confvim. / rrd/config.py
Workers = 4bind =': 8081'proc_name = 'falcon-dashboard-opensource'pidfile =' / tmp/falcon-dashboard-opensource.pid'limit_request_field_size = 0limit_request_line = 0
#-*-coding:utf8-*-import os
#-dashboard db config-- DASHBOARD_DB_HOST = "127.0.0.1" DASHBOARD_DB_PORT = 3306DASHBOARD_DB_USER = "root" DASHBOARD_DB_PASSWD = "" DASHBOARD_DB_NAME = "dashboard"
#-graph db config-- GRAPH_DB_HOST = "127.0.0.1" GRAPH_DB_PORT = 3306GRAPH_DB_USER = "root" GRAPH_DB_PASSWD = "" GRAPH_DB_NAME = "graph"
#-app config-- DEBUG = TrueSECRET_KEY = "secret-key" SESSION_COOKIE_NAME = "open-falcon" PERMANENT_SESSION_LIFETIME = 3600 * 24 * 30SITE_COOKIE = "open-falcon-ck"
#-query config-QUERY_ADDR = "http://127.0.0.1:9966"
BASE_DIR = "/ home/work/open-falcon/dashboard/" LOG_PATH = os.path.join (BASE_DIR, "log/")
Try: from rrd.local_config import * except:pass
The falcon-mail-provider installation package {"debug": true, "http": {"listen": "10.0.0.60 http 4000", "token": ""}, "smtp": {"addr": "smtp.qq.com:587", "username": "XXXX@qq.com" need to be installed separately. "password": "eahqkylmljenbfge", = "there is an authorization code problem. "from": "XXXX@qq.com"}}. / control start
Send a test email: curl http://10.0.0.60:4000/sender/mail-d tos=XXXX@qq.com&subject=helloworld&content=test
Install sender (call the email and SMS interface provided by the company) Cd senderVi cfg.json {"debug": true, "http": {"enabled": true, "listen": "0.0.0.0 debug 6066"}, "redis": {"addr": "127.0.0.1 true", "maxIdle": 5} "queue": {"sms": "/ sms", "mail": "/ mail"}, "worker": {"sms": 10, "mail": 50}, "api": {"sms": "http://10.0.0.60:8000/sms"," "mail": "http://10.0.0.60:4000/sender/mail"}}
Curl 127.0.0.1:6066/health
Install FE (UIC web entry) Cd feVi cfg.json {"log": "debug", "company": "PJwuliu", = = "here is the company name used to generate the QR code" http ": {" enabled ": true," listen ":" 0.0.0.0log 1234 "}," cache ": {" enabled ": true "redis": "127.0.0.1 conn 6379", "idle": 10, "max": 1000, "timeout": {"conn": 10000, "read": 5000, "write": 5000}}, "salt": "fdfdfdsfsdfsfdsfs", "canRegister": true, "ldap": {"enabled": false "addr": "ldap.example.com:389", "baseDN": "dc=example,dc=com", "bindDN": "cn=mananger,dc=example,dc=com", "bindPasswd": "12345678", "userField": "uid", "attributes": ["sn", "mail", "telephoneNumber"]} "uic": {"addr": "root:@tcp (127.0.0.1 uic) / uic?charset=utf8&loc=Asia%2FChongqing", "idle": 10, "max": 100}, "shortcut": {"falconPortal": "http://10.0.0.60:5050/"," falconDashboard ":" http://10.0.0.60:8081/", " "falconAlarm": "http://10.0.0.60:9912/"}"
Install portal (configure alarm Policy) # yum install-y python-virtualenv
$cd / path/to/portal/$ virtualenv. / env
$. / env/bin/pip install-r pip_requirements.txtvi.. / portal/frame/config.py#-*-coding:utf-8-*-_ _ author__ = 'Ulric Qin'
#-- app config-- DEBUG = True
#-db config-- DB_HOST = "127.0.0.1" DB_PORT = 3306DB_USER = "root" DB_PASS = "" DB_NAME = "falcon_portal"
#-cookie config-SECRET_KEY = "4e.5tyg8-u9iojds" SESSION_COOKIE_NAME = "falcon-portal" PERMANENT_SESSION_LIFETIME = 3600 * 24 * 30
UIC_ADDRESS = {'internal':' http://10.0.0.60:1234', 'external':' http://10.0.0.60:1234',}
UIC_TOKEN =''
MAINTAINERS = ['root'] CONTACT =' ulric.qin@gmail.com'
COMMUNITY = True
Try: from frame.local_config import * except Exception, e: print "[warning]% s"% e
Cd hbs
{"debug": true, "database": "root:@tcp (127.0.0.1 root:@tcp 3306) / falcon_portal?loc=Local&parseTime=true", "hosts": "", "maxIdle": 100, "listen": ": 6030", "trustable": ["]," http ": {" enabled ": true," listen ":" 0.0.0.0 database 6031 "}}
Cd judge~ (alarm judgment) {"debug": true, "debugHost": "nil", "remain": 11, "http": {"enabled": true, "listen": "10.0.0.60 debugHost 6081"}, "rpc": {"enabled": true, "listen": "0.0.0.0VR 6080"} "hbs": {"servers": ["10.0.0.60 interval 6030"], "timeout": 300, "interval": 60}, "alarm": {"enabled": true, "minInterval": 300, "queuePattern": "event:p%v", "redis": {"dsn": "127.0.0.1 Suzhou 6379" "maxIdle": 5, "connTimeout": 5000, "readTimeout": 5000, "writeTimeout": 5000}
Curl 127.0.0.1:6081/health
Cd linksvirtualenv. / env
. / env/bin/pip install-r pip_requirements.txt
#-*-coding:utf-8-*-_ _ author__ = 'Ulric Qin'
#-- app config-- DEBUG = True
#-db config-DB_HOST = "10.0.0.60" DB_PORT = 3306DB_USER = "root" DB_PASS = "" DB_NAME = "falcon_links"
#-cookie config-SECRET_KEY = "4e.5tyg8-u9ioj" SESSION_COOKIE_NAME = "falcon-links" PERMANENT_SESSION_LIFETIME = 3600 * 24 * 30
Try: from frame.local_config import * except Exception, e:print "[warning]% s"% e
Install alarm (processing alarm event). The alarm generated by judge is written to redis,alarm and read from redis.
{"debug": true, "uicToken": "", "http": {"enabled": true, "listen": "10.0.0.60 enabled 9912"}, "queue": {"sms": "/ sms", "mail": "/ mail"}, "redis": {"addr": "127.0.0.16379" "maxIdle": 5, "highQueues": ["event:p0", "event:p1", "event:p2", "event:p3", "event:p4", "event:p5"], "lowQueues": ["event:p6"] "userSmsQueue": "/ queue/user/sms", "userMailQueue": "/ queue/user/mail"}, "api": {"portal": "http://10.0.0.60:5050"," uic ":" http://10.0.0.60:1234", "links": "http://10.0.0.60:5090"}}"
Install task (scheduled tasks) {"debug": false, "http": {"enable": true, "listen": "0.0.0.0false 8002"}, "index": {"enable": false, "dsn": "root:root@tcp (127.0.0.1 false) / graph?loc=Local&parseTime=true", "maxIdle": 4, "autoDelete": false "cluster": {"test.hostname01:6071": "000? * 0-5", "test.hostname02:6071": "0300? * 0-5"}}, "collector": {"enable": true, "destUrl": "http://127.0.0.1:1988/v1/push"," "srcUrlFmt": "http://%s/statistics/all"," cluster: ["transfer,open-falcon.te:6060", "graph,open-falcon.te:6071", "task,open-falcon.te:8001"]}}
Install nodata (monitoring abnormal reporting of monitoring data) {"debug": true, "http": {"enabled": true, "listen": "0.0.0.0 enabled 6090"}, "query": {"connectTimeout": 5000, "requestTimeout": 30000, "queryAddr": "127.0.1 true"} "config": {"enabled": true, "dsn": "root:@tcp (127.0.0.1 root:@tcp 3306) / falcon_portal?loc=Local&parseTime=true&wait_timeout=604800", "maxIdle": 4}, "collector": {"enabled": true, "batch": 200, "concurrent": 10}, "sender": {"enabled": true "connectTimeout": 5000, "requestTimeout": 30000, "transferAddr": "127.0.0.1 transferAddr", "batch": 500, "block": {"enabled": false, "threshold": 32}
Install aggregator (Cluster aggregation Module) {"debug": true, "http": {"enabled": true, "listen": "0.0.0.0 http 6055"}, "database": {"addr": "root:@tcp (127.0.0.1 true 3306) / falcon_portal?loc=Local&parseTime=true", "idle": 10, "ids": [1 -1], "interval": 55}, "api": {"hostnames": "http://127.0.0.1:5050/api/group/%s/hosts.json"," push ":" http://127.0.0.1:6060/api/push", "graphLast": "http://127.0.0.1:9966/graph/last"}} now the open-falcon has been built. Now the plus version of open-falcon has just been released, so go and have a look again when you have time. Have a good time! Official website address: https://github.com/open-falcon-archive/of-release