コード例 #1
0
 def __init__(self, logFile, user, clusterConf, dwsMode=False):
     """
     function: Constructor
     input : logFile, user, clusterConf, dwsMode
     output: NA
     """
     LocalBaseOM.__init__(self, logFile, user, clusterConf, dwsMode)
     if (self.clusterConfig == ""):
         # Read config from static config file
         self.readConfigInfo()
     else:
         self.clusterInfo = dbClusterInfo()
         self.clusterInfo.initFromXml(self.clusterConfig)
         hostName = DefaultValue.GetHostIpOrName()
         self.dbNodeInfo = self.clusterInfo.getDbNodeByName(hostName)
         if (self.dbNodeInfo is None):
             self.logger.logExit(ErrorCode.GAUSS_516["GAUSS_51619"] %
                                 hostName)
     # get user info
     self.getUserInfo()
     if (user != "" and self.user != user.strip()):
         self.logger.debug("User parameter : %s." % user)
         self.logger.logExit(ErrorCode.GAUSS_503["GAUSS_50315"] %
                             (self.user, self.clusterInfo.appPath))
     # init every component
     self.initComponent()
コード例 #2
0
    def __init__(self,
                 logFile,
                 user,
                 clusterConf,
                 dwsMode=False,
                 ignorepgHbaMiss=False,
                 removeIps=None):
        """
        function: configure all instance on local node
        """
        LocalBaseOM.__init__(self, logFile, user, clusterConf, dwsMode)
        if (self.clusterConfig == ""):
            # Read config from static config file
            self.readConfigInfo()
        else:
            self.readConfigInfoByXML()
        # get user info
        self.getUserInfo()
        if (user != "" and self.user != user.strip()):
            self.logger.debug("User parameter : %s." % user)
            self.logger.logExit(ErrorCode.GAUSS_503["GAUSS_50315"] %
                                (self.user, self.clusterInfo.appPath))
        # init every component
        self.initComponent()

        self.ignorepgHbaMiss = ignorepgHbaMiss
        self.allIps = []
        if removeIps is None:
            removeIps = []
        self.removeIps = removeIps
コード例 #3
0
    def __init__(self,
                 logFile,
                 user,
                 clusterConf,
                 dwsMode=False,
                 dataParams=None,
                 confType="",
                 clusterStaticConfigFile="",
                 alarmComponent=""):
        """
        function: configure all instance on local node
        """
        if dataParams is None:
            dataParams = []
        LocalBaseOM.__init__(self, logFile, user, clusterConf, dwsMode)
        if (self.clusterConfig == ""):
            # Read config from static config file
            self.readConfigInfo()
        else:
            self.readConfigInfoByXML()
        # get user info
        self.getUserInfo()
        if (user != "" and self.user != user.strip()):
            self.logger.debug("User parameter : %s." % user)
            self.logger.logExit(ErrorCode.GAUSS_503["GAUSS_50315"] %
                                (self.user, self.clusterInfo.appPath))
        # get log file info
        # init every component
        self.initComponent()

        self.dataGucParams = dataParams
        self.configType = confType
        self.clusterStaticConfigFile = clusterStaticConfigFile
        self.alarmComponent = alarmComponent
        self.__dataConfig = {}
コード例 #4
0
    def __init__(self,
                 logFile="",
                 user="",
                 restoreDir="",
                 restorePara=False,
                 restoreBin=False):
        """
        function: Constructor
        input : logFile, user, restoreDir, restorePara, restoreBin
        output: NA
        """
        LocalBaseOM.__init__(self, logFile, user)
        self.restoreDir = restoreDir
        self.restorePara = restorePara
        self.restoreBin = restoreBin

        self.installPath = ""
        self.binExtractName = ""
        self.group = ""
        self.dbNodeInfo = None
        self.clusterInfo = None
        self.__hostNameFile = None

        # #static parameter
        # Use binary_$hostname/parameter_$hostname to
        # confirm the backup asked that
        self.binTarName = "binary_%s.tar" % HOSTNAME
        self.paraTarName = "parameter_%s.tar" % HOSTNAME
        self.hostnameFileName = "HOSTNAME"
