コード例 #1
0
def listClusterNames(trustStore, trustStorePassword, hostname, port, username,
                     password):
    JMXRESTConnector.trustStore = trustStore
    JMXRESTConnector.trustStorePassword = trustStorePassword

    connector = JMXRESTConnector()
    connector.connect(hostname, port, username, password)
    mconnection = connector.getMBeanServerConnection()

    clusterManager = cluster.manager(mconnection)
    clusterNames = clusterManager.listClusterNames()

    return clusterNames
コード例 #2
0
def stopCluster(trustStore, trustStorePassword, hostname, port, username,
                password, clusterName):
    JMXRESTConnector.trustStore = trustStore
    JMXRESTConnector.trustStorePassword = trustStorePassword

    connector = JMXRESTConnector()
    connector.connect(hostname, port, username, password)
    mconnection = connector.getMBeanServerConnection()

    clusterManager = cluster.manager(mconnection)
    stopClusterResults = clusterManager.stop(argParser[CLUSTER_NAME], "")

    return stopClusterResults
def genClusterPlugin(trustStore, trustStorePassword, hostname, port, username,
                     password, clusterName):
    JMXRESTConnector.trustStore = trustStore
    JMXRESTConnector.trustStorePassword = trustStorePassword

    connector = JMXRESTConnector()
    connector.connect(hostname, port, username, password)
    mconnection = connector.getMBeanServerConnection()

    clusterManager = cluster.manager(mconnection)
    genPluginFile = clusterManager.genPlugin(
        clusterName)  #invoke generate plugins on the cluster

    print "Generated plugin-cfg.xml file: " + str(genPluginFile)
    print "This file will reside in the controller's host filesystem"
    return genPluginFile
コード例 #4
0
      if (os.path.isfile(appPath) == False):
        raise IOError("Cannot transfer specified application, path is not a file: " + str(appPath))

      # Connect to the collective controller
      JMXRESTConnector.trustStore = argParser[arguments.TRUST_STORE]
      JMXRESTConnector.trustStorePassword = argParser[arguments.TRUST_STORE_PASSWORD]
    
      connector = JMXRESTConnector()
      connector.connect(argParser[arguments.HOSTNAME], 
                        int(argParser[arguments.PORT]), 
                        argParser[arguments.USERNAME],
                        argParser[arguments.PASSWORD])
      mconnection = connector.getMBeanServerConnection()

      # Get a list of the cluster members for the specified cluster.
      clusterManager = cluster.manager(mconnection)
      memberList = clusterManager.listMembers(argParser[CLUSTER_NAME])

      if ((memberList == None) or (len(memberList) == 0)):
        print "The cluster " + argParser[CLUSTER_NAME] + " did not contain any members"
      else:
        print ""
        # List of servers that had problems
        problemMembers = []

        for member in memberList:
          try:
            # The cluster manager returns member information in the form
            # host,userdir,servername.  Parse out those three parts.
            serverInfo = member.split(",")
            if (len(serverInfo) != 3):
コード例 #5
0
                    str(configPath))

            # Connect to the collective controller
            JMXRESTConnector.trustStore = argParser[arguments.TRUST_STORE]
            JMXRESTConnector.trustStorePassword = argParser[
                arguments.TRUST_STORE_PASSWORD]

            connector = JMXRESTConnector()
            connector.connect(argParser[arguments.HOSTNAME],
                              int(argParser[arguments.PORT]),
                              argParser[arguments.USERNAME],
                              argParser[arguments.PASSWORD])
            mconnection = connector.getMBeanServerConnection()

            # Get a list of the cluster members for the specified cluster.
            clusterManager = cluster.manager(mconnection)
            memberList = clusterManager.listMembers(argParser[CLUSTER_NAME])

            if ((memberList == None) or (len(memberList) == 0)):
                print "The cluster " + argParser[
                    CLUSTER_NAME] + " did not contain any members"
            else:
                print ""
                # List of servers that had problems
                problemMembers = []

                for member in memberList:
                    try:
                        # The cluster manager returns member information in the form
                        # host,userdir,servername.  Parse out those three parts.
                        serverInfo = member.split(",")