0%

互联网监控, Open-falcon多节点用户配置

Open-Falcon 是小米运维部开源的一款互联网企业级监控系统解决方案。监控系统是整个运维环节,乃至整个产品生命周期中最重要的一环,事前及时预警发现故障,事后提供翔实的数据用于追查定位问题。监控系统作为一个成熟的运维产品,业界有很多开源的实现可供选择。
本文档对多节点负载open-falcon部署配置说明。请阅读官方参考文档

Alt text

机器部署

系统:Centos7

主机名主机IP备注
falconpoc0110.128.31.136open-falcon模块测试机
falconpoc0210.128.31.137open-falcon模块测试机
falconpoc0310.128.31.138open-falcon数据测试机

模块部署展示

模块主机名主机IP备注
hbsfalconpoc0110.128.31.136心跳服务
hbsfalconpoc0210.128.31.137心跳服务
judgefalconpoc0110.128.31.136告警判断
judgefalconpoc0210.128.31.137告警判断
graphfalconpoc0110.128.31.136存储绘图
graphfalconpoc0210.128.31.137存储绘图
transferfalconpoc0110.128.31.136数据转发
transferfalconpoc0210.128.31.137数据转发
queryfalconpoc0110.128.31.136绘图查询
queryfalconpoc0210.128.31.137绘图查询
dashboardfalconpoc0110.128.31.136用户查询
dashboardfalconpoc0210.128.31.137用户查询
uicfalconpoc0110.128.31.136用户管理
uicfalconpoc0210.128.31.137用户管理
portalfalconpoc0110.128.31.136策略配置
portalfalconpoc0210.128.31.137策略配置
alarmfalconpoc0110.128.31.136报警事件
senderfalconpoc0110.128.31.136报警通知
taskfalconpoc0110.128.31.136定时任务

主机名主机IP备注
mysqlfalconpoc0310.128.31.138mysql数据库
redisfalconpoc0310.128.31.138redis数据库
smsfalconpoc0310.128.31.138短信接口

模块主机名主机IP备注
agentfalconpoc0110.128.31.136指标采集
agentfalconpoc0210.128.31.137指标采集
agentfalconpoc0310.128.31.138指标采集

环境部署

更新centos7源

1
2
3
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache

安装MySQL

1
2
3
4
5
6
7
yum install mysql

wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server

service mysqld restart
或者
1
2
3
4
5
6
yum install mariadb-server mariadb

systemctl start mariadb #启动MariaDB
systemctl stop mariadb #停止MariaDB
systemctl restart mariadb #重启MariaDB
systemctl enable mariadb #设置开机启动
远程访问
1
2
3
mysql -u root 
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
flush privileges;

安装Redis

1
yum install gcc
下载
1
2
3
4
5
6
7
8
9
10
11
wget http://download.redis.io/releases/redis-3.0.0.tar.gz
tar zxvf redis-3.0.0.tar.gz
cd redis-3.0.0

#如果不加参数,linux下会报错
make MALLOC=libc

cp src/redis-server /usr/bin/
cp src/redis-cli /usr/bin/
mkdir -p /etc/redis
cp redis.conf /etc/redis/
配置redis
1
2
3
vim /etc/redis/ redis.conf
bind 0.0.0.0
daemonize yes
启动redis
1
/usr/bin/redis-server /etc/redis/redis.conf
登录redis
1
/usr/bin/redis-cli
关闭redis
1
/usr/bin/redis-cli shutdown

初始化MySQL数据

1
2
3
4
5
6
7
8
9
#下载初始化脚步
git clone https://github.com/open-falcon/scripts.git
cd ./scripts/
mysql -h localhost -u root --password="" < db_schema/graph-db-schema.sql
mysql -h localhost -u root --password="" < db_schema/dashboard-db-schema.sql

mysql -h localhost -u root --password="" < db_schema/portal-db-schema.sql
mysql -h localhost -u root --password="" < db_schema/links-db-schema.sql
mysql -h localhost -u root --password="" < db_schema/uic-db-schema.sql

Python环境

1
2
3
yum install mysql
yum install mysql-devel
yum install -y python-virtualenv
pip换源
1
2
3
4
5
vim ~/.pip/pip.conf

[global]
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com

模块单点部署

先从模块单点开始部署,完成后再部署多点。前期条件有限,先将open-falcon模块部署falconpoc01服务器,之后再部署相同的模块到falconpoc02。

内部模块相互访问使用host名称,方便于维护。falconpoc01配置 /etc/hosts;添加

