open-falcon 分布式安装

1,open-falcon 分布式安装

服务器安装组件
192.168.0.202单机版运行所有组件
192.168.0.196运行组件transferhbsagent

1.1 服务器192.168.0.196

  • open-falcon-v0.3.x.tar.gz
# scp open-falcon-v0.3.x.tar.gz root@192.168.0.196:/home/
# mkdir open-falcon
# tar -zxvf open-falcon-v0.3.x.tar.gz -C open-falcon/
  • transfer
# cp open-falcon/transfer/config/cfg.json{,.backup}
# ls open-falcon/transfer/config/
cfg.json  cfg.json.backup
# vim open-falcon/transfer/config/cfg.json
cat open-falcon/transfer/config/cfg.json | jq ."judge"
{
  "enabled": true,
  "batch": 200,
  "connTimeout": 1000,
  "callTimeout": 5000,
  "maxConns": 32,
  "maxIdle": 32,
  "replicas": 500,
  "cluster": {
    "judge-00": "192.168.0.202:6080"
  }
}
cat open-falcon/transfer/config/cfg.json | jq ."graph"
{
  "enabled": true,
  "batch": 200,
  "connTimeout": 1000,
  "callTimeout": 5000,
  "maxConns": 32,
  "maxIdle": 32,
  "replicas": 500,
  "cluster": {
    "graph-00": "192.168.0.202:6070"
  }
}
  • hbs
cp open-falcon/hbs/config/cfg.json{,.backup}
ls open-falcon/hbs/config/
	cfg.json  cfg.json.backup
cat open-falcon/hbs/config/cfg.json
{
    "debug": true,
    "database": "root:@tcp(192.168.0.202:3306)/falcon_portal?loc=Local&parseTime=true",
    "hosts": "",
    "maxConns": 20,
    "maxIdle": 15,
    "listen": ":6030",
    "trustable": [""],
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:6031"
    }
}

2,运行

# ./open-falcon start agent
[falcon-agent] 33027
# ./open-falcon start hbs
[falcon-hbs] 33095
# ./open-falcon start transfer
[falcon-transfer] 33177
  • hbs启动失败
# ./open-falcon check
        falcon-graph       DOWN               -
          falcon-hbs       DOWN               -
        falcon-judge       DOWN               -
     falcon-transfer         UP           33177
       falcon-nodata       DOWN               -
   falcon-aggregator       DOWN               -
        falcon-agent         UP           33027
      falcon-gateway       DOWN               -
          falcon-api       DOWN               -
        falcon-alarm       DOWN               -
  • 查看hbs日志
    数据库连接失败
cat /root/open-falcon/hbs/logs/hbs.log
2019/11/29 15:31:25 cfg.go:79: read config file: /root/open-falcon/hbs/config/cfg.json successfully
2019/11/29 15:31:25 db.go:38: ping db fail: dial tcp 192.168.0.202:3306: connect: connection refused
2019/11/29 15:33:36 cfg.go:79: read config file: /root/open-falcon/hbs/config/cfg.json successfully
2019/11/29 15:33:36 db.go:38: ping db fail: dial tcp 192.168.0.202:3306: connect: connection refused

3,登陆安装数据库的节点192.168.0.202

mysql> select Host,User,authentication_string,plugin from user;
+-----------+------------------+-------------------------------------------+-----------------------+
| Host      | User             | authentication_string                     | plugin                |
+-----------+------------------+-------------------------------------------+-----------------------+
| localhost | root             |                                           | mysql_native_password |
| localhost | mysql.session    | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| localhost | mysql.sys        | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| localhost | debian-sys-maint | *FA4B1F47B8478379F08A57DAD145CE48A2B53E47 | mysql_native_password |
+-----------+------------------+-------------------------------------------+-----------------------+
4 rows in set (0.00 sec)
  • 配置mysql数据库root远程登陆
mysql> update user set Host='%' where User='root';
mysql> select Host,User,authentication_string,plugin from user;
+-----------+------------------+-------------------------------------------+-----------------------+
| Host      | User             | authentication_string                     | plugin                |
+-----------+------------------+-------------------------------------------+-----------------------+
| %         | root             |                                           | mysql_native_password |
mysql> grant all on *.* to 'root'@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.05 sec)
grep -irn 127.0.0.1 ./
./mysql.conf.d/mysqld.cnf:43:bind-address		= 127.0.0.1
  • 注释bind-address
vim /etc/mysql/mysql.conf.d/mysqld.cnf
# bind-address          = 127.0.0.1
  • 重启mysql
systemctl restart mysql.service

4,重启启动hbs 192.168.0.196

# ./open-falcon start hbs
[falcon-hbs] 48105
# ./open-falcon check
        falcon-graph       DOWN               -
          falcon-hbs         UP           48105
        falcon-judge       DOWN               -
     falcon-transfer         UP           33177
       falcon-nodata       DOWN               -
   falcon-aggregator       DOWN               -
        falcon-agent         UP           33027
      falcon-gateway       DOWN               -
          falcon-api       DOWN               -
        falcon-alarm       DOWN               -
  • 服务器添加成功
    在这里插入图片描述

6,其它分布式节点安装

scp -r root@192.168.0.196:/root/open-falcon/ .
./open-falcon check
./open-falcon start hbs && ./open-falcon start agent && ./open-falcon start transfer

参考:

  1. open-falcon 搭建
  2. 在多台机器上分布式安装 官方文档
  3. open-falcon分布式监控(多个IDC机房)
  4. open-falcon搭建(一)
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值