Simple Code for Create Cluster and add the Cluster Member
Using Jython To Create Cluster
- pref = ["preferLocal", "true"] ##### "We can customize to false" #####
- attrs = [ ]
- attrs.append(name)
- attrs.append(pref)
- cellname = AdminControl.getCell( )
- cell = AdminConfig.getid("/Cell:"+cellname+"/")
- cluster = AdminConfig.create("ServerCluster", cell, attrs )
Adding Member to Cluster
- AdminTask.createClusterMember('[-clusterName ClusterName -memberConfig [-memberNode NodeName -memberName ServerName -memberWeight 1 ] ]')
- set name[list name ClusterName]
- set pref [list preferLocal true]
- set attrs [list $name $pref]
- set cellname [$AdminControl getCell]
- set cell [$AdminConfig getid /Cell:$cellname/]
- set cluster [$AdminConfig create ServerCluster $cell $attrs]
How do I run it? Can I use this script in windows?
ReplyDeleteyes we can run this script in windows
Delete