1
2
3
4
5
6
7
8
10.128.31.138	falcon-mysql
10.128.31.138 falcon-redis
10.128.31.136 falcon-hbs
10.128.31.137 falcon-hbs2
10.128.31.136 falcon-graph
10.128.31.137 falcon-graph2
10.128.31.136 falcon-judge
10.128.31.137 falcon-judge2

部署heartbeat心跳模块

模块部署的打包、上传不会做介绍说明,官方文档上已经写明。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"database": "root:password@tcp(falcon-mysql:3306)/falcon_portal?loc=Local&parseTime=true",
"hosts": "",
"maxIdle": 100,
"listen": ":6030",
"trustable": [""],
"http": {
"enabled": true,
"listen": "0.0.0.0:6031"
}
}

部署judge报警判断模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"debugHost": "nil",
"remain": 11,
"http": {
"enabled": true,
"listen": "0.0.0.0:6081"
},
"rpc": {
"enabled": true,
"listen": "0.0.0.0:6080"
},
"hbs": {
"servers": ["falcon-hbs:6030"],
"timeout": 300,
"interval": 60
},
"alarm": {
"enabled": true,
"minInterval": 300,
"queuePattern": "event:p%v",
"redis": {
"dsn": "falcon-redis:6379",
"maxIdle": 5,
"connTimeout": 5000,
"readTimeout": 5000,
"writeTimeout": 5000
}
}
}

部署graph存储绘图模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#配置
cp cfg.example.json cfg.json
mkdir -p /root/data/6070
vim cfg.json
{
"debug": false,
"http": {
"enabled": true,
"listen": "0.0.0.0:6071"
},
"rpc": {
"enabled": true,
"listen": "0.0.0.0:6070"
},
"rrd": {
"storage": "/root/data/6070"
},
"db": {
"dsn": "root:password@tcp(falcon-mysql:3306)/graph?loc=Local&parseTime=true",
"maxIdle": 4
},
"callTimeout": 5000,
"migrate": {
"enabled": false,
"concurrency": 2,
"replicas": 500,
"cluster": {
"graph-00" : "falcon-graph:6070"
}
}
}

部署transfer数据转发模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"minStep": 30,
"http": {
"enabled": true,
"listen": "0.0.0.0:6060"
},
"rpc": {
"enabled": true,
"listen": "0.0.0.0:8433"
},
"socket": {
"enabled": true,
"listen": "0.0.0.0:4444",
"timeout": 3600
},
"judge": {
"enabled": true,
"batch": 200,
"connTimeout": 1000,
"callTimeout": 5000,
"maxConns": 32,
"maxIdle": 32,
"replicas": 500,
"cluster": {
"judge-00" : "falcon-judge:6080"
}
},
"graph": {
"enabled": true,
"batch": 200,
"connTimeout": 1000,
"callTimeout": 5000,
"maxConns": 32,
"maxIdle": 32,
"replicas": 500,
"cluster": {
"graph-00" : "falcon-graph:6070"
}
},
"tsdb": {
"enabled": false,
"batch": 200,
"connTimeout": 1000,
"callTimeout": 5000,
"maxConns": 32,
"maxIdle": 32,
"retry": 3,
"address": "127.0.0.1:8088"
}
}

部署query绘图查询模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": "false",
"http": {
"enabled": true,
"listen": "0.0.0.0:9966"
},
"graph": {
"connTimeout": 1000,
"callTimeout": 5000,
"maxConns": 32,
"maxIdle": 32,
"replicas": 500,
"cluster": {
"graph-00": "falcon-graph:6070"
}
},
"api": {
"query": "http://10.128.31.136:9966",
"dashboard": "http://10.128.31.136:8081",
"max": 500
}
}

部署dashboard用户查询模块

1
2
3
#初始化
virtualenv ./env
./env/bin/pip install -r pip_requirements.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#配置
vim rrd/config.py
#-*-coding:utf8-*-
import os

#-- dashboard db config --
DASHBOARD_DB_HOST = "falcon-mysql"
DASHBOARD_DB_PORT = 3306
DASHBOARD_DB_USER = "root"
DASHBOARD_DB_PASSWD = "password"
DASHBOARD_DB_NAME = "dashboard"

#-- graph db config --
GRAPH_DB_HOST = "falcon-mysql"
GRAPH_DB_PORT = 3306
GRAPH_DB_USER = "root"
GRAPH_DB_PASSWD = "password"
GRAPH_DB_NAME = "graph"

#-- app config --
DEBUG = True
SECRET_KEY = "secret-key"
SESSION_COOKIE_NAME = "open-falcon"
PERMANENT_SESSION_LIFETIME = 3600 * 24 * 30
SITE_COOKIE = "open-falcon-ck"

