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

error checking node availability: Unable to authenticate in debian stretch #153

Closed
asifmuradkhan opened this issue Nov 24, 2017 · 3 comments

Comments

@asifmuradkhan
Copy link

asifmuradkhan commented Nov 24, 2017

I want to create a 3 node cluster with pcs in debian stretch, after authorized all nodes. when I try add nodes in cluster I'm getting this error.

asif@db01:~$ sudo pcs --version
0.9.155

step 1;

sudo pcs cluster auth 192.168.101.11 192.168.101.12 192.168.101.13 -u hacluster --debug
Password: 
Running: /usr/bin/ruby -I/usr/share/pcsd/ /usr/share/pcsd/pcsd-cli.rb auth
--Debug Input Start--
{"username": "hacluster", "local": false, "nodes": ["192.168.101.12", "192.168.101.13", "192.168.101.11"], "password": "1234", "force": false}
--Debug Input End--
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
    "auth_responses": {
      "192.168.101.11": {
        "status": "ok",
        "token": "f9d6d677-ff13-4d36-98bb-b87fc367580d"
      },
      "192.168.101.13": {
        "status": "ok",
        "token": "20d052f9-ced2-493b-918d-eb8b0efea357"
      },
      "192.168.101.12": {
        "status": "ok",
        "token": "ba7322ed-230b-4e85-954e-ddc355cbf382"
      }
    },
    "sync_successful": true,
    "sync_nodes_err": [

    ],
    "sync_responses": {
    }
  },
  "log": [
    "I, [2017-11-24T13:50:02.619145 #21081]  INFO -- : PCSD Debugging enabled\n",
    "D, [2017-11-24T13:50:02.619184 #21081] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2017-11-24T13:50:02.619208 #21081]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2017-11-24T13:50:02.619224 #21081]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2017-11-24T13:50:02.623700 #21081] DEBUG -- : [\"totem.cluster_name (str) = debian\\n\"]\n",
    "D, [2017-11-24T13:50:02.623758 #21081] DEBUG -- : []\n",
    "D, [2017-11-24T13:50:02.623780 #21081] DEBUG -- : Duration: 0.004468055s\n",
    "I, [2017-11-24T13:50:02.623846 #21081]  INFO -- : Return Value: 0\n",
    "I, [2017-11-24T13:50:02.624104 #21081]  INFO -- : SRWT Node: 192.168.101.13 Request: check_auth\n",
    "E, [2017-11-24T13:50:02.624127 #21081] ERROR -- : Unable to connect to node 192.168.101.13, no token available\n",
    "I, [2017-11-24T13:50:02.624182 #21081]  INFO -- : SRWT Node: 192.168.101.12 Request: check_auth\n",
    "E, [2017-11-24T13:50:02.624197 #21081] ERROR -- : Unable to connect to node 192.168.101.12, no token available\n",
    "I, [2017-11-24T13:50:02.624232 #21081]  INFO -- : SRWT Node: 192.168.101.11 Request: check_auth\n",
    "E, [2017-11-24T13:50:02.624245 #21081] ERROR -- : Unable to connect to node 192.168.101.11, no token available\n",
    "I, [2017-11-24T13:50:02.712490 #21081]  INFO -- : Running: /usr/sbin/pcs status nodes corosync\n",
    "I, [2017-11-24T13:50:02.712582 #21081]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2017-11-24T13:50:02.942045 #21081] DEBUG -- : [\"Corosync Nodes:\\n\", \" Online:\\n\", \" Offline:\\n\"]\n",
    "D, [2017-11-24T13:50:02.942120 #21081] DEBUG -- : []\n",
    "D, [2017-11-24T13:50:02.942141 #21081] DEBUG -- : Duration: 0.229461048s\n",
    "I, [2017-11-24T13:50:02.942204 #21081]  INFO -- : Return Value: 0\n",
    "I, [2017-11-24T13:50:02.942493 #21081]  INFO -- : Sending config 'tokens' version 1 efb121ae8ede7b957173795a7ffeaf598fcd5469 to nodes: \n"
  ]
}
--Debug Output End--

192.168.101.12: Authorized
192.168.101.13: Authorized
192.168.101.11: Authorized

step 2;

sudo pcs cluster setup --name pg_cluster 192.168.101.11 192.168.101.12 192.168.101.13 --start --enable --debug
Running: /usr/sbin/corosync -v

Finished running: /usr/sbin/corosync -v
Return value: 0
--Debug Stdout Start--
Corosync Cluster Engine, version '2.4.2'
Copyright (c) 2006-2009 Red Hat, Inc.

--Debug Stdout End--
--Debug Stderr Start--

--Debug Stderr End--

