我正在尝试在Ubuntu 14.04上设置一个三节点Aerospike集群.除了IP地址/名称,每台机器都是相同的.我根据文档在每台机器上安装了Aerospike和管理控制台.
然后我编辑了网络/服务和网络/心跳部分/etc/aerospike/aerospike.conf:
network {
service {
address any
port 3000
access-address 10.0.1.11 # 10.0.1.12 and 10.0.1.13 on the other two nodes
}
heartbeat {
mode mesh
port 3002
mesh-seed-address-port 10.0.1.11 3002
mesh-seed-address-port 10.0.1.12 3002
mesh-seed-address-port 10.0.1.13 3002
interval 150
timeout 10
}
[...]
}
Run Code Online (Sandbox Code Playgroud)
当我sudo service aerospike start在每个节点上时,服务运行但它没有聚集.如果我尝试在管理控制台中添加另一个节点,它会通知我:"此处无法监视节点10.0.1.12:3000,因为它属于不同的集群."
你能看出我做错了什么吗?我应该aerospike.conf在每个节点上进行哪些更改,以便设置Aerospike集群而不是三个隔离的实例?
您的配置显示正确.
检查您是否能够通过端口3001和3002从每个主机打开到其余主机的TCP连接.
nc -z -w5 <host> 3001; echo $?
nc -z -w5 <host> 3002; echo $?
Run Code Online (Sandbox Code Playgroud)
如果不是我会首先怀疑防火墙配置.
netcat命令返回0,所以让我们尝试获取更多信息.
在每个节点上运行并提供以下输出:
asinfo -v service
asinfo -v services
asadm -e info
Run Code Online (Sandbox Code Playgroud)
在检查要点中的输出之后,asadm -e "info net"指示所有节点具有相同的节点ID.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Node Node Fqdn Ip Client Current HB HB
. Id . . Conns Time Self Foreign
h *BB9000000000094 hadoop01.woolford.io:3000 10.0.1.11:3000 15 174464730 37129 0
Number of rows: 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Node Node Fqdn Ip Client Current HB HB
. Id . . Conns Time Self Foreign
h *BB9000000000094 hadoop03.woolford.io:3000 10.0.1.13:3000 5 174464730 37218 0
Number of rows: 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Network Information~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Node Node Fqdn Ip Client Current HB HB
. Id . . Conns Time Self Foreign
h *BB9000000000094 hadoop02.woolford.io:3000 10.0.1.12:3000 5 174464731 37203 0
Number of rows: 1
Run Code Online (Sandbox Code Playgroud)
节点ID由结构端口(端口3001为十六进制)构成,后面是反向字节顺序的MAC地址.另一个标志是"HB Self"非零并且在网状配置中预期为零(在多播配置中,这也将是非零,因为节点将接收它们自己的心跳消息).
由于所有节点ID都相同,这表明所有MAC地址都相同(尽管可以使用机架感知来更改节点ID).看起来源自本地节点的心跳(由具有相同节点ID的hb确定)将被忽略.
MAC地址都是独一无二的,这与之前的结论相矛盾.回复提供了正在使用的接口名称em1,它不是Aerospike寻找的接口名称.Aerospike寻找名为eth#,bond#或wlan#的接口.我假设因为名称不是预期的三个之一,这引起了MAC地址的问题; 如果是这样我会怀疑日志中是否存在以下警告?
Tried eth,bond,wlan and list of all available interfaces on device.Failed to retrieve physical address with errno %d %s
Run Code Online (Sandbox Code Playgroud)
对于这样的场景,network-interface-name参数可以用于指示Aerospike哪个接口用于节点id生成.此参数还确定应将哪个接口的IP地址通告给客户端应用程序.
network {
service {
address any
port 3000
access-address 10.0.1.11 # 10.0.1.12 and 10.0.1.13 on the other two nodes
network-interface-name em1 # Needed for Node ID
}
Run Code Online (Sandbox Code Playgroud)
使用3.6.0版本,将自动发现这些设备名称.请参阅发行说明中的AER-4026.