[MB-7268] Using couchbase-cli to setup couchbase(cluster-init) on non default port returns error Created: 27/Nov/12  Updated: 11/Mar/14

Status: Open
Project: Couchbase Server
Component/s: tools
Affects Version/s: 2.0
Fix Version/s: bug-backlog
Security Level: Public

Type: Bug Priority: Major
Reporter: Deepkaran Salooja Assignee: Steve Yen
Resolution: Unresolved Votes: 0
Labels: 2.0-release-notes
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment: build#1965

Attachments: Zip Archive collect_info.zip    
Triage: Untriaged

 Description   

Using couchbase-cli to setup couchbase on non default port returns error. Though the cluster gets initialized, the cluster-init-ramsize is not used.

Steps to reproduce:

1. Install build 1965 on linux.

2. Use couchbase-cli to init cluster - Returns error. Seems its still trying to connect to 8091 after init.
root@ubuntu1104-64:/opt/couchbase/bin# ./couchbase-cli cluster-init -c 10.3.3.96:8091 --cluster-init-username=Administrator --cluster-init-password=password --cluster-init-port=8080 --cluster-init-ramsize=1024

SUCCESS: init 10.3.3.96
ERROR: command: cluster-init: 10.3.3.96:8091, [Errno 111] Connection refused

3. Verify the ram quota. Incorrect Ram quota has been set.

root@ubuntu1104-64:/opt/couchbase/bin# ./couchbase-cli server-info -c 10.3.3.96:8080 -u Administrator -p password

    "ram": {
      "quotaTotal": 3865051136,
      "quotaUsed": 0,
      "total": 6442450944,
      "used": 1599672320,
      "usedByData": 0
    }

Expected behavior when default port is used:

1. Install build 1965 on linux.

2. Use couchbase-cli to init cluster.

root@ubuntu1104-64:/opt/couchbase/bin# ./couchbase-cli cluster-init -c 10.3.3.104:8091 --cluster-init-username=Administrator --cluster-init-password=password --cluster-init-port=8091 --cluster-init-ramsize=1024

SUCCESS: init 10.3.3.104
SUCCESS: init 10.3.3.104

3. Verify the ram quota.

root@ubuntu1104-64:/opt/couchbase/bin# ./couchbase-cli server-info -c 10.3.3.104:8091 -u Administrator -p password

    "ram": {
      "quotaTotal": 1073741824,
      "quotaUsed": 0,
      "total": 6442450944,
      "used": 1491410944,
      "usedByData": 0
    }


 Comments   
Comment by Steve Yen [ 27/Nov/12 ]
need to diagnose
Comment by Steve Yen [ 27/Nov/12 ]
One workaround is that after user does their first cluster-init to setup the right port, they can do cluster-init again to setup the right ramsize. Here's example after a clean install...

root@ubuntu1104-64:~# dpkg -i couchbase-server-community_x86_64_2.0.0-1965-rel.deb Selecting previously deselected package couchbase-server.
(Reading database ... 129497 files and directories currently installed.)
Unpacking couchbase-server (from couchbase-server-community_x86_64_2.0.0-1965-rel.deb) ...
libssl0.9.8 is installed. Continue installing
Setting up couchbase-server (2.0.0) ...
 * Started couchbase-server

You have successfully installed Couchbase Server.
Please browse to http://ubuntu1104-64:8091/ to configure your server.
Please refer to http://couchbase.com for additional resources.

Please note that you have to update your firewall configuration to
allow connections to the following ports: 11211, 11210, 11209, 4369,
8091 and from 21100 to 21299.

By using this software you agree to the End User License Agreement.
See /opt/couchbase/LICENSE.txt.

Processing triggers for ureadahead ...


root@ubuntu1104-64:~# /opt/couchbase/bin/couchbase-cli cluster-init -c 127.0.0.1:8091 --cluster-init-username=Administrator --cluster-init-password=password --cluster-init-port=8080
SUCCESS: init 127.0.0.1


root@ubuntu1104-64:~# /opt/couchbase/bin/couchbase-cli cluster-init -c 127.0.0.1:8080 -u Administrator -p password --cluster-init-ramsize=1024
SUCCESS: init 127.0.0.1
SUCCESS: init 127.0.0.1


root@ubuntu1104-64:~# /opt/couchbase/bin/couchbase-cli server-info -c 127.0.0.1:8080 -u Administrator -p password
{
  "availableStorage": {
    "hdd": [
      {
        "path": "/",
        "sizeKBytes": 13167336,
        "usagePercent": 78
      },
      {
        "path": "/dev",
        "sizeKBytes": 2021356,
        "usagePercent": 1
      },
      {
        "path": "/dev/shm",
        "sizeKBytes": 2029332,
        "usagePercent": 0
      },
      {
        "path": "/var/run",
        "sizeKBytes": 2029332,
        "usagePercent": 1
      },
      {
        "path": "/var/lock",
        "sizeKBytes": 2029332,
        "usagePercent": 0
      },
      {
        "path": "/boot",
        "sizeKBytes": 233191,
        "usagePercent": 41
      }
    ]
  },
  "clusterCompatibility": 131072,
  "clusterMembership": "active",
  "couchApiBase": "http://127.0.0.1:8092/",
  "hostname": "127.0.0.1:8080",
  "interestingStats": {},
  "mcdMemoryAllocated": 3170,
  "mcdMemoryReserved": 3170,
  "memoryFree": 1002487808,
  "memoryQuota": 1024,
  "memoryTotal": 4156071936,
  "os": "x86_64-unknown-linux-gnu",
  "otpCookie": "drnpibhajfnqhdbb",
  "otpNode": "ns_1@127.0.0.1",
  "ports": {
    "direct": 11210,
    "proxy": 11211
  },
  "status": "healthy",
  "storage": {
    "hdd": [
      {
        "index_path": "/opt/couchbase/var/lib/couchbase/data/",
        "path": "/opt/couchbase/var/lib/couchbase/data/",
        "quotaMb": "none",
        "state": "ok"
      }
    ],
    "ssd": []
  },
  "storageTotals": {
    "hdd": {
      "free": 2966337455,
      "quotaTotal": 13483352064,
      "total": 13483352064,
      "used": 10517014609,
      "usedByData": 0
    },
    "ram": {
      "quotaTotal": 1073741824,
      "quotaUsed": 0,
      "total": 4156071936,
      "used": 3153584128,
      "usedByData": 0
    }
  },
  "systemStats": {
    "cpu_utilization_rate": 0.2544529262086514,
    "swap_total": 1073737728,
    "swap_used": 4435968
  },
  "thisNode": true,
  "uptime": "67",
  "version": "2.0.0-1965-rel-community"
}
Comment by Steve Yen [ 27/Nov/12 ]
after discussing with Farshid, and with this as an edge case, moving this to fix after 2.0.0
Comment by kzeller [ 05/Dec/12 ]
Added to RN:
       If you use <command>couchbase-cli</command> to setup a Couchbase node on a non-default port, you may
       receive an error. Although the cluster gets initialized, the initial RAM quota
       is not used and the server returns an error.
Generated at Thu Jul 10 13:55:06 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.