コード例 #5
0
 def __init__(self, logFile, clusterUser, dataParams, instIds):
     """
     function: init function
     input : logFile, clusterUser, dataParams, instIds
     output: NA
     """
     LocalBaseOM.__init__(self, logFile, clusterUser)
     self.__dataGucParams = dataParams[:]
     self.__instanceIds = instIds[:]  # if is empty, check all instances
     self.clusterInfo = None
     self.dbNodeInfo = None
     self.__diskSizeInfo = {}
     self.__pgsqlFiles = []
コード例 #6
0
    def __init__(self,
                 logFile,
                 user,
                 clusterConf,
                 dwsMode=False,
                 mpprcFile="",
                 installPath="",
                 alarmComponent="",
                 upgrade=False):
        """
        function: Constructor
        input : logFile, user, clusterConf, dwsMode, mpprcFile, installPath
                alarmComponent, upgrade
        output: NA
        """
        LocalBaseOM.__init__(self, logFile, user, clusterConf, dwsMode)

        if self.clusterConfig == "":
            # Read config from static config file
            self.readConfigInfo()
        else:
            self.clusterInfo = dbClusterInfo()
            self.clusterInfo.initFromXml(self.clusterConfig,
                                         g_opts.static_config_file)
            hostName = DefaultValue.GetHostIpOrName()
            self.dbNodeInfo = self.clusterInfo.getDbNodeByName(hostName)
            if self.dbNodeInfo is None:
                self.logger.logExit(ErrorCode.GAUSS_516["GAUSS_51619"] %
                                    hostName)
        # get user info
        self.getUserInfo()
        if user != "" and self.user != user.strip():
            self.logger.debug("User parameter : %s." % user)
            self.logger.logExit(ErrorCode.GAUSS_503["GAUSS_50315"] %
                                (self.user, self.clusterInfo.appPath))
        # init every component
        self.initComponent()

        self.mpprcFile = mpprcFile
        self.installPath = installPath
        self.alarmComponent = alarmComponent
        self.upgrade = upgrade
        # This script will be not validating the parameters.
        # Because this should be detected by which instance call
        #  this local script.
        self.productVersion = None
        self.time_out = None
コード例 #7
0
    def __init__(self, logFile, user, dwsMode=False, dbInitParams=None):
        """
        function: init instance
        input : logFile, user, clusterConf, dbInitParams
        output: NA
        """
        if dbInitParams is None:
            dbInitParams = []
        LocalBaseOM.__init__(self, logFile, user, "", dwsMode, dbInitParams)
        if self.clusterConfig == "":
            # Read config from static config file
            self.readConfigInfo()
        else:
            self.readConfigInfoByXML()
        # get user info
        self.getUserInfo()
        if user != "" and self.user != user.strip():
            self.logger.debug("User parameter : %s." % user)
            self.logger.logExit(ErrorCode.GAUSS_503["GAUSS_50315"] % (
            self.user, self.clusterInfo.appPath))

        # init every component
        self.initComponent()
コード例 #8
0
ファイル: Backup.py プロジェクト: zoumingzhe/openGauss-server
    def __init__(self, logFile="", user="", tmpBackupDir="", backupDir="", \
                 backupPara=False, backupBin=False, nodeName=""):
        """
        function: initialize variable
        input : user, tmpBackupDir, backupDir, backupPara,
        backupBin, logFile, nodeName
        output: parameter
        """
        LocalBaseOM.__init__(self, logFile, user)
        self.tmpBackupDir = tmpBackupDir
        self.backupDir = backupDir
        self.backupPara = backupPara
        self.backupBin = backupBin
        self.nodeName = nodeName
        self.installPath = ""
        self.__hostnameFile = None
        self.dbNodeInfo = None
        self.clusterInfo = None

        ##static parameter
        self.binTarName = "binary_%s.tar" % HOSTNAME
        self.paraTarName = "parameter_%s.tar" % HOSTNAME
        self.hostnameFileName = "HOSTNAME"