16.4. Python でのクラスターフェイルオーバー
仮想 IP を使用するクラスターで MRG 3 Python クライアントを使用するには、仮想 IP アドレスをブローカーアドレスとして指定します。フェイルオーバーは、クラスターマネージャーによって透過的に処理されます。
仮想 IP アドレスを使用しないクラスターがある場合には、
Connection.establish またはの呼び出し reconnect_urls 時のように host:port アドレスの reconnect=True 一覧を指定し Connection.openます。
connection = qpid.messaging.Connection.establish("node1", reconnect=True, reconnect_urls=["node1", "node2", "node3"])
connection = qpid.messaging.Connection.establish("node1", reconnect=True, reconnect_urls=["node1", "node2", "node3"])
ハートビートはデフォルトで無効になっています。
heartbeat オプションを使用して接続のハートビート間隔(秒単位)を指定して有効にできます。例:
connection = qpid.messaging.Connection.establish("node1", reconnect=True, reconnect_urls=["node1", "node2", "node3"], heartbeat=10)
connection = qpid.messaging.Connection.establish("node1", reconnect=True, reconnect_urls=["node1", "node2", "node3"], heartbeat=10)