Closed BerKer999 closed 2 years ago
I'll try to figure it out. Maybe Cylindrical (Mark Sanford) will help. This is his code.
Perhaps you are not using HA and the received json does not have the "master_node" key. I'll take a look later.
HA setting was set to default (conditional) in Proxmox 7.2-4 not subscribe with 3 nodes
Please attach the following screenshots:
and
Now HA manager has been configured, Thanks pvesh is returning the msg "error resource '/cluster/ha/status/manager_status' does not define child links" root@pve:~/Proxmox-load-balancer# ./plb.py INFO | START Load-balancer! DEBUG | Authorization attempt... DEBUG | Successful authentication. Response code: 200 DEBUG | init when creating a Cluster object DEBUG | Starting Cluster.cluster_name DEBUG | Information about the cluster name has been received. Response code: 200 DEBUG | Launching Cluster.cluster_items DEBUG | Attempt to get information about the cluster... DEBUG | Information about the cluster has been received. Response code: 200 DEBUG | Launching Cluster.cluster_hosts DEBUG | Attempt to get information about the cluster HA manager... DEBUG | Information about the cluster HA Manager has been received. Response code: 200 DEBUG | Launching Cluster.cluster_vms DEBUG | Launching Cluster.cluster_membership DEBUG | Launching Cluster.cluster_cpu INFO | This server (pve) is not the current cluster master, pve3 is. Waiting 300 seconds.
The mode of operation only on the master node of the cluster was added only so that it was possible to roll the balancer on all nodes of the cluster. And so that they all do not start working at once - you need to include in the config a check on whether the node is the master of the HA cluster. If you have a script running on a single node or on a virtual machine, you need to install "only_on_master: OFF" in the config. This should solve your problem. And running the script in one instance only on the master node of the HA cluster with "only_on_master: ON" is pointless. Since this is not permanent and the master may change over time.
Can I close issue?
yes, thanks thanks for your help
is rr.json missing?
Regards,
root@pve:~/Proxmox-load-balancer# ./plb.py INFO | START Load-balancer! DEBUG | Authorization attempt... DEBUG | Successful authentication. Response code: 200 DEBUG | init when creating a Cluster object DEBUG | Starting Cluster.cluster_name DEBUG | Information about the cluster name has been received. Response code: 200 DEBUG | Launching Cluster.cluster_items DEBUG | Attempt to get information about the cluster... DEBUG | Information about the cluster has been received. Response code: 200 DEBUG | Launching Cluster.cluster_hosts DEBUG | Attempt to get information about the cluster HA manager... DEBUG | Information about the cluster HA Manager has been received. Response code: 200 Traceback (most recent call last): File "/root/Proxmox-load-balancer/./plb.py", line 468, in
main()
File "/root/Proxmox-load-balancer/./plb.py", line 439, in main
cluster = Cluster(server_url)
File "/root/Proxmox-load-balancer/./plb.py", line 84, in init
self.cl_nodes: dict = self.cluster_hosts() # All cluster nodes
File "/root/Proxmox-load-balancer/./plb.py", line 156, in cluster_hosts
self.master_node = rr.json()['data']['manager_status']['master_node']
KeyError: 'master_node'
root@pve:~/Proxmox-load-balancer# updatedb
root@pve:~/Proxmox-load-balancer# locate rr.json
root@pve:~/Proxmox-load-balancer#