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

pcs cluster stop --all not working #115

Closed
eileon opened this issue Oct 17, 2016 · 13 comments
Closed

pcs cluster stop --all not working #115

eileon opened this issue Oct 17, 2016 · 13 comments

Comments

@eileon
Copy link

eileon commented Oct 17, 2016

[root@archie pcsd]# pcs cluster stop --all
192.168.1.3: Error connecting to 192.168.1.3 - (HTTP error: 400)
192.168.1.2: Error connecting to 192.168.1.2 - (HTTP error: 400)
Error: unable to stop all nodes
192.168.1.3: Error connecting to 192.168.1.3 - (HTTP error: 400)
192.168.1.2: Error connecting to 192.168.1.2 - (HTTP error: 400)

Where can i see something ?

@eileon
Copy link
Author

eileon commented Oct 17, 2016

If i try to stop only one node :

[root@archie pcs]# pcs cluster stop archie
Error: nodes 'archie' do not appear to exist in configuration

With the IP address :


[root@archie pcs]# pcs cluster stop 192.168.1.2
192.168.1.2: Error connecting to 192.168.1.2 - (HTTP error: 400)
Error: unable to stop all nodes
192.168.1.2: Error connecting to 192.168.1.2 - (HTTP error: 400)

I wanted to stop only my mode, not all (message is not fine adapted)


[root@archie pcs]# pcs cluster stop 192.168.1.3
192.168.1.3: Error connecting to 192.168.1.3 - (HTTP error: 400)
Error: unable to stop all nodes
192.168.1.3: Error connecting to 192.168.1.3 - (HTTP error: 400)

My configuration is very basic :
archie : 192.168.1.2
archicomble : 192.168.1.3

@tomjelinek
Copy link
Member

Debug output, logs?

@eileon
Copy link
Author

eileon commented Oct 19, 2016

With option --debug, output :


root@archie pcsd]# pcs cluster stop --all --debug
Running: /usr/sbin/corosync -v

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

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

--Debug Stderr End--

Running: /usr/bin/ruby -I/usr/lib/pcsd/ /usr/lib/pcsd/pcsd-cli.rb read_tokens
Running: /usr/bin/ruby -I/usr/lib/pcsd/ /usr/lib/pcsd/pcsd-cli.rb read_tokens
--Debug Input Start--
{}
--Debug Input End--
--Debug Input Start--
{}
--Debug Input End--
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
    "192.168.1.2": "979be9ff-6f6e-42f8-924e-d971bcd0cfbb",
    "192.168.1.3": "429f7514-205a-4ac9-af72-7431aa0121e0",
    "archicomble": "6e2414e7-4e06-437c-adad-b218d22472fe",
    "archie": "6251289e-83c0-4d79-8123-e7e5b4d7dc68"
  },
  "log": [
    "I, [2016-10-19T11:03:12.187751 #20427]  INFO -- : PCSD Debugging enabled\n",
    "D, [2016-10-19T11:03:12.187865 #20427] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2016-10-19T11:03:12.187934 #20427]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2016-10-19T11:03:12.187984 #20427]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2016-10-19T11:03:12.201835 #20427] DEBUG -- : [\"totem.cluster_name (str) = archiclust\\n\"]\n",
    "D, [2016-10-19T11:03:12.201995 #20427] DEBUG -- : []\n",
    "D, [2016-10-19T11:03:12.202057 #20427] DEBUG -- : Duration: 0.01382706s\n",
    "I, [2016-10-19T11:03:12.202271 #20427]  INFO -- : Return Value: 0\n"
  ]
}
--Debug Output End--

Sending HTTP Request to: https://192.168.1.2:2224/remote/cluster_stop
Data: component=pacemaker&force=1
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
    "192.168.1.2": "979be9ff-6f6e-42f8-924e-d971bcd0cfbb",
    "192.168.1.3": "429f7514-205a-4ac9-af72-7431aa0121e0",
    "archicomble": "6e2414e7-4e06-437c-adad-b218d22472fe",
    "archie": "6251289e-83c0-4d79-8123-e7e5b4d7dc68"
  },
  "log": [
    "I, [2016-10-19T11:03:12.221853 #20426]  INFO -- : PCSD Debugging enabled\n",
    "D, [2016-10-19T11:03:12.221969 #20426] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2016-10-19T11:03:12.222036 #20426]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2016-10-19T11:03:12.222084 #20426]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2016-10-19T11:03:12.240744 #20426] DEBUG -- : [\"totem.cluster_name (str) = archiclust\\n\"]\n",
    "D, [2016-10-19T11:03:12.240897 #20426] DEBUG -- : []\n",
    "D, [2016-10-19T11:03:12.241003 #20426] DEBUG -- : Duration: 0.018633899s\n",
    "I, [2016-10-19T11:03:12.241165 #20426]  INFO -- : Return Value: 0\n"
  ]
}
--Debug Output End--

