Centos7 7.5 1804 安装Open-falcon 0.2.1

1.下载安装wget

yum install -y wget

2.升级所有安装包

yum   -y  update

3.安装git

yum -y install git

git version

安装结束后查看git版本 git >=  1.7.5

4.安装go语言环境

yum -y install epel-release

 

CentOS: rpm --import https://mirror.go-repo.io/centos-unstable/RPM-GPG-KEY-GO-REPO curl -s https://mirror.go-repo.io/centos-unstable/go-repo-unstable.repo | tee /etc/yum.repos.d/go-repo-unstable.repo


yum -y install golang

go version 

安装结束后查看go版本   go > 1.6

5.安装redis

yum -y install redis

启动redis

systemctl  start  redis

创建开机启动

systemctl  enable redis

查看redis状态

systemctl status redis

6.安装mysql

 下载安装repo源 :wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm

                          rpm -ivh mysql-community-release-el7-5.noarch.rpm

安装mysql

 yum -y  install mysql-server 

启动mysql 

systemctl start mysql

查看mysql状态

systemctl  status mysql

设置环境变量GOROOT和GOPATH

export GOROOT=/usr/lib/golang

export GOPATH=/home

7.在github get open-falcon源码

创建GOPATH下的本地路径

mkdir -p $GOPATH/src/github.com/open-falcon

cd $GOPATH/src/github.com/open-falcon

将源码get  $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

root用户没有密码 可直接回车

编译并打包

cd $GOPATH/src/github.com/open-falcon/falcon-plus/

go get github.com/open-falcon/rrdlite

make all

make pack

 

部署后端

创建目录

export WORKSPACE=/home/work

mkdir -p $WORKSPACE

解压二进制安装包

cd $GOPATH/src/github.com/open-falcon/falcon-plus/

tar xf open-falcon-v0.2.1.tar.gz -C $WORKSPACE

修改配置文件cfg.json

模块配置文件所在路径
aggregator   /home/work/aggregator/config/cfg.json
graph/home/work/graph/config/cfg.json
hbs/home/work/hbs/config/cfg.json
nodata/home/work/nodata/config/cfg.json
api/home/work/api/config/cfg.json
alarm/home/work/alarm/config/cfg.json

启动后端模块

cd $WORKSPACE

./open-falcon start

检查各个模块启动状态

./open-falcon check

部署后端模块

export FRONTSPACE=/home/front/open-falcon

mkdir -p $FRONTSPACE

获取前端代码

cd $FRONTSPACE

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" -y

cd $FRONTSPACE/dashboard/
virtualenv ./env

./env/bin/pip install -r pip_requirements.txt

dashboard的配置文件在/home/front/open-falcon/dashboard/rrd/config.py,需要根据实际情况对内部配置进行修改。

开启防火墙8081端口

firewall-cmd --add-port=8081/tcp --permanent

重新载入防火墙配置

firewall-cmd --reload

在生产环境启动

bash control start

在开发环境启动

./env/bin/python wsgi.py

 

 

 

 

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值