[英]mysqld won't connect to MySQL Cluster nor Data Nodes
I've created a v8.0MySQL cluster running on 4 VMs.我创建了一个在 4 个虚拟机上运行的 v8.0MySQL 集群。 VMs 1 & 2 have the MySQL and Cluster Manager daemon installed.虚拟机 1 和 2 安装了 MySQL 和集群管理器守护进程。 VMs 3 & 4 have the Data Node daemon installed. VM 3 和 4 安装了数据节点守护进程。
Configuration of VMs:虚拟机的配置:
╓──────────────────────╥─────────────────────╥────────────────────╥────────────────────╖
║ [VM1] ║ [VM2] ║ [VM3] ║ [VM4] ║
║ 10.103.0.11 ║ 10.103.0.12 ║ 10.103.0.23 ║ 10.103.0.24 ║
║ mysql-clustermgr-01 ║ mysql-clustermgr-02 ║ mysql-datanode-01 ║ mysql-datanode-02 ║
║ ------------------- ║ ------------------- ║ ------------------ ║ ----------------- ║
║ mysqld (NodeId=5) ║ mysqld (NodeId=6) ║ ndbd (NodeId=3) ║ ndbd (NodeId=4) ║
║ ndb_mgmd(NodeId=1) ║ ndb_mgmd(NodeId=2) ║ ║ ║
╙──────────────────────╨─────────────────────╨────────────────────╨────────────────────╜
I have ufw
disabled on all nodes to alleviate any FW issues.我在所有节点上禁用了ufw
以缓解任何 FW 问题。 I can ping between all the servers in question without issue.我可以毫无问题地在所有有问题的服务器之间执行 ping 操作。 All servers belong to the same su.net.所有服务器都属于同一个 su.net。 I have set the permissions for /etc/mysql
from root:root
to mysql:mysql
.我已经将/etc/mysql
的权限从root:root
设置为mysql:mysql
。 I have tried several how-to's on the Inte.net that diagnose around mysqld not connecting.我在 Inte.net 上尝试了一些关于 mysqld 未连接的诊断方法。 Nothing seems to work over the last couple days.最近几天似乎没有任何效果。 I have tried several configurations and this is as far as I can get with output from ndb_mgm
:我已经尝试了几种配置,这是我从ndb_mgm
得到的 output 所能得到的:
emerg@mysql-clustermgr-01:~$ ndb_mgm -e show
Connected to Management Server at: mysql-clustermgr-01:1186
Cluster Configuration
---------------------
[ndbd(NDB)] 2 node(s)
id=3 @10.103.0.23 (mysql-8.0.28 ndb-8.0.28, starting, Nodegroup: 0)
id=4 @10.103.0.24 (mysql-8.0.28 ndb-8.0.28, starting, Nodegroup: 0)
[ndb_mgmd(MGM)] 2 node(s)
id=1 @10.103.0.11 (mysql-8.0.28 ndb-8.0.28)
id=2 @10.103.0.12 (mysql-8.0.28 ndb-8.0.28)
[mysqld(API)] 2 node(s)
id=5 (not connected, accepting connect from mysql-clustermgr-01)
id=6 (not connected, accepting connect from mysql-clustermgr-02)
As you can see, the two cluster daemons can see each other just fine, however mysqld
and ndbd
on the data nodes refuse to connect/start respectively.如您所见,两个集群守护进程可以很好地相互看到,但是数据节点上的mysqld
和ndbd
分别拒绝连接/启动。
Here's my configuration files:这是我的配置文件:
[VM1] /etc/mysql/my.cnf [VM1] /etc/mysql/my.cnf
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
ndbcluster
[mysql_cluster]
ndb-connectstring=NodeId=5,mysql-clustermgr-01,mysql-clustermgr-02
[VM2] /etc/mysql/my.cnf [VM2] /etc/mysql/my.cnf
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
[mysqld]
ndbcluster
[mysql_cluster]
ndb-connectstring=NodeId=6,mysql-clustermgr-01,mysql-clustermgr-02
[VM1 & VM2] /var/lib/mysql-cluster/config.ini [VM1 & VM2] /var/lib/mysql-cluster/config.ini
[ndbd default]
NoOfReplicas=2
DataMemory=80M
DataDir=/var/lib/mysql-cluster
[ndb_mgmd]
HostName=mysql-clustermgr-01
DataDir=/var/lib/mysql-cluster
NodeId=1
[ndb_mgmd]
HostName=mysql-clustermgr-02
DataDir=/var/lib/mysql-cluster
NodeId=2
[ndbd]
HostName=mysql-datanode-01
NodeId=3
datadir=/usr/local/mysql/data
LockExecuteThreadToCPU=1
LockMaintThreadsToCPU=0
[ndbd]
HostName=mysql-datanode-02
NodeId=4
datadir=/usr/local/mysql/data
[mysqld]
HostName=mysql-clustermgr-01
NodeId=5
[mysqld]
HostName=mysql-clustermgr-02
NodeId=6
[VM3] /etc/my.cnf [VM3] /etc/my.cnf
[mysqld]
ndbcluster
[mysql_cluster]
ndb-connectstring=NodeId=3,mysql-clustermgr-01,mysql-clustermgr-02
[VM4] /etc/my.cnf [VM4] /etc/my.cnf
[mysqld]
ndbcluster
[mysql_cluster]
ndb-connectstring=NodeId=4,mysql-clustermgr-01,mysql-clustermgr-02
Services start fine, does anything within the configuration or architecture jump out at anyone?服务启动良好,配置或架构中的任何内容是否会突然出现?
Figured it out, you can't use hostnames, you have to use IPs in all config files.想通了,你不能使用主机名,你必须在所有配置文件中使用 IP。 Man that set me back two days.让我倒退两天的人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.