环境准备
- 安装redis
yum install redis -y
systemctl start redis
- 安装mysql
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
yum install mysql-server -y
systemctl start mysqld
- 初始化mysql表结构
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
rm -rf /tmp/falcon-plus/
- 安装go语言
open-falcon的后端组件都是使用Go语言编写的,因此需要搭建go语言开发环境
cd /root/tools
wget https://dl.google.com/go/go1.10.3.linux-amd64.tar.gz
tar zxf go1.10.3.linux-amd64.tar.gz
mv go /usr/local/ && cd
echo "" >> .bashrc
echo 'export GOROOT=/usr/local/go' >> .bashrc
echo 'export PATH=$GOROOT/bin:$PATH' >> .bashrc
echo "" >> .bashrc
source .bashrc
- 下载falcon源码
wget https://github.com/open-falcon/falcon-plus/releases/download/v0.2.1/open-falcon-v0.2.1.tar.gz
tar xf open-falcon-v0.2.1.tar.gz -C /home/op/open-falcon
- 修改数据库密码,如果没有设置则不需要修改
cd /home/op/open-falcon
grep -Ilr 3306 /home/op/open-falcon | xargs -n1 -- sed -i 's/root:/root:123456/g'
#启动
./open-falcon start
# 检查所有模块的启动状况,都是up启动成功。
./open-falcon check
- 安装前端
#下载驱动
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 /home/op/open-falcon&& git clone https://github.com/open-falcon/dashboard.git
cd dashboard
#pip安装依赖关系包
virtualenv ./env
./env/bin/pip install -r pip_requirements.txt -i https://pypi.douban.com/simple
##txt文件里边有一个等号是有问题的,需要自己改一下
- 修改配置
dashboard的配置文件为: 'rrd/config.py',请根据实际情况修改
## API_ADDR 表示后端api组件的地址
API_ADDR = "http://127.0.0.1:8080/api/v1"
## 根据实际情况,修改PORTAL_DB_*, 默认用户名为root,默认密码为""
## 根据实际情况,修改ALARM_DB_*, 默认用户名为root,默认密码为""
- 启动
bash control start
- 访问
ip:8081