#-- query config --
QUERY_ADDR = "http://10.128.31.136:9966"

BASE_DIR = "/root/deploy/dashboard"
LOG_PATH = os.path.join(BASE_DIR,"log/")

try:
from rrd.local_config import *
except:
pass

部署uic用户管理模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"log": "debug",
"company": "MI",
"http": {
"enabled": true,
"listen": "0.0.0.0:1234"
},
"cache": {
"enabled": true,
"redis": "127.0.0.1:6379",
"idle": 10,
"max": 1000,
"timeout": {
"conn": 10000,
"read": 5000,
"write": 5000
}
},
"salt": "",
"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:password@tcp(falcon-mysql:3306)/uic?charset=utf8&loc=Asia%2FChongqing",
"idle": 10,
"max": 100
},
"shortcut": {
"falconPortal": "http://10.128.31.136:5050/",
"falconDashboard": "http://10.128.31.136:7070/",
"falconAlarm": "http://10.128.31.136:9912/"
}
}

部署portal报警策略模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#初始化
virtualenv ./env
./env/bin/pip install -r pip_requirements.txt
#配置
vim rrd/config.py
# -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'

# -- app config --
DEBUG = True

# -- db config --
DB_HOST = "falcon-mysql"
DB_PORT = 3306
DB_USER = "root"
DB_PASS = "password"
DB_NAME = "falcon_portal"

# -- cookie config --
SECRET_KEY = "4e.5tyg8-u9ioj"
SESSION_COOKIE_NAME = "falcon-portal"
PERMANENT_SESSION_LIFETIME = 3600 * 24 * 30

UIC_ADDRESS = {
'internal': 'http://10.128.31.136:1234',
'external': 'http://10.128.31.136:1234',
}

UIC_TOKEN = ''

MAINTAINERS = ['root']
CONTACT = 'CDXXJCPT@gome.cn'

COMMUNITY = True

try:
from frame.local_config import *
except Exception, e:
print "[warning] %s" % e

部署alarm报警处理模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"uicToken": "",
"http": {
"enabled": true,
"listen": "0.0.0.0:9912"
},
"queue": {
"sms": "/sms",
"mail": "/mail"
},
"redis": {
"addr": "falcon-redis:6379",
"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.128.31.136:5050",
"uic": "http://10.128.31.136:1234",
"links": "http://10.128.31.136:5090"
}
}

部署sender报警发送模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"http": {
"enabled": true,
"listen": "0.0.0.0:6066"
},
"redis": {
"addr": "falcon-redis:6379",
"maxIdle": 5
},
"queue": {
"sms": "/sms",
"mail": "/mail"
},
"worker": {
"sms": 10,
"mail": 50
},
"api": {
"sms": "http://10.128.31.138:8000/sms",
"mail": "http://10.128.31.138:9000/mail"
}
}

部署task定时任务模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": false,
"http": {
"enable": true,
"listen": "0.0.0.0:8002"
},
"index": {
"enable": true,
"dsn": "root:password@tcp(falcon-mysql:3306)/graph?loc=Local&parseTime=true",
"maxIdle": 4,
"autoDelete": false,
"cluster":{
"falcon-graph:6071" : "0 0 0 ? * 0-5"
}
},
"collector" : {
"enable": false,
"destUrl" : "http://127.0.0.1:1988/v1/push",
"srcUrlFmt" : "http://%s/statistics/all",
"cluster" : [
"transfer,test.hostname:6060",
"graph,test.hostname:6071",
"task,test.hostname:8001"
]
}
}

部署agent监控采集模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"hostname": "",
"ip": "",
"plugin": {
"enabled": false,
"dir": "./plugin",
"git": "https://github.com/open-falcon/plugin.git",
"logs": "./logs"
},
"heartbeat": {
"enabled": true,
"addr": "10.128.31.136:6030",
"interval": 60,
"timeout": 1000
},
"transfer": {
"enabled": true,
"addrs": [
"10.128.31.136:8433"
],
"interval": 60,
"timeout": 1000
},
"http": {
"enabled": true,
"listen": ":1988",
"backdoor": false
},
"collector": {
"ifacePrefix": ["eth", "ens"]
},
"ignore": {
"cpu.busy": true,
"df.bytes.free": true,
"df.bytes.total": true,
"df.bytes.used": true,
"df.bytes.used.percent": true,
"df.inodes.total": true,
"df.inodes.free": true,
"df.inodes.used": true,
"df.inodes.used.percent": true,
"mem.memtotal": true,
"mem.memused": true,
"mem.memused.percent": true,
"mem.memfree": true,
"mem.swaptotal": true,
"mem.swapused": true,
"mem.swapfree": true
}
}

