使用命令pcs创建集群互信,显示unable to communicate

版权声明:欢迎转载,但是请标明文章作者和出处。 https://blog.csdn.net/handsomehuo/article/details/89887730

问题描述

创建集群时,使用命令pcs创建集群互信,显示无法连接

部署环境

centos7.1环境,hosts文件写好,firewalld已stop,3个节点可以ping通,pcsd服务也正常启动,但是执行命令报错

[root@node1 ~]# pcs cluster auth node1 node2 node3
Username: hacluster
Password: 
Error: Unable to communicate with node1
Error: Unable to communicate with node3
Error: Unable to communicate with node2

问题排查

[root@node1 ~]# pcs cluster auth node1 node2  node3 -u hacluster -p ***** --debug
Running: /usr/bin/ruby -I/usr/lib/pcsd/ /usr/lib/pcsd/pcsd-cli.rb auth
Environment:
  GEM_HOME=/usr/lib/pcsd/vendor/bundle/ruby
  HISTCONTROL=ignoredups
  HISTSIZE=1000
  HOME=/root
  HOSTNAME=localhost.localdomain
  LANG=zh_CN.UTF-8
  LC_ALL=C
  LESSOPEN=||/usr/bin/lesspipe.sh %s
  LOGNAME=root
  LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
  MAIL=/var/spool/mail/root
  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
  PCSD_DEBUG=true
  PCSD_NETWORK_TIMEOUT=60
  PWD=/root
  SELINUX_LEVEL_REQUESTED=
  SELINUX_ROLE_REQUESTED=
  SELINUX_USE_CURRENT_RANGE=
  SHELL=/bin/bash
  SHLVL=1
  SSH_CLIENT=192.168.122.1 46760 22
  SSH_CONNECTION=192.168.122.1 46760 192.168.122.60 22
  SSH_TTY=/dev/pts/0
  TERM=xterm-256color
  USER=root
  XDG_RUNTIME_DIR=/run/user/0
  XDG_SESSION_ID=2
  _=/usr/sbin/pcs
--Debug Input Start--
{"username": "hacluster", "local": false, "nodes": {"node1": null, "node3": null, "node2": null}, "password": "redhat", "force": false}
--Debug Input End--

Finished running: /usr/bin/ruby -I/usr/lib/pcsd/ /usr/lib/pcsd/pcsd-cli.rb auth
Return value: 0
--Debug Stdout Start--
{
  "status": "ok",
  "data": {
    "auth_responses": {
      "node1": {
        "status": "noresponse"
      },
      "node3": {
        "status": "noresponse"
      },
      "node2": {
        "status": "noresponse"
      }
    },
    "sync_successful": true,
    "sync_nodes_err": [

    ],
    "sync_responses": {
    }
  },
  "log": [
    "I, [2019-05-06T02:06:07.900397 #5867]  INFO -- : PCSD Debugging enabled\n",
    "D, [2019-05-06T02:06:07.901171 #5867] DEBUG -- : Did not detect RHEL 6\n",
    "D, [2019-05-06T02:06:07.901232 #5867] DEBUG -- : Detected systemd is in use\n",
    "I, [2019-05-06T02:06:08.008169 #5867]  INFO -- : Running: /usr/sbin/corosync-cmapctl totem.cluster_name\n",
    "I, [2019-05-06T02:06:08.008282 #5867]  INFO -- : CIB USER: hacluster, groups: \n",
    "D, [2019-05-06T02:06:08.012145 #5867] DEBUG -- : []\n",
    "D, [2019-05-06T02:06:08.012469 #5867] DEBUG -- : [\"Failed to initialize the cmap API. Error CS_ERR_LIBRARY\\n\"]\n",
    "D, [2019-05-06T02:06:08.012533 #5867] DEBUG -- : Duration: 0.003755161s\n",
    "I, [2019-05-06T02:06:08.012609 #5867]  INFO -- : Return Value: 1\n",
    "W, [2019-05-06T02:06:08.012675 #5867]  WARN -- : Cannot read config 'corosync.conf' from '/etc/corosync/corosync.conf': No such file\n",
    "W, [2019-05-06T02:06:08.012820 #5867]  WARN -- : Cannot read config 'corosync.conf' from '/etc/corosync/corosync.conf': No such file or directory - /etc/corosync/corosync.conf\n",
    "I, [2019-05-06T02:06:08.014411 #5867]  INFO -- : SRWT Node: node2 Request: check_auth\n",
    "E, [2019-05-06T02:06:08.014530 #5867] ERROR -- : Unable to connect to node node2, no token available\n",
    "I, [2019-05-06T02:06:08.014643 #5867]  INFO -- : SRWT Node: node3 Request: check_auth\n",
    "E, [2019-05-06T02:06:08.014677 #5867] ERROR -- : Unable to connect to node node3, no token available\n",
    "I, [2019-05-06T02:06:08.014724 #5867]  INFO -- : SRWT Node: node1 Request: check_auth\n",
    "E, [2019-05-06T02:06:08.014871 #5867] ERROR -- : Unable to connect to node node1, no token available\n",
    "I, [2019-05-06T02:06:08.302068 #5867]  INFO -- : No response from: node1 request: auth, error: ssl_connect_error\n",
    "I, [2019-05-06T02:06:08.302316 #5867]  INFO -- : No response from: node3 request: auth, error: ssl_connect_error\n",
    "I, [2019-05-06T02:06:08.306590 #5867]  INFO -- : No response from: node2 request: auth, error: ssl_connect_error\n"
  ]
}

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

--Debug Stderr End--

Error: Unable to communicate with node1
Error: Unable to communicate with node3
Error: Unable to communicate with node2
[root@node1 ~]# cd -/var/log/pcsd
[root@node1 pcsd]# cat pcsd.log | grep -i error
[2019-05-06 01:50:45] ERROR OpenSSL::SSL::SSLError: SSL_accept returned=1 errno=0 state=SSLv2/v3 read client hello A: unknown protocol
[2019-05-06 01:51:34] ERROR OpenSSL::SSL::SSLError: SSL_accept returned=1 errno=0 state=SSLv2/v3 read client hello A: unknown protocol

问题分析

从1段输出看到cmap API没有启动,这个应该是正常的,因为cluster集群没有起来。

结合1段和2段看,应该是与ssl有关。

解决方案

升级3个与ssl有关的组件:nss、curl、libcurl,3个节点都要升级

[root@node1]# yum update -y nss curl libcurl

参考链接

  1. https://serverfault.com/questions/908323/unable-to-communicate-with-node-pacemaker-during-authorization
  2. https://blog.csdn.net/u012134780/article/details/83183200

猜你喜欢

转载自blog.csdn.net/handsomehuo/article/details/89887730
今日推荐