Sending HTTP Request to: https://192.168.1.3:2224/remote/cluster_stop
Data: component=pacemaker&force=1
Response Code: 400
--Debug Response Start--
Error: unable to locate command: service
--Debug Response End--
192.168.1.2: Error connecting to 192.168.1.2 - (HTTP error: 400)
Response Code: 400
--Debug Response Start--
Error: unable to locate command: service
--Debug Response End--
192.168.1.3: Error connecting to 192.168.1.3 - (HTTP error: 400)
Error: unable to stop all nodes
192.168.1.2: Error connecting to 192.168.1.2 - (HTTP error: 400)
192.168.1.3: Error connecting to 192.168.1.3 - (HTTP error: 400)

In /var/log/pcsd/pcsd.log :


I, [2016-10-19T11:03:12.271062 #20388]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name
I, [2016-10-19T11:03:12.271212 #20388]  INFO -- : CIB USER: hacluster, groups: 
I, [2016-10-19T11:03:12.289290 #20388]  INFO -- : Return Value: 0
I, [2016-10-19T11:03:12.290471 #20388]  INFO -- : Stopping Daemons
I, [2016-10-19T11:03:12.290649 #20388]  INFO -- : Running: /usr/sbin/pcs cluster stop --pacemaker --force
I, [2016-10-19T11:03:12.290716 #20388]  INFO -- : CIB USER: hacluster, groups: 
I, [2016-10-19T11:03:13.093303 #20388]  INFO -- : Return Value: 1
192.168.1.2 - - [19/Oct/2016:11:03:13 +0200] "POST /remote/cluster_stop HTTP/1.1" 400 41 0.8241
192.168.1.2 - - [19/Oct/2016:11:03:13 +0200] "POST /remote/cluster_stop HTTP/1.1" 400 41 0.8243
192.168.1.2 - - [19/Oct/2016:11:03:12 CEST] "POST /remote/cluster_stop HTTP/1.1" 400 41
- -> /remote/cluster_stop

@eileon
Copy link
Author

eileon commented Oct 19, 2016

Maybe

Error: unable to locate command: service

is the real problem. I had this several times.

I am under ArchLinux with systemd and no Upstart available

@tomjelinek
Copy link
Member

Pcs should use systemctl instead of service on systemd machines. Do you have /usr/bin/systemctl or /bin/systemctl file? If not, what is the output of which systemctl?

@oalbrigt
Copy link

Or "ps -p 1 | grep -q systemd" in case systemd is available but not in use.

@eileon
Copy link
Author

eileon commented Oct 20, 2016

I have :

[root@archie log]# which systemctl
/usr/bin/systemctl
[root@archie log]# cd /bin/
[root@archie bin]# ls -al systemctl 
-rwxr-xr-x 1 root root 166344  7 oct.  19:38 systemctl
[root@archie bin]# cd /usr/bin
[root@archie bin]# ls -al systemctl 
-rwxr-xr-x 1 root root 166344  7 oct.  19:38 systemctl

[root@archie bin]# ps -p 1 | grep -q systemd
[root@archie bin]# 
[root@archie bin]# ps -aux | grep systemd
root         1  0.0  0.3 135324  6736 ?        Ss   11:44   0:02 /usr/lib/systemd/systemd --switched-root --system --deserialize 23
root       216  0.0  3.2 165140 65840 ?        Ss   11:44   0:00 /usr/lib/systemd/systemd-journald
root       243  0.0  0.1  36048  3860 ?        Ss   11:44   0:00 /usr/lib/systemd/systemd-udevd
root       357  0.0  0.2  38520  4540 ?        Ss   11:44   0:00 /usr/lib/systemd/systemd-logind
dbus       359  0.0  0.1  33268  4028 ?        Ss   11:44   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root       386  0.0  0.1  15744  3112 ?        Ss   11:44   0:00 /bin/sh /usr/lib/systemd/scripts/sshguard-journalctl -b 120:/var/db/sshguard/blacklist.db SYSLOG_FACILITY=4 SYSLOG_FACILITY=10
moulong+   794  0.0  0.3  54756  6260 ?        Ss   11:45   0:00 /usr/lib/systemd/systemd --user
moulong+   816  0.0  0.1  33244  3912 ?        Ss   11:45   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation
root      4710  0.0  0.1  10776  2196 pts/0    R+   15:16   0:00 grep systemd

Something wrong with systemd ?

@oalbrigt
Copy link

-q mutes grep (as you only need the return code and not the actual output)

@eileon
Copy link
Author

eileon commented Oct 20, 2016

[root@archie bin]# ps -p 1 | grep -q systemd
[root@archie bin]# 

@tomjelinek
Copy link
Member

OK, I see it now. Some parts of pcs use service for starting and stopping daemons. We need to fix that.

@tomjelinek
Copy link
Member

Can you try it again with the most recent version? I just pushed a fix for this 2a32ed7

@eileon
Copy link
Author

eileon commented Oct 21, 2016

Just a remark. On ArchLinux /usr/bin and /usr/sbin are the same (there is just a link between). so in order to install, in Makefile i must remove two lines :

   #mkdir -p ${DESTDIR}${PREFIX}/sbin/
   #mv ${DESTDIR}${PREFIX}/bin/pcs ${DESTDIR}${PREFIX}/sbin/pcs

then in order to make a good path i need to do in utils.py :

pcs_dir == "/usr/bin"
in place of
pcs_dir == "/usr/sbin"

This makes me get a good path for pcs command (/usr/lib/pcsd in place of /usr/bin/../pcsd)

Then it seems ok for your patch :

[root@archie pcsd]# vi /usr/lib/python3.5/site-packages/pcs/utils.py
[root@archie pcsd]# pcs cluster stop --all --debug
Running: /usr/sbin/corosync -v

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

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

--Debug Stderr End--

Running: /usr/bin/ruby -I/usr/lib/pcsd/ /usr/lib/pcsd/pcsd-cli.rb read_tokens
--Debug Input Start--
{}
--Debug Input End--
Running: /usr/bin/ruby -I/usr/lib/pcsd/ /usr/lib/pcsd/pcsd-cli.rb read_tokens
--Debug Input Start--
{}
--Debug Input End--
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
    "192.168.1.2": "979be9ff-6f6e-42f8-924e-d971bcd0cfbb",
    "192.168.1.3": "429f7514-205a-4ac9-af72-7431aa0121e0",
    "archicomble": "6e2414e7-4e06-437c-adad-b218d22472fe",
    "archie": "6251289e-83c0-4d79-8123-e7e5b4d7dc68"
  },
  "log": [
    "I, [2016-10-21T15:43:29.851928 #17718]  INFO -- : PCSD Debugging enabled\n",
    "D, [2016-10-21T15:43:29.852053 #17718] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2016-10-21T15:43:29.852208 #17718]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2016-10-21T15:43:29.852260 #17718]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2016-10-21T15:43:29.866631 #17718] DEBUG -- : [\"totem.cluster_name (str) = archiclust\\n\"]\n",
    "D, [2016-10-21T15:43:29.866787 #17718] DEBUG -- : []\n",
    "D, [2016-10-21T15:43:29.866846 #17718] DEBUG -- : Duration: 0.014343107s\n",
    "I, [2016-10-21T15:43:29.867009 #17718]  INFO -- : Return Value: 0\n"
  ]
}
--Debug Output End--

Sending HTTP Request to: https://192.168.1.3:2224/remote/cluster_stop
Data: component=pacemaker&force=1
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
    "192.168.1.2": "979be9ff-6f6e-42f8-924e-d971bcd0cfbb",
    "192.168.1.3": "429f7514-205a-4ac9-af72-7431aa0121e0",
    "archicomble": "6e2414e7-4e06-437c-adad-b218d22472fe",
    "archie": "6251289e-83c0-4d79-8123-e7e5b4d7dc68"
  },
  "log": [
    "I, [2016-10-21T15:43:29.875419 #17719]  INFO -- : PCSD Debugging enabled\n",
    "D, [2016-10-21T15:43:29.875586 #17719] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2016-10-21T15:43:29.875657 #17719]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2016-10-21T15:43:29.875706 #17719]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2016-10-21T15:43:29.894035 #17719] DEBUG -- : [\"totem.cluster_name (str) = archiclust\\n\"]\n",
    "D, [2016-10-21T15:43:29.894205 #17719] DEBUG -- : []\n",
    "D, [2016-10-21T15:43:29.894267 #17719] DEBUG -- : Duration: 0.018303449s\n",
    "I, [2016-10-21T15:43:29.894444 #17719]  INFO -- : Return Value: 0\n"
  ]
}
--Debug Output End--

Sending HTTP Request to: https://192.168.1.2:2224/remote/cluster_stop
Data: component=pacemaker&force=1
Response Code: 0
--Debug Response Start--
Stopping Cluster (pacemaker)...
--Debug Response End--

192.168.1.3: Stopping Cluster (pacemaker)...
Response Code: 0
--Debug Response Start--
Stopping Cluster (pacemaker)...
--Debug Response End--

192.168.1.2: Stopping Cluster (pacemaker)...
Running: /usr/bin/ruby -I/usr/lib/pcsd/ /usr/lib/pcsd/pcsd-cli.rb read_tokens
--Debug Input Start--
{}
--Debug Input End--
Running: /usr/bin/ruby -I/usr/lib/pcsd/ /usr/lib/pcsd/pcsd-cli.rb read_tokens
--Debug Input Start--
{}
--Debug Input End--
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
    "192.168.1.2": "979be9ff-6f6e-42f8-924e-d971bcd0cfbb",
    "192.168.1.3": "429f7514-205a-4ac9-af72-7431aa0121e0",
    "archicomble": "6e2414e7-4e06-437c-adad-b218d22472fe",
    "archie": "6251289e-83c0-4d79-8123-e7e5b4d7dc68"
  },
  "log": [
    "I, [2016-10-21T15:43:33.756251 #17750]  INFO -- : PCSD Debugging enabled\n",
    "D, [2016-10-21T15:43:33.756369 #17750] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2016-10-21T15:43:33.756509 #17750]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2016-10-21T15:43:33.756559 #17750]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2016-10-21T15:43:33.777166 #17750] DEBUG -- : [\"totem.cluster_name (str) = archiclust\\n\"]\n",
    "D, [2016-10-21T15:43:33.777326 #17750] DEBUG -- : []\n",
    "D, [2016-10-21T15:43:33.777384 #17750] DEBUG -- : Duration: 0.020577691s\n",
    "I, [2016-10-21T15:43:33.777544 #17750]  INFO -- : Return Value: 0\n"
  ]
}
--Debug Output End--

Sending HTTP Request to: https://192.168.1.2:2224/remote/cluster_stop
Data: component=corosync&force=1
Return Value: 0
--Debug Output Start--
{
  "status": "ok",
  "data": {
    "192.168.1.2": "979be9ff-6f6e-42f8-924e-d971bcd0cfbb",
    "192.168.1.3": "429f7514-205a-4ac9-af72-7431aa0121e0",
    "archicomble": "6e2414e7-4e06-437c-adad-b218d22472fe",
    "archie": "6251289e-83c0-4d79-8123-e7e5b4d7dc68"
  },
  "log": [
    "I, [2016-10-21T15:43:33.753112 #17751]  INFO -- : PCSD Debugging enabled\n",
    "D, [2016-10-21T15:43:33.753226 #17751] DEBUG -- : Did not detect RHEL 6\n",
    "I, [2016-10-21T15:43:33.753294 #17751]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2016-10-21T15:43:33.753342 #17751]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2016-10-21T15:43:33.780601 #17751] DEBUG -- : [\"totem.cluster_name (str) = archiclust\\n\"]\n",
    "D, [2016-10-21T15:43:33.780792 #17751] DEBUG -- : []\n",
    "D, [2016-10-21T15:43:33.780853 #17751] DEBUG -- : Duration: 0.027223899s\n",
    "I, [2016-10-21T15:43:33.781007 #17751]  INFO -- : Return Value: 0\n"
  ]
}
--Debug Output End--

Sending HTTP Request to: https://192.168.1.3:2224/remote/cluster_stop
Data: component=corosync&force=1
Response Code: 0
--Debug Response Start--
Stopping Cluster (corosync)...
--Debug Response End--

192.168.1.3: Stopping Cluster (corosync)...
Response Code: 0
--Debug Response Start--
Stopping Cluster (corosync)...
--Debug Response End--

192.168.1.2: Stopping Cluster (corosync)...






@abdullah-manzoor
Copy link

thanks for this help full article
specially for the command switch : --debug
💯

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

4 participants