1

Most of the production env might need a automation script for Clusters. Reason is whenever there is a need of enhance the sites need to add new cluster to existing domain. When there is a decommissioned a physical site that needs removal of cluster from the domain. There is also possibility of "Growth" of Cluster (adding managed servers to a cluster). Finally there is also need of decommission of machines which requires removal of servers from the cluster. Menu 1. Add a Cluster 2. Del a Cluster 3. Add a server to Cluster 4. Del a server from Cluster

Please share your thoughts and suggestions...

Thanks in advance.

4

1 に答える 1

2

私は実際にそれを正確に行っており、うまく機能しています。

イニシャルを追加する必要があります

edit()
startEdit()

そして保存する

save()
activate(block='true')

例外処理と同様ですが、関数は非常に単純です。

サーバーをクラスターに追加します。

managedServer = create(ServerName,'Server')
managedServer.setListenPort(ListenPort)
managedServer.setCluster(Clustername)
managedServer.setMachine(Machinename)

クラスターからサーバーを削除します (およびサーバー、オプション):

serverMBean = getMBean("Servers/"+ServerName)
serverMBean.setCluster(None)
serverMBean.setMachine(None)
delete(ServerName,'Server')

クラスターを追加します (サーバーの作成と同じ方法を使用することもできます -> create(name, 'Cluster'):

cd('/')
cmo.createCluster('Cluster-0')
cd('/Clusters/Cluster-0')
cmo.setClusterMessagingMode('unicast')
...

クラスターの削除は、サーバーの削除と同じように機能しますが、最初にサーバーの電源を切る必要があります。

一般に、管理コンソールを使用して目的のアクションを実行できます。上部の記録ボタンを使用すると、管理コンソールで行うこととまったく同じことを行う wlst スクリプトを生成できます。

于 2012-01-11T14:03:20.620 に答える