我正在尝试设置 mySql 管理器 + 数据节点 + sql 服务器(服务器 A)和另一个数据节点集群(服务器 B)。两者均在 Ubuntu 16.04 amd_64 上运行
服务器 A
/etc/hosts也在服务器 B 上
Both private ip
172.xx.xx.xx ip-172-xx-xx-xx-eu-west-1.compute.internal
172.xx.xx.xx ip-172-xx-xx-xx.eu-east-1.compute.internal
/配置.ini
[ndbd default]
NoOfReplicas=2 # Number of replicas
[ndb_mgmd]
hostname=ip-172-xx-xx-xx.eu-west-1.compute.internal <- Server A
datadir=/var/lib/mysql-cluster
NodeId=1
[ndbd]
hostname=ip-172-xx-xx-xx.eu-west-1.compute.internal <- Server A
NodeId=3
datadir=/usr/local/mysql/data
[ndbd]
hostname=ip-172-xx-xx-xx.eu-east-1.compute.internal <- Server B
NodeId=2
datadir=/usr/local/mysql/data
[mysqld]
hostname=ip-172-xx-xx-xx.eu-west-1.compute.internal <- Server A
/etc/my.cnf
[mysqld]
ndbcluster
[mysq_cluster]
ndb-connectstring = ip-172-xx-xx-xx.eu-west-1.compute.internal <- Server A
服务器 B
/etc/my.cnf
[mysqld]
ndbcluster
[mysql_cluster]
ndb-connectstring=172.xx.xx.xx <- Server A private ip
服务器 A 错误
运行 ndbd 时出现此错误
[ndbd] INFO -- Angel connected to '172.xx.xx.xx:1186'
[ndbd] ERROR -- Failed to allocate nodeid, error: 'Error: Could not alloc node id at 172.xx.xx.xx port 1186: Connection done from wrong host ip 172.xx.xx.xx.'
服务器B错误
运行 ndbd 时出现此错误
Unable to connect with connect string: nodeid=0,172.xx.xx.xx:1186
Retrying every 5 seconds. Attempts left: 12
ndb_mgm
-- NDB Cluster -- Management Client --
ndb_mgm> show
Connected to Management Server at: 172.xx.xx.xx:1186 <- A
Cluster Configuration
---------------------
[ndbd(NDB)] 1 node(s)
id=2 (not connected, accepting connect from 172.xx.xx.xx) <- B
[ndb_mgmd(MGM)] 1 node(s)
id=1 @172.x.x.x (mysql-5.7.22 ndb-7.6.6)
[mysqld(API)] 1 node(s)
id=3 (not connected, accepting connect from 172.xx.xx.xx) <- A
不确定在安装服务器/客户端集群后如何连接到 mysqld(API)才能正常工作。
另外,我在实例 A 和 B 上都设置了入站流量,以接受所有端口范围 1000-60000 之间的所有流量,以防我遗漏了某些内容,而出站流量对所有内容都开放。
我想知道我错过了什么,今天我太累了,试图找出设置中发生了什么。
任何帮助将不胜感激 !