open-falcon的目标是做最开放、最好用的互联网企业级监控产品。
根据操作系统下载golang对应的RPM包:
https://pkgs.org/download/golang
golang-1.13.3-1.el7.x86_64.rpm
golang-bin-1.13.3-1.el7.x86_64.rpm
golang-src-1.13.3-1.el7.noarch.rpm
yum install gcc
yum install git
yum install subversion
yum install mercurial
go version
go env
yum install -y epel-release
yum install -y redis
yum -y install wget
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install -y mysql-server
mkdir -p $GOPATH/src/github.com/open-falcon
cd $GOPATH/src/github.com/open-falcon
git clone https://github.com/open-falcon/falcon-plus.git
cd $GOPATH/src/github.com/open-falcon/falcon-plus/scripts/mysql/db_schema/
mysql -h 127.0.0.1 -u root -p < 1_uic-db-schema.sql
mysql -h 127.0.0.1 -u root -p < 2_portal-db-schema.sql
mysql -h 127.0.0.1 -u root -p < 3_dashboard-db-schema.sql
mysql -h 127.0.0.1 -u root -p < 4_graph-db-schema.sql
mysql -h 127.0.0.1 -u root -p < 5_alarms-db-schema.sql
cd $GOPATH/src/github.com/open-falcon/falcon-plus/
# make all modules
make all
# make specified module
make agent
# pack all modules
make pack
执行完毕make pack 会在当前目录下生成一个open-falcon-vx.x.x.tar.gz
将open-falcon-vx.x.x.tar.gz复制到运行目录下,解压
./open-falcon start
# check modules status
./open-falcon check
cd /root/open-falcon/
git clone https://github.com/open-falcon/dashboard.git
cd dashboard
dashboard config file is ‘rrd/config.py’
yum install -y python-virtualenv
yum install -y python-devel
yum install -y openldap-devel
yum install -y mysql-devel
yum groupinstall "Development tools"
cd /root/open-falcon/dashboard/
virtualenv ./env
./env/bin/pip install -r pip_requirements.txt
source ./env/bin/python wsgi.py
export FLASK_ENV=development
flask run --host=0.0.0.0 --port=8081
Run with gunicorn in production mode
bash control start
open http://127.0.0.1:8081 in your browser.
dashbord没有默认创建任何账号包括管理账号,需要通过页面进行注册账号。
想拥有管理全局的超级管理员账号,需要手动注册用户名为root的账号(第一个帐号名称为root的用户会被自动设置为超级管理员)
超级管理员可以给普通用户分配权限管理。
小提示:注册账号能够被任何打开dashboard页面的人注册,所以当给相关的人注册完账号后,需要去关闭注册账号功能。只需要去修改api组件的配置文件cfg.json,将signup_disable配置项修改为true,重启api即可。当需要给人开账号的时候,再将配置选项改回去,用完再关掉即可。
docker run -itd \
--name falcon-mysql \
-v /root/open_falcon/mysql-data:/var/lib/mysql \
-e MYSQL_ALLOW_EMPTY_PASSWORD=true \
-p 3306:3306 \
mysql:5.7
git clone --depth=1 https://github.com/open-falcon/falcon-plus
cd /root/open_falcon/falcon-plus
#!/bin/sh
for x in `ls ./scripts/mysql/db_schema/*.sql`; do
echo init mysql table $x ...;
docker exec -i falcon-mysql mysql -uroot < $x;
done
docker run --name falcon-redis -p6379:6379 -d redis:4-alpine3.8
docker run -itd --name falcon-plus \
--link=falcon-mysql:db.falcon \
--link=falcon-redis:redis.falcon \
-p 8433:8433 \
-p 8080:8080 \
-e MYSQL_PORT=root@tcp\(db.falcon:3306\) \
-e REDIS_PORT=redis.falcon:6379 \
-v /root/open_falcon/open-falcon/data:/open-falcon/data \
-v /root/open_falcon/open-falcon/logs:/open-falcon/logs \
openfalcon/falcon-plus:v0.3
docker exec falcon-plus sh ctrl.sh start graph hbs judge transfer nodata aggregator agent gateway api alarm
## check status of backend modules
docker exec falcon-plus ./open-falcon check
docker run -itd --name falcon-dashboard \
-p 8081:8081 \
--link=falcon-mysql:db.falcon \
--link=falcon-plus:api.falcon \
-e API_ADDR=http://api.falcon:8080/api/v1 \
-e PORTAL_DB_HOST=db.falcon \
-e PORTAL_DB_PORT=3306 \
-e PORTAL_DB_USER=root \
-e PORTAL_DB_NAME=falcon_portal \
-e ALARM_DB_HOST=db.falcon \
-e ALARM_DB_PORT=3306 \
-e ALARM_DB_USER=root \
-e ALARM_DB_NAME=alarms \
-w /open-falcon/dashboard openfalcon/falcon-dashboard:v0.2.1 \
'./control startfg'
docker run -d --restart always --name falcon-agent -e NUX_ROOTFS=/rootfs -v /:/rootfs:ro openfalcon/falcon-plus:v0.3 ./agent/bin/falcon-agent -c /open-falcon/agent/config/cfg.json