Open-Falcon 是小米开源的一款企业级、高可用、可扩展的开源监控解决方案。社区有多款插件支持,如:
基本安装
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 58 59 60 61 62 63 64 65 66 |
sudo apt update -y sudo apt install redis-server -y sudo apt install mysql-server -y # 下载代码及初始化数据库 cd /tmp/ && git clone https://github.com/open-falcon/falcon-plus.git cd /tmp/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 ~ && rm -rf /tmp/falcon-plus/ # sudo apt install golang -y https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz #替换为对应的版本号 sudo tar -C /usr/local -xzf go1.12.7.linux-amd64.tar.gz # 加入到 profile 文件中(~/.bash_profile 或/etc/profile) export PATH=$PATH:/usr/local/go/bin # 设置 GOPATH mkdir ~/go export GOPATH=$HOME/go # 加入 profile 文件 # 从源码编译 go get github.com/open-falcon/falcon-plus cd $GOPATH/src/github.com/open-falcon/falcon-plus/ make all make pack sudo mkdir /home/work export FALCON_HOME=/home/work export WORKSPACE=$FALCON_HOME/open-falcon sudo mkdir -p $WORKSPACE sudo tar -xzvf open-falcon-v0.3.tar.gz -C $WORKSPACE # 替换为对应的版本号 #修改数据库用户和密码 cd $WORKSPACE grep -Ilr 3306 ./ | xargs -n1 -- sed -i 's/root:/real_user:real_password/g' ./open-falcon start # 启动 ./open-falcon check # 检查 # 更多用法 ./open-falcon [start|stop|restart|check|monitor|reload] module # 安装前端(第一次安装使用 Python 3后发现各种报错,原来所支持的版本为 Python 2) cd $WORKSPACE git clone https://github.com/open-falcon/dashboard.git sudo apt-get install virtualenv cd $WORKSPACE/dashboard/ virtualenv env ./env/bin/pip install -r pip_requirements.txt -i https://pypi.douban.com/simple #vi rrd/config.py API_ADDR = "http://127.0.0.1:8080/api/v1" # 修改为后端的地址,其它数据库及账号信息也请按照实际情况修改 # 开发者模式启动 ./env/bin/python wsgi.py # 生产环境启动 bash control start #其它命令 bash control stop bash control tail # 前端需手动注册账号,root 为管理员 |
常见问题
1、ImportError: No module named ‘ConfigParser’:
1 |
sudo cp /usr/lib/python3.5/configparser.py /usr/lib/python3.5/ConfigParser.py |
2、ERROR: Failed building wheel for python-ldap
1 |
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev |