Memcached is unable to start in 5.5.0 if the IPv6 protocol stack has not been loaded on the machine:
This is a regression from 5.1.x where memcached would start up fine.
Looking at the code, we check the values of the interfaces passed in memcached.json and see if each interface is ipv4 or ipv6.
Based on these values we then try to setup ipv4 and ipv6 sockets, if either of these fail then we terminate memcached.
However, I can't actually see anywhere that ns_server ever populates the ipv4 and ipv6 fields of the config, so memcached always defaults these to true, even if ipv6 is disabled at the kernel-level.
- Start up a centos6 machine (with Couchbase Server 5.5 installed)
- Create the file /etc/modprobe.d/ipv6.conf
- Add the line 'options ipv6 disable=1' to this file (seems to be a recommend way to disable ipv6 https://www.thegeekdiary.com/how-to-enable-ipv6-on-centos-rhel-6/)
- Reboot the machine
- Observe that memcached can no longer startup properly
There are two methods to disable IPv6 on recent Linux distributions:
- Disable the entire IPv6 protocol stack - typically by adding a boot-time grub parameter: ipv6.disable=1
- Disable assignment of IPv6 addresses to interfaces - either by setting the boot-time grub parameter: ipv6.disable_ipv6=1, or dynamically by setting the appropriate net.ipv6.conf sysctl properties.
Only method 1 triggers this issue. If method 2 is used, then the problem does not occur.
Contents of memcached.json:
|For Gerrit Dashboard: MB-30610|
|97325,2||MB-30610: Don't fail server_socket() if at least one protocol successful||vulcan||kv_engine||Status: MERGED||+2||+1|
|98114,1||Merge branch 'vulcan'||master||kv_engine||Status: MERGED||+2||+1|