Fork me on GitHub
Suzf  Blog

[faq] Couchbase cant start because of the ip addr nightmare

许久之前,再次打开在本地 VM 创建的 Couchbase 有些异常 服务无法正常运行 查看日志,如下:
# /opt/couchbase/var/lib/couchbase/logs/info.log
[ns_server:warn,2016-08-15T13:47:59.536+08:00,[email protected]:dist_manager<0.129.0>:dist_manager:wait_for_address:121]Cannot listen on address `cb1.suzf.net`: eaddrnotavail
[ns_server:info,2016-08-15T13:47:59.536+08:00,[email protected]:dist_manager<0.129.0>:dist_manager:wait_for_address:125]Configured address `cb1.suzf.net` seems to be invalid. Giving OS a chance to bring it up.
[ns_server:error,2016-08-15T13:48:00.537+08:00,[email protected]:dist_manager<0.129.0>:dist_manager:init:178]Configured address `cb1.suzf.net` seems to be invalid. Will refuse to start for safety reasons.
看起来是说主机名称  cb.suzf.net  无效,以至于服务 无法正常启动。 O 想起来了, 曾经修改过 /etc/hosts 记录
#grep cb /etc/hosts
172.16.9.10     cb1.suzf.net
172.16.9.20     cb2.suzf.net
而当前的IP为
#ifconfig eth1|grep 'inet addr'
          inet addr:172.16.9.11  Bcast:172.16.9.255  Mask:255.255.255.0
下面来更正 hosts 记录
#grep cb /etc/hosts
172.16.9.11     cb1.suzf.net
172.16.9.20     cb2.suzf.net
It worked.

There are several ways you can provide hostnames:

  • When installing a Couchbase Server on a machine.
  • When adding a node to an existing cluster for an online upgrade.
  • Using a REST API call.

Hostname Errors

Provide the hostname and port for the node and administrative credentials for the cluster. The value you provide for hostname must be a valid hostname for the node. Possible errors that can occur:

  • Could not resolve the host name. The host name you provide as a parameter does not resolve to a IP address.
  • Could not listen. The host name resolves to an IP address, but no network connection exists for the address.
  • Could not rename the node because name was fixed at server start-up.
  • Could not save address after rename.
  • Requested name host name is not allowed. Invalid host name provided.
  • Renaming is disallowed for nodes that are already part of a cluster.
节选自: http://developer.couchbase.com/documentation/server/4.1/install/hostnames.html