Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: finish_cluster failure due to missing uuid #3036

Merged
merged 1 commit into from
Jul 26, 2020
Merged

fix: finish_cluster failure due to missing uuid #3036

merged 1 commit into from
Jul 26, 2020

Conversation

YC
Copy link
Contributor

@YC YC commented Jul 25, 2020

Resolves #2858

Overview

Fixes cluster setup failure when uuid is not set.
Added code to call couch_server:get_uuid() to ensure that uuid is set.

Testing recommendations

Sample docker-compose file

version: '3'
services:
  couch1:
    image: couchdev
#    image: couchdb:3
    environment:
      - COUCHDB_USER=user
      - COUCHDB_PASSWORD=pass
      - COUCHDB_SECRET=secret
      - NODENAME=10.0.0.10
    networks:
      couch:
        ipv4_address: 10.0.0.10
    command: "-setcookie cookie"
    volumes:
      - ./data1:/opt/couchdb/data

  couch2:
    image: couchdev
#    image: couchdb:3
    environment:
      - COUCHDB_USER=user
      - COUCHDB_PASSWORD=pass
      - COUCHDB_SECRET=secret
      - NODENAME=10.0.0.11
    networks:
      couch:
        ipv4_address: 10.0.0.11
    command: "-setcookie cookie"
    volumes:
      - ./data2:/opt/couchdb/data

networks:
    couch:
      driver: bridge
      ipam:
        config:
          - subnet: 10.0.0.0/16

Sample script

# curl http:https://10.0.0.10:5984
# curl http:https://10.0.0.11:5984
curl http:https://user:[email protected]:5984/_cluster_setup

curl --request POST \
  --url http:https://user:[email protected]:5984/_cluster_setup \
  --header 'content-type: application/json' \
  --data '{
	"action": "enable_cluster",
	"bind_address": "0.0.0.0",
	"username": "user",
	"password": "pass",
	"port": 5984,
	"node_count": 2,
	"remote_node": "10.0.0.11",
	"remote_current_user": "user",
	"remote_current_password": "pass"
}'
curl --request POST \
  --url http:https://user:[email protected]:5984/_cluster_setup \
  --header 'content-type: application/json' \
  --data '{
    "action": "add_node",
    "host": "10.0.0.11",
    "port": 5984,
    "username": "user",
    "password": "pass",
    "singlenode": false
}'
# curl http:https://couchdb1:5984/
curl --request POST \
  --url http:https://user:[email protected]:5984/_cluster_setup \
  --header 'content-type: application/json' \
  --data '{ "action": "finish_cluster" }'
curl http:https://user:[email protected]:5984/_cluster_setup

Related Issues or Pull Requests

#2797 #2858

Checklist

@janl janl merged commit a817e60 into apache:master Jul 26, 2020
@janl
Copy link
Member

janl commented Jul 26, 2020

perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cluster setup fails: unable to sync admin passwords
2 participants