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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章