Install Open-Falcon On Centos 7

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Install open-falcon on centos 7

环境准备
yum install –y epel-release-7

yum install –y redis

###add mysql repo


[aaa]
name=mysql
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/
MySQL56/x86_64/
gpgcheck=0

yum install -y mysql-server git

初始化 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

下载 falcon-plus

https://github.com/open-falcon/falcon-plus/releases

创建工作目录
export FALCON_HOME=/home/work
export WORKSPACE=$FALCON_HOME/open-falcon
mkdir -p $WORKSPACE

解压二进制包
tar -xzvf open-falcon-v0.3.tar.gz -C $WORKSPACE

修改 falcon-plus 的连接 MySQL 配置文件(如果 MySQL root 密码为空,则不执行此步骤)


cd $WORKSPACE
grep -Ilr 3306 ./ | xargs -n1 -- sed -i 's/root:/real_user:real_password/g'

启动 falcon-plus
cd $WORKSPACE
./open-falcon start

# 检查所有模块的启动状况
./open-falcon check

安装 Dashboard

cd $WORKSPACE
git clone https://github.com/open-falcon/dashboard.git

安装依赖包
yum install -y python-virtualenv
yum install -y python-devel
yum install -y openldap-devel
yum install -y mysql-devel
yum groupinstall "Development tools"

export FALCON_HOME=/home/work
export WORKSPACE=$FALCON_HOME/open-falcon
cd $WORKSPACE/dashboard/
virtualenv ./env

./env/bin/pip install -r pip_requirements.txt -i https://pypi.douban.com/simple

修改配置
dashboard 的配置文件为: 'rrd/config.py',请根据实际情况修改
## API_ADDR 表示后端 api 组件的地址
API_ADDR = "http://127.0.0.1:8080/api/v1"

## 根据实际情况,修改 PORTAL_DB_*, 默认用户名为 root,默认密码为""


## 根据实际情况,修改 ALARM_DB_*, 默认用户名为 root,默认密码为""
## 修改 API_ADDR
和 open-falcon api 端口,修改如下:
"API_ADDR","http://127.0.0.1:8080/api/v1"

在生产环境启动
#修改/etc/redis.conf 文件
daemon no 改为 daemon yes

启动 redis
redis-server /etc/redis.conf

启动 dashboard

bash control start

open http://127.0.0.1:8081 in your browser.

You might also like