有人尝试过使用WLST进行集群自动化吗? [英] Anyone tried Cluster automation with WLST?

查看:131
本文介绍了有人尝试过使用WLST进行集群自动化吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大多数生产环境可能需要一个用于Clusters的自动化脚本.原因是每当有需要增强的站点需要将新群集添加到现有域时.退役的物理站点需要从域中删除群集.群集也可能增长"(将受管服务器添加到群集中).最后,还需要停用机器,这需要从群集中删除服务器. 菜单 1.添加集群 2.删除集群 3.将服务器添加到群集 4.从群集中删除服务器

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...

谢谢.

推荐答案

我实际上就是这么做的,并且效果很好.

I'm actually doing exactly that and it works fine.

您必须添加首字母

edit()
startEdit()

并保存

save()
activate(block='true')

以及异常处理,但是功能非常简单:

as well as exception handling but the functions are pretty simple:

将服务器添加到集群:

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

从集群中删除服务器(和服务器,可选):

Delete server from cluster (and the server, optional):

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

添加集群(您也可以使用与创建服务器相同的方法-> create(name,'Cluster'):

Add a cluster (you can also use the same method as creating a server -> create(name, 'Cluster'):

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

删除群集的方法与删除服务器的方法相同,但是您应先关闭它们的电源.

Delete a cluster works the same way as deleting a server, you should power them down first though.

通常,您可以使用管理控制台执行所需的操作,顶部的记录"按钮允许您生成一个wlst脚本,该脚本完全可以在管理控制台中完成操作.

In general you can use the admin console to perform the desired actions and the record button at the top allows you to generate a wlst script which does exactly what you do in the admin console.

这篇关于有人尝试过使用WLST进行集群自动化吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