Debian 上学习着搭建 MySQL 集群报 The hostname this node should have according to …… 的错误, why?

2020 年 11 月 7 日
 Newyorkcity

开门见山地放一下错误信息:

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


Host1:

ip: 42.a1.b1.c1

这台主机上安装了 mysql-cluster-community-server, mysql-cluster-community-management-server and mysql-cluster-community-data-node 这三个软件,也就是说我希望它同时担当管理节点,SQL 节点和数据节点。

Host2:

ip: 119.a2.b2.c2

这台主机上同时安装了 mysql-cluster-community-server and mysql-cluster-community-data-node 这两个软件,即同时担当 SQL 节点和数据节点。

这样同时担当不可行嘛?一个主机只能担任一种节点?

一台早就买了的学生机,一台最近双 11 刚入的云服务器,可以看到它们两个 IP 差距很大。再多云服务器买不起了,所以希望一台主机多个角色。


软件仅仅只是安装,在下面的任何操作前,没有任何软件被启动。安装的方式来自这篇官方文档。

在 host1 上执行 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)

在 host1 上执行 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'

这里的 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 是什么情况啊,如何解决?

感谢!

1107 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://v2ex.ih06.com/t/722739

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX