Poller注册Centron:No parent platform was found for : ‘poller1’@’IP’
2023/06/14 11:13 投稿

转载文章请注明源地址:https://www.latiao.org/948.html

本系列暂定共四篇文章:

1.离线部署Centreon 22.10.X -Central端

2.离线部署Centreon 22.10.X -Poller端

3.离线迁移Centreon2.8.X到22.10.X

4.No parent platform was found for : ‘poller1’@’IP’

当执行poller注册到centreon脚本时,碰到如下报错:

[root@centron-upgrade-test2 ~]# /usr/share/centreon/bin/registerServerTopology.sh -u admin -t poller -h 192.168.26.208 -n poller1
Please enter the password of 192.168.26.208: 

  Summary of the information that will be sent:

  Api Connection:
  username: admin
  password: ******
  target server: 192.168.26.208

  Pending Registration Server:
  name: poller1
  hostname: centron-upgrade-test2
  type: poller
  address: 192.168.26.201

Do you want to register this server with the previous information? (y/n): y
2023-06-13 21:59:38-04:00 - ERROR - http://192.168.26.208:80: {"message":"No parent platform was found for : 'poller1'@'192.168.26.201'"}

这一般是cetral端 也就是server端的IP地址修改导致的。 我们可以通过登录数据库,执行以下语句查询就会发现,数据库里面的 IP 不是192.168.26.208 而是192.168.26.200。 这是因为我操作过修改IP地址。

[root@centreon-upgrade-test ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8287
Server version: 10.5.19-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use centreon;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [centreon]> select * from platform_topology;
+----+----------------+-----------------------+---------+---------+-----------+---------+-----------+
| id | address        | hostname              | name    | type    | parent_id | pending | server_id |
+----+----------------+-----------------------+---------+---------+-----------+---------+-----------+
|  2 | 192.168.26.200 | centreon-upgrade-test | Central | central |      NULL | 0       |         1 |
+----+----------------+-----------------------+---------+---------+-----------+---------+-----------+
1 row in set (0.000 sec)

那么如何解决呢?我们可以在web端直接修改central的地址为现在的实际IP地址,然后再次查询,就会发现数据库产生了更新。

保存后就发生了变更。再次去查询数据库,发现已经同步。

MariaDB [centreon]> select * from platform_topology;
+----+----------------+-----------------------+---------+---------+-----------+---------+-----------+
| id | address        | hostname              | name    | type    | parent_id | pending | server_id |
+----+----------------+-----------------------+---------+---------+-----------+---------+-----------+
|  2 | 192.168.26.208 | centreon-upgrade-test | Central | central |      NULL | 0       |         1 |
+----+----------------+-----------------------+---------+---------+-----------+---------+-----------+
1 row in set (0.001 sec)

重新返回poller端,重新注册,看看效果:

[root@centron-upgrade-test2 ~]# /usr/share/centreon/bin/registerServerTopology.sh -u admin -t poller -h 192.168.26.208 -n poller1
Please enter the password of 192.168.26.208: 

  Summary of the information that will be sent:

  Api Connection:
  username: admin
  password: ******
  target server: 192.168.26.208

  Pending Registration Server:
  name: poller1
  hostname: centron-upgrade-test2
  type: poller
  address: 192.168.26.201

Do you want to register this server with the previous information? (y/n): y
2023-06-13 22:20:53-04:00 - INFO - The CURRENT NODE poller: '[email protected]' linked to TARGET NODE: http://192.168.26.208:80 has been added

添加成功!

可以参考这篇文章: 分布式监控系列:离线部署Centreon 22.10.X -Poller端 – 辣条网 (latiao.org)

如果无法启动poller,可以查看下/var/log/centreon-gorgone的日志,是否有如下报错

2023-06-13 23:11:17 - ERROR - [proxy] Send message problem for '5': fingerprint changed for target 'tcp://192.168.26.201:5556' [id: 1] [old fingerprint: 9y82Tby25xrKNt5hAHtKwf9Faboe_qeDUzoglu8akZE] [new fingerprint: qlxbKYO0xaggUYOBzAW3H2HbmrDr4oWv8FLTG3NGzRw]

如果出现了这个错误,我们更新下gorgone的指纹,并且重启gorgone的服务即可:

[root@centreon-upgrade-test centreon-gorgone]# sqlite3 /var/lib/centreon-gorgone/history.sdb
SQLite version 3.26.0 2018-12-01 12:34:55
Enter ".help" for usage hints.
sqlite> 
sqlite> SELECT * FROM gorgone_target_fingerprint;
1|tcp://192.168.26.201:5556|9y82Tby25xrKNt5hAHtKwf9Faboe_qeDUzoglu8akZE
sqlite> UPDATE gorgone_target_fingerprint SET fingerprint = 'qlxbKYO0xaggUYOBzAW3H2HbmrDr4oWv8FLTG3NGzRw' WHERE fingerprint = '9y82Tby25xrKNt5hAHtKwf9Faboe_qeDUzoglu8akZE';
sqlite> SELECT * FROM gorgone_target_fingerprint;
1|tcp://192.168.26.201:5556|qlxbKYO0xaggUYOBzAW3H2HbmrDr4oWv8FLTG3NGzRw
sqlite> .quit
[root@centreon-upgrade-test centreon-gorgone]# systemctl restart gorgoned