Running: /usr/bin/ruby -I/usr/share/pcsd/ /usr/share/pcsd/pcsd-cli.rb read_tokens
--Debug Input Start--
{}
--Debug Input End--
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
  },
  "log": [
    "I, [2017-11-24T13:50:13.652610 #21174]  INFO -- : PCSD Debugging enabled\n",
    "D, [2017-11-24T13:50:13.652650 #21174] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2017-11-24T13:50:13.652677 #21174]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2017-11-24T13:50:13.652691 #21174]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2017-11-24T13:50:13.657279 #21174] DEBUG -- : [\"totem.cluster_name (str) = debian\\n\"]\n",
    "D, [2017-11-24T13:50:13.657342 #21174] DEBUG -- : []\n",
    "D, [2017-11-24T13:50:13.657390 #21174] DEBUG -- : Duration: 0.004577442s\n",
    "I, [2017-11-24T13:50:13.657441 #21174]  INFO -- : Return Value: 0\n"
  ]
}
--Debug Output End--

Sending HTTP Request to: https://192.168.101.11:2224/remote/node_available
Data: None
Response Code: 401
--Debug Response Start--
{"notauthorized":"true"}--Debug Response End--
Error: 192.168.101.11: error checking node availability: Unable to authenticate to 192.168.101.11 - (HTTP error: 401), try running 'pcs cluster auth'
Running: /usr/bin/ruby -I/usr/share/pcsd/ /usr/share/pcsd/pcsd-cli.rb read_tokens
--Debug Input Start--
{}
--Debug Input End--
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
  },
  "log": [
    "I, [2017-11-24T13:50:13.928772 #21184]  INFO -- : PCSD Debugging enabled\n",
    "D, [2017-11-24T13:50:13.928812 #21184] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2017-11-24T13:50:13.928836 #21184]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2017-11-24T13:50:13.928851 #21184]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2017-11-24T13:50:13.933421 #21184] DEBUG -- : [\"totem.cluster_name (str) = debian\\n\"]\n",
    "D, [2017-11-24T13:50:13.933487 #21184] DEBUG -- : []\n",
    "D, [2017-11-24T13:50:13.933508 #21184] DEBUG -- : Duration: 0.004558361s\n",
    "I, [2017-11-24T13:50:13.933561 #21184]  INFO -- : Return Value: 0\n"
  ]
}
--Debug Output End--

Sending HTTP Request to: https://192.168.101.12:2224/remote/node_available
Data: None
Response Code: 401
--Debug Response Start--
{"notauthorized":"true"}--Debug Response End--
Error: 192.168.101.12: error checking node availability: Unable to authenticate to 192.168.101.12 - (HTTP error: 401), try running 'pcs cluster auth'
Running: /usr/bin/ruby -I/usr/share/pcsd/ /usr/share/pcsd/pcsd-cli.rb read_tokens
--Debug Input Start--
{}
--Debug Input End--
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
  },
  "log": [
    "I, [2017-11-24T13:50:14.203895 #21193]  INFO -- : PCSD Debugging enabled\n",
    "D, [2017-11-24T13:50:14.203935 #21193] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2017-11-24T13:50:14.203958 #21193]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2017-11-24T13:50:14.203973 #21193]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2017-11-24T13:50:14.208645 #21193] DEBUG -- : [\"totem.cluster_name (str) = debian\\n\"]\n",
    "D, [2017-11-24T13:50:14.208721 #21193] DEBUG -- : []\n",
    "D, [2017-11-24T13:50:14.208743 #21193] DEBUG -- : Duration: 0.004661972s\n",
    "I, [2017-11-24T13:50:14.208796 #21193]  INFO -- : Return Value: 0\n"
  ]
}
--Debug Output End--

Sending HTTP Request to: https://192.168.101.13:2224/remote/node_available
Data: None
Response Code: 401
--Debug Response Start--
{"notauthorized":"true"}--Debug Response End--
Error: 192.168.101.13: error checking node availability: Unable to authenticate to 192.168.101.13 - (HTTP error: 401), try running 'pcs cluster auth'
Error: nodes availability check failed, use --force to override. WARNING: This will destroy existing cluster on the nodes.
@tomjelinek
Copy link
Member

It looks like there is already /etc/corosync/corosync.conf file on your nodes with an empty node list. Try to stop corosync and delete the conf file on all nodes. Then run pcs cluster auth and pcs cluster setup again.

@tomjelinek
Copy link
Member

You may take a look at Debian bug and Ubuntu bug if you are interested in details.

tomjelinek added a commit that referenced this issue Dec 13, 2017
This fixes problems on Debian which distributes corosync with a default
corosync.conf containing no nodes. The configs synchronization mechanism
then sends configs to (and load from) an empty set of nodes effectively
not saving the configs anywhere. This is especially bad when running
'pcs cluster auth' before creating a cluster since the tokens are
dropped which prevents a cluster to be created and the default
corosync.conf replaced by our own with a valid nodelist.

#153
@tomjelinek
Copy link
Member

This is fixed by 2ea12da

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

No branches or pull requests

2 participants