我在CentOS 7上的corosync堆栈上运行了两个起搏器集群,所有软件包都与发行版/更新软件包保持最新。
两个集群都显示没有命令pcs status集群名称:像这样:
集群名称: 最后更新:2014年11月3日星期一09:55:58 最后更改:2014年10月31日星期五11:09:22通过烧杯上的cibadmin 堆栈:corosync 当前DC:踏板车(2) - 与法定人数的分区 版本:1.1.10-32.el7_0.1-368c726 5节点configuration 21资源configuration
/etc/corosync/corosync.conf的totem部分中有一个cluster_name:条目,但我在起搏器CIB中找不到与集群名称相关的任何内容。
群集是使用pcs cluster setup --name clustername node1 node2 node3 node4 node5创build的 – 名称群集名称pcs cluster setup --name clustername node1 node2 node3 node4 node5 (群集名称是群集的预定名称)。
/etc/corosync/corosync.conf是世界上可读的,以及它上面的目录。
在pcs-0.9.115-32.el7的源代码中,实现了getClusterName函数:
def getClusterName(): if is_rhel6(): try: dom = parse(settings.cluster_conf_file) except (IOError,xml.parsers.expat.ExpatError): return "" return dom.documentElement.getAttribute("name") else: try: f = open(settings.corosync_conf_file,'r') except IOError as e: return "" p = re.compile('cluster_name: *(.*)') for line in f: m = p.match(line) if m: return m.group(1) return ""
此函数检查rhel6是否从/etc/cluster/cluster.conf (属性名称)中提取集群名称,或者在其他情况下从/etc/corosync/corosync.conf提取集群名称。
在corosync.conf文件中,正则expression式期望cluster_name和name( 'cluster_name: *(.*)' )之间至less有一个空格,这可能是问题所在。
def is_rhel6(): try: issue = open('/etc/system-release').read() except IOError as e: return False if re.search(r'(Red Hat Enterprise Linux Server|CentOS|Scientific Linux) release 6\.', issue): return True else: return False
检查是否存在文件/etc/corosync/corosync.conf具有适当的权限。 我认为这个错误可能与你有关: https : //bugzilla.redhat.com/show_bug.cgi?id=1094812和https://bugzilla.redhat.com/show_bug.cgi?id=1029129
我希望这个帮助。