mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-30 22:50:10 +03:00
parent
570568fd57
commit
171d254318
@ -827,6 +827,18 @@ class ClusterSet
|
||||
#---------------------------------------------------------------------------
|
||||
def monitor(conf)
|
||||
@mutex.synchronize do
|
||||
# Get current server raft status, to skip monitor being FOLLOWER
|
||||
xml_e = OpenNebula::XMLElement.build_xml(
|
||||
@client.call('zone.raftstatus'),
|
||||
'RAFT'
|
||||
)
|
||||
|
||||
xml = OpenNebula::XMLElement.new(xml_e)
|
||||
|
||||
# 0 -> SOLO
|
||||
# 3 -> LEADER
|
||||
next unless %w[0 3].include?(xml['//STATE'])
|
||||
|
||||
@clusters.each do |id, c|
|
||||
if c[:cluster].nil?
|
||||
c[:cluster] = Cluster.new(id, @client) rescue nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user