为什么会发生错误"The hostname this node should have according to the configuration does not match a local in



Host1:

ip:42.a1.b1.c1(在配置文件中,a1、b1、c1将被实值替换。(

mysql集群社区服务器、mysql集群社区管理服务器和mysql集群社区数据节点都安装在该主机上。

主机2:

ip:119.a2.b2.c2(在配置文件中,a2、b2、c2将被实值替换。(

mysql集群社区服务器和mysql集群社区数据节点都安装在该主机上。

两台主机上的所有mysql-cluster-*软件都没有启动。


主机1上的cat /var/lib/mysql-cluster/config.ini输出:

[ndbd default]
# Options affecting ndbd processes on all data nodes:
NoOfReplicas=1    # Number of fragment replicas
DataMemory=80M    # How much memory to allocate for data storage
IndexMemory=18M   # How much memory to allocate for index storage
# For DataMemory and IndexMemory, we have used the
# default values. Since the "world" database takes up
# only about 500KB, this should be more than enough for
# this example NDB Cluster setup.
# NOTE: IndexMemory is deprecated in NDB 7.6 and later; in
# these versions, resources for all data and indexes are
# allocated by DataMemory and any that are set for IndexMemory
# are added to the DataMemory resource pool
ServerPort=2202   # This the default value; however, you can use any
# port that is free for all the hosts in the cluster
# Note1: It is recommended that you do not specify the port
# number at all and simply allow the default value to be used
# instead
# Note2: The port was formerly specified using the PortNumber
# TCP parameter; this parameter is no longer available in NDB
# Cluster 7.5.
[ndb_mgmd]
# Management process options:
HostName=42.a1.b1.c1           # Hostname or IP address of management node
DataDir=/var/lib/mysql-cluster  # Directory for management node log files
#[ndbd]
#Options for data node "A":
# (one [ndbd] section per data node)
#HostName=42.a1.b1.c1           # Hostname or IP address
#NodeId=2                        # Node ID for this data node
#DataDir=/usr/local/mysql/data   # Directory for this data node's data files
[ndbd]
#Options for data node "B":
HostName=119.a2.b2.c2         # Hostname or IP address
NodeId=3                        # Node ID for this data node
DataDir=/usr/local/mysql/data   # Directory for this data node's data files
[mysqld]
#SQL node options:
HostName=119.a2.b2.c2           # Hostname or IP address
# (additional mysqld connections can be
# specified for this node for various
# purposes such as running ndb_restore)

主机1上的ndb_mgmd -f /var/lib/mysql-cluster/config.ini --ndb-nodeid=1输出:

MySQL Cluster Management Server mysql-5.7.32 ndb-7.6.16
2020-11-07 16:35:20 [MgmtSrvr] WARNING  -- at line 5: [DB] IndexMemory is deprecated, will use Number bytes on each ndbd(DB) node allocated for storing indexes instead
2020-11-07 16:35:20 [MgmtSrvr] ERROR    -- The hostname this node should have according to the configuration does not match a local interface. Attempt to bind '42.a1.b1.c1' failed with error: 99 'Cannot assign requested address'

为什么会出现错误";根据配置,该节点应该具有的主机名与本地接口"不匹配";发生

非常感谢。

之所以发生这种情况,是因为当您的ndb服务加载时,/etc/hosts尚未在启动时加载到ram中。我确实在我的案例中解决了这个问题,只需在服务脚本中添加5秒的暂停。

详细信息:【服务】ExecStartPre=-/bin/sleep 5

相关内容

  • 没有找到相关文章

最新更新