def setup_cluster(self):
if self.couple is not None and self.couple_pass is None:
self.couple_pass = self.adminpass
self.couple_user = self.adminuser
if self.boothost is None:
self.boothost = self.host[0]
self.host.remove(self.boothost)
if self.ml_init(self.boothost):
self.ml_security(self.boothost)
conn = Connection(self.boothost, HTTPDigestAuth(self.adminuser, self.adminpass))
self.marklogic = MarkLogic(conn)
for hostname in self.host:
self.ml_init(hostname)
self.ml_join(self.boothost, hostname)
if self.name is not None:
print("{0}: rename cluster...".format(self.boothost))
cluster = self.marklogic.cluster()
cluster.set_cluster_name(self.name)
cluster.update()
if self.couple is not None:
for couple in self.couple:
print("{0}: couple with {1}...".format(self.boothost, couple))
altconn = Connection(couple,
HTTPDigestAuth(self.couple_user,
self.couple_pass))
altml = MarkLogic(altconn)
altcluster = altml.cluster()
cluster = self.marklogic.cluster()
cluster.couple(altcluster)
print("Finished")
评论列表
文章目录