Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 1.8
Additional Resources
Community Wiki
Community Forums
Couchbase SDKs
Parent Section
4.6 Using Couchbase in the Cloud
Chapter Sections
Chapters

4.6.2. IP addresses

The second issue is a bit trickier and requires configuring Couchbase to use a DNS entry instead of an IP address. By default, Couchbase Servers use their IP address as a unique identifier. If the IP changes, an individual node will not be able to identify its own configuration and other nodes that it was clustered to will not be able to access it. In order for a node to identify itself via a DNS name rather than and IP address, the following instructions must be followed. Note that this configuration is automatically handled by the RightScale server template.

A few points to keep in mind when setting this up:

Warning

The below steps will completely wipe any data and configuration from the node, so it is best to start with a fresh Couchbase install. If you already have a running cluster, you can easily rebalance a node out of the cluster, make the change and then rebalance it back into the cluster. Nodes with IPs and hostnames can exist in the same cluster.

For Linux:

  1. Install the Couchbase software

  2. Execute:

    sudo /etc/init.d/couchbase-server stop
  3. Edit the start() function in the script located at /opt/couchbase/bin/couchbase-server

    • Under the line that reads:

      -run ns_bootstrap -- \

      Add a new line that reads:

      -name ns_1@hostname \

      Where hostname is either a DNS name or an IP address that you want this server to identify the node (the 'ns_1@' prefix is mandatory). For example:

      ...
           -run ns_bootstrap -- \
           -name ns_1@couchbase1.company.com \
           -ns_server config_path "\"/opt/couchbase/etc/couchbase/static_config\"" \
      ...
  4. Delete the files under:

    • /opt/couchbase/var/lib/couchbase/data/*

    • /opt/couchbase/var/lib/couchbase/mnesia/*

    • /opt/couchbase/var/lib/couchbase/config/config.dat

  5. Execute:

    sudo /etc/init.d/couchbase-server start
  6. See the node correctly identifying itself as the hostname in the GUI under the Manage Servers page (you will be taken back to the setup wizard since the configuration was cleared out, but after completing the wizard the node will be named properly).

For Windows:

  1. Install the Couchbase Server software

  2. Stop the service by running:

    C:\Program Files\Couchbase\Server\bin\service_stop.bat
  3. Unregister the service by running:

    C:\Program Files\Couchbase\Server\bin\service_unregister.bat
  4. Edit the script located at C:\Program Files\Couchbase\Server\bin\service_register.bat:

    • On the 7th line it says set NS_NAME=ns_1@%IP_ADDR%

    • Replace %IP_ADDR% with the hostname/IP address that you want to use.

  5. Register the service by running the modified script C:\Program Files\Couchbase\Server\bin\service_register.bat

  6. Delete the files located under C:\Program Files\Couchbase \Server\var\lib\couchbase\mnesia.

  7. Start the service by running:

    C:\Program Files\Couchbase\Server\bin\service_start.bat
  8. See the node correctly identifying itself as the hostname in the GUI under the Manage Servers page (you will be taken back to the setup wizard since the configuration was cleared out, but after completing the wizard the node will be named properly).