配置网络相关的collector选项,使用ifconfig查看系统网卡命名。collector选项采集网卡名称前缀。如是配置多节点则做后启动agent。

多节点模块部署

将open-falcon模块部署falconpoc02服务器

内部模块相互访问使用host名称,方便于维护。falconpoc02配置 /etc/hosts;添加

1
2
3
4
5
6
7
8
10.128.31.138	falcon-mysql
10.128.31.138 falcon-redis
10.128.31.136 falcon-hbs
10.128.31.137 falcon-hbs2
10.128.31.136 falcon-graph
10.128.31.137 falcon-graph2
10.128.31.136 falcon-judge
10.128.31.137 falcon-judge2

部署heartbeat心跳模块

模块部署的打包、上传不会做介绍说明,官方文档上已经写明。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"database": "root:password@tcp(falcon-mysql:3306)/falcon_portal?loc=Local&parseTime=true",
"hosts": "",
"maxIdle": 100,
"listen": ":6030",
"trustable": [""],
"http": {
"enabled": true,
"listen": "0.0.0.0:6031"
}
}

部署judge报警判断模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"debugHost": "nil",
"remain": 11,
"http": {
"enabled": true,
"listen": "0.0.0.0:6081"
},
"rpc": {
"enabled": true,
"listen": "0.0.0.0:6080"
},
"hbs": {
"servers": ["falcon-hbs:6030", "falcon-hbs2:6030"],
"timeout": 300,
"interval": 60
},
"alarm": {
"enabled": true,
"minInterval": 300,
"queuePattern": "event:p%v",
"redis": {
"dsn": "falcon-redis:6379",
"maxIdle": 5,
"connTimeout": 5000,
"readTimeout": 5000,
"writeTimeout": 5000
}
}
}
#falcon01也需要修改

部署graph存储绘图模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#配置
cp cfg.example.json cfg.json
mkdir -p /root/data/6070
vim cfg.json
{
"debug": false,
"http": {
"enabled": true,
"listen": "0.0.0.0:6071"
},
"rpc": {
"enabled": true,
"listen": "0.0.0.0:6070"
},
"rrd": {
"storage": "/root/data/6070"
},
"db": {
"dsn": "root:password@tcp(falcon-mysql:3306)/graph?loc=Local&parseTime=true",
"maxIdle": 4
},
"callTimeout": 5000,
"migrate": {
"enabled": false,
"concurrency": 2,
"replicas": 500,
"cluster": {
"graph-00" : "falcon-graph:6070"
}
}
}

部署transfer数据转发模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"minStep": 30,
"http": {
"enabled": true,
"listen": "0.0.0.0:6060"
},
"rpc": {
"enabled": true,
"listen": "0.0.0.0:8433"
},
"socket": {
"enabled": true,
"listen": "0.0.0.0:4444",
"timeout": 3600
},
"judge": {
"enabled": true,
"batch": 200,
"connTimeout": 1000,
"callTimeout": 5000,
"maxConns": 32,
"maxIdle": 32,
"replicas": 500,
"cluster": {
"judge-00" : "falcon-judge:6080",
"judge-01" : "falcon-judge2:6080"
}
},
"graph": {
"enabled": true,
"batch": 200,
"connTimeout": 1000,
"callTimeout": 5000,
"maxConns": 32,
"maxIdle": 32,
"replicas": 500,
"cluster": {
"graph-00" : "falcon-graph:6070",
"graph-01" : "falcon-graph2:6070"
}
},
"tsdb": {
"enabled": false,
"batch": 200,
"connTimeout": 1000,
"callTimeout": 5000,
"maxConns": 32,
"maxIdle": 32,
"retry": 3,
"address": "127.0.0.1:8088"
}
}
#falcon01也需要修改

部署query绘图查询模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": "false",
"http": {
"enabled": true,
"listen": "0.0.0.0:9966"
},
"graph": {
"connTimeout": 1000,
"callTimeout": 5000,
"maxConns": 32,
"maxIdle": 32,
"replicas": 500,
"cluster": {
"graph-00": "falcon-graph:6070",
"graph-01": "falcon-graph2:6070"
}
},
"api": {
"query": "http://10.128.31.137:9966",
"dashboard": "http://10.128.31.137:8081",
"max": 500
}
}

部署dashboard用户查询模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#初始化
virtualenv ./env
./env/bin/pip install -r pip_requirements.txt
#配置
vim rrd/config.py
#-*-coding:utf8-*-
import os

