You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2019/02/10 13:48:01 UTC

[GitHub] style95 commented on issue #4250: Allow persisted couchdb directory mount.

style95 commented on issue #4250: Allow persisted couchdb directory mount.
URL: https://github.com/apache/incubator-openwhisk/pull/4250#issuecomment-462134326
 
 
   @rabbah Thank you for asking me.
   
   I have deployed CouchDB in a distributed environment with this change.
   
   I think we need to add some logic to skip setting up the cluster in case the cluster is already formed.
   
   If I redeploy CouchDB nodes, it tries to readd the nodes to the cluster.
   But they are already added in the membership list as we persist the data directory and the cluster formation is failed.
   
   
   ```
   TASK [couchdb : add remote nodes to the cluster] *******************************************************************************************************************************************************************************************************************************
   Sunday 10 February 2019  22:41:53 +0900 (0:00:00.083)       0:00:18.239 *******
   fatal: [10.105.65.216]: FAILED! => {"cache_control": "must-revalidate", "changed": false, "connection": "close", "content": "{\"error\":\"conflict\",\"reason\":\"Document update conflict.\"}\n", "content_length": "58", "content_type": "application/json", "date": "Sun, 10 Feb 2019 13:41:54 GMT", "json": {"error": "conflict", "reason": "Document update conflict."}, "msg": "Status code was not [201]: HTTP Error 409: Conflict", "redirected": false, "server": "CouchDB/2.1.2 (Erlang OTP/17)", "status": 409, "url": "http://10.105.65.214:5984/_cluster_setup", "x_couch_request_id": "c7521df26e", "x_couchdb_body_time": "0"}
   
   Status code was not [201]: HTTP Error 409: Conflict
   fatal: [10.105.65.215]: FAILED! => {"cache_control": "must-revalidate", "changed": false, "connection": "close", "content": "{\"error\":\"conflict\",\"reason\":\"Document update conflict.\"}\n", "content_length": "58", "content_type": "application/json", "date": "Sun, 10 Feb 2019 13:41:54 GMT", "json": {"error": "conflict", "reason": "Document update conflict."}, "msg": "Status code was not [201]: HTTP Error 409: Conflict", "redirected": false, "server": "CouchDB/2.1.2 (Erlang OTP/17)", "status": 409, "url": "http://10.105.65.214:5984/_cluster_setup", "x_couch_request_id": "da0d5465ff", "x_couchdb_body_time": "0"}
   
   Status code was not [201]: HTTP Error 409: Conflict
   ```
   
   As I mentioned above, one option could be to skip the clustering setup in case cluster is already enabled like this:
   
   ```
   - name: check whether the cluster is setup or not
     uri:
       url: "{{ db.protocol }}://{{ ansible_host }}:{{ db.port }}/_cluster_setup"
       method: GET
       status_code: 200
       user: "{{ db.credentials.admin.user }}"
       password: "{{ db.credentials.admin.pass }}"
       force_basic_auth: yes
     register: cluster_state
     run_once: true
   
   - include_tasks: cluster_setup.yml
     when: cluster_state.json.state == "cluster_enabled"
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services