centos7系统open-falcon安装流程图解(单机安装,docker安装,分布式安装)

open-falcon

open-falcon的目标是做最开放、最好用的互联网企业级监控产品。

在这里插入图片描述

1、单机安装

1.1、搭建golang语言环境

下载golang

根据操作系统下载golang对应的RPM包:
https://pkgs.org/download/golang

golang-1.13.3-1.el7.x86_64.rpm
golang-bin-1.13.3-1.el7.x86_64.rpm
golang-src-1.13.3-1.el7.noarch.rpm

在这里插入图片描述

安装golang
yum install gcc
yum install git
yum install subversion
yum install mercurial

在这里插入图片描述

go version

在这里插入图片描述

配置GOPATH和GOROOT环境变量
go env

在这里插入图片描述

1.2、搭建运行环境

安装redis
yum install -y epel-release
yum install -y redis
安装mysql-server
yum -y install wget
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install -y mysql-server

1.3、安装Falcon

下载Falcon
mkdir -p $GOPATH/src/github.com/open-falcon
cd $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

在这里插入图片描述

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

# make all modules
make all

# make specified module
make agent

# pack all modules
make pack

执行完毕make pack 会在当前目录下生成一个open-falcon-vx.x.x.tar.gz
在这里插入图片描述

1.4、运行启动Falcon

将open-falcon-vx.x.x.tar.gz复制到运行目录下,解压
在这里插入图片描述

启动
./open-falcon start

在这里插入图片描述

检查状态
# check modules status
./open-falcon check

在这里插入图片描述

1.4、运行启动Frontend Dashboard

下载Dashboard
cd /root/open-falcon/
git clone https://github.com/open-falcon/dashboard.git
cd dashboard

在这里插入图片描述dashboard config file is ‘rrd/config.py’

安装运行环境
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 /root/open-falcon/dashboard/
virtualenv ./env

./env/bin/pip install -r pip_requirements.txt
在开发者模式下运行
source ./env/bin/python wsgi.py
export FLASK_ENV=development
flask run --host=0.0.0.0 --port=8081
在生产模式下运行

Run with gunicorn in production mode

bash control start

在这里插入图片描述

访问

open http://127.0.0.1:8081 in your browser.
在这里插入图片描述dashbord没有默认创建任何账号包括管理账号,需要通过页面进行注册账号。
想拥有管理全局的超级管理员账号,需要手动注册用户名为root的账号(第一个帐号名称为root的用户会被自动设置为超级管理员)
超级管理员可以给普通用户分配权限管理。

小提示:注册账号能够被任何打开dashboard页面的人注册,所以当给相关的人注册完账号后,需要去关闭注册账号功能。只需要去修改api组件的配置文件cfg.json,将signup_disable配置项修改为true,重启api即可。当需要给人开账号的时候,再将配置选项改回去,用完再关掉即可。

2、Docker安装

docker run -itd \
        --name falcon-mysql \
        -v /root/open_falcon/mysql-data:/var/lib/mysql \
        -e MYSQL_ALLOW_EMPTY_PASSWORD=true \
        -p 3306:3306 \
        mysql:5.7

在这里插入图片描述

git clone --depth=1 https://github.com/open-falcon/falcon-plus
cd /root/open_falcon/falcon-plus
#!/bin/sh

for x in `ls ./scripts/mysql/db_schema/*.sql`; do
    echo init mysql table $x ...;
    docker exec -i falcon-mysql mysql -uroot < $x;
done

在这里插入图片描述

docker run --name falcon-redis -p6379:6379 -d redis:4-alpine3.8

在这里插入图片描述

docker run -itd --name falcon-plus \
     --link=falcon-mysql:db.falcon \
     --link=falcon-redis:redis.falcon \
     -p 8433:8433 \
     -p 8080:8080 \
     -e MYSQL_PORT=root@tcp\(db.falcon:3306\) \
     -e REDIS_PORT=redis.falcon:6379  \
     -v /root/open_falcon/open-falcon/data:/open-falcon/data \
     -v /root/open_falcon/open-falcon/logs:/open-falcon/logs \
     openfalcon/falcon-plus:v0.3

在这里插入图片描述

docker exec falcon-plus sh ctrl.sh start graph hbs judge transfer nodata aggregator agent gateway api alarm
## check status of backend modules
docker exec falcon-plus ./open-falcon check

在这里插入图片描述

docker run -itd --name falcon-dashboard \
        -p 8081:8081 \
        --link=falcon-mysql:db.falcon \
        --link=falcon-plus:api.falcon \
        -e API_ADDR=http://api.falcon:8080/api/v1 \
        -e PORTAL_DB_HOST=db.falcon \
        -e PORTAL_DB_PORT=3306 \
        -e PORTAL_DB_USER=root \
        -e PORTAL_DB_NAME=falcon_portal \
        -e ALARM_DB_HOST=db.falcon \
        -e ALARM_DB_PORT=3306 \
        -e ALARM_DB_USER=root \
        -e ALARM_DB_NAME=alarms \
        -w /open-falcon/dashboard openfalcon/falcon-dashboard:v0.2.1  \
       './control startfg'

在这里插入图片描述

docker run -d --restart always --name falcon-agent -e NUX_ROOTFS=/rootfs -v /:/rootfs:ro openfalcon/falcon-plus:v0.3 ./agent/bin/falcon-agent -c /open-falcon/agent/config/cfg.json
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值