#-- dashboard db config --
DASHBOARD_DB_HOST = "falcon-mysql"
DASHBOARD_DB_PORT = 3306
DASHBOARD_DB_USER = "root"
DASHBOARD_DB_PASSWD = "password"
DASHBOARD_DB_NAME = "dashboard"

#-- graph db config --
GRAPH_DB_HOST = "falcon-mysql"
GRAPH_DB_PORT = 3306
GRAPH_DB_USER = "root"
GRAPH_DB_PASSWD = "password"
GRAPH_DB_NAME = "graph"

#-- app config --
DEBUG = True
SECRET_KEY = "secret-key"
SESSION_COOKIE_NAME = "open-falcon"
PERMANENT_SESSION_LIFETIME = 3600 * 24 * 30
SITE_COOKIE = "open-falcon-ck"

#-- query config --
QUERY_ADDR = "http://10.128.31.137:9966"

BASE_DIR = "/root/deploy/dashboard"
LOG_PATH = os.path.join(BASE_DIR,"log/")

try:
from rrd.local_config import *
except:
pass

部署uic用户管理模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"log": "debug",
"company": "MI",
"http": {
"enabled": true,
"listen": "0.0.0.0:1234"
},
"cache": {
"enabled": true,
"redis": "falcon:6379",
"idle": 10,
"max": 1000,
"timeout": {
"conn": 10000,
"read": 5000,
"write": 5000
}
},
"salt": "",
"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:password@tcp(falcon-mysql:3306)/uic?charset=utf8&loc=Asia%2FChongqing",
"idle": 10,
"max": 100
},
"shortcut": {
"falconPortal": "http://10.128.31.137:5050/",
"falconDashboard": "http://10.128.31.137:7070/",
"falconAlarm": "http://10.128.31.136:9912/"
}
}
#所有uic(fe)节点的salt配置要相同。

部署portal报警策略模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#初始化
virtualenv ./env
./env/bin/pip install -r pip_requirements.txt
#配置
vim rrd/config.py
# -*- coding:utf-8 -*-
__author__ = 'Ulric Qin'

# -- app config --
DEBUG = True

# -- db config --
DB_HOST = "falcon-mysql"
DB_PORT = 3306
DB_USER = "root"
DB_PASS = "password"
DB_NAME = "falcon_portal"

# -- cookie config --
SECRET_KEY = "4e.5tyg8-u9ioj"
SESSION_COOKIE_NAME = "falcon-portal"
PERMANENT_SESSION_LIFETIME = 3600 * 24 * 30

UIC_ADDRESS = {
'internal': 'http://10.128.31.137:1234',
'external': 'http://10.128.31.137:1234',
}

UIC_TOKEN = ''

MAINTAINERS = ['root']
CONTACT = 'CDXXJCPT@gome.cn'

COMMUNITY = True

try:
from frame.local_config import *
except Exception, e:
print "[warning] %s" % e

部署agent监控采集模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#配置
cp cfg.example.json cfg.json
vim cfg.json
{
"debug": true,
"hostname": "",
"ip": "",
"plugin": {
"enabled": false,
"dir": "./plugin",
"git": "https://github.com/open-falcon/plugin.git",
"logs": "./logs"
},
"heartbeat": {
"enabled": true,
"addr": "10.128.31.137:6030",
"interval": 60,
"timeout": 1000
},
"transfer": {
"enabled": true,
"addrs": [
"10.128.31.136:8433",
"10.128.31.137:8433"
],
"interval": 60,
"timeout": 1000
},
"http": {
"enabled": true,
"listen": ":1988",
"backdoor": false
},
"collector": {
"ifacePrefix": ["eth", "ens"]
},
"ignore": {
"cpu.busy": true,
"df.bytes.free": true,
"df.bytes.total": true,
"df.bytes.used": true,
"df.bytes.used.percent": true,
"df.inodes.total": true,
"df.inodes.free": true,
"df.inodes.used": true,
"df.inodes.used.percent": true,
"mem.memtotal": true,
"mem.memused": true,
"mem.memused.percent": true,
"mem.memfree": true,
"mem.swaptotal": true,
"mem.swapused": true,
"mem.swapfree": true
}
}

用户接口

描述访问接口功能备注
dashboradhttp://10.128.31.136:8081/监控主机数据查询
uichttp://10.128.31.136:1234/用户组管理
portalhttp://10.128.31.136:5050/监控策略配置
dashboradhttp://10.128.31.137:8081/监控主机数据查询
uichttp://10.128.31.137:1234/用户组管理
portalhttp://10.128.31.137:5050/监控策略配置
alarmhttp://10.128.31.136:9912/报警查询