准备工作
1.跟新yum源
yum clean all
yum makecache
yum update -y
2.安装git
因为mysql的脚本要么使用git下载,要么上传下载好的【上传可不安装】
yum install -y git
3.安装redis
如果没有装epel,会提示No package redis available,也就是没有安装包可用,因为官方yum和阿里yum可能都没有redis,故只能通过fedora的epel仓库来安装 命令:yum install -y epel-release
安装redis
yum install redis -y
启动redis
systemctl start redis
设置redis开机启动
systemctl enable redis
可以用下面的语句查看redis是否开启
systemctl status redis
4.安装mysql
因为centos7后系统使用 mariadb 替换了 mysql,所以先卸载mariadb 在安装mysql
卸载mariadb 先查询,在强力删除
rpm -qa | grep mariadb
rpm -e --nodeps mariadb-libs-5.5.50-1.el7_2.x86_64
安装mysql
下载repo源
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
安装该rpm包(安装这个包后,会获得两个mysql的yum repo源:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo)
rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装mysql
yum install mysql-server -y
启动mysql
systemctl start mysql
查看mysql是否开启
systemctl status mysql
5.下载
数据库脚本
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/
下载安装包
wget https://github.com/open-falcon/falcon-plus/archive/master.zip
后台安装
创建工作目录
export FALCON_HOME=/home/work
export WORKSPACE=$FALCON_HOME/open-falcon
mkdir -p $WORKSPACE
解压二进制包
tar -xzvf open-falcon-v0.2.0.tar.gz -C $WORKSPACE
在一台机器上启动所有的后端组件
启动
cd $WORKSPACE
./open-falcon start
检查所有模块的启动状况
./open-falcon check
更多的命令行工具用法
./open-falcon [start|stop|restart|check|monitor|reload] module
./open-falcon start agent
./open-falcon check
falcon-graph UP 53007
falcon-hbs UP 53014
falcon-judge UP 53020
falcon-transfer UP 53026
falcon-nodata UP 53032
falcon-aggregator UP 53038
falcon-agent UP 53044
falcon-gateway UP 53050
falcon-api UP 53056
falcon-alarm UP 53063
For debugging , You can check $WorkDir/$moduleName/log/logs/xxx.log
前台安装
创建工作目录
export HOME=/home/work
export WORKSPACE=$HOME/open-falcon
mkdir -p $WORKSPACE
cd $WORKSPACE
克隆前端组件代码
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"
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,默认密码为””
在生产环境启动
bash control start
停止dashboard运行
bash control stop
查看日志
bash control tail