diff --git a/script/SSHCmd/SSHCommand.py b/script/SSHCmd/SSHCommand.py
deleted file mode 100755
index a3d4b5a..0000000
--- a/script/SSHCmd/SSHCommand.py
+++ /dev/null
@@ -1,59 +0,0 @@
-import os
-import getpass
-import paramiko
-import subprocess
-import sys
-
-
-class Connect():
-
-    def __init__(self, host):
-        self.user = getpass.getuser()
-        self.host = host
-        self.sshclient = paramiko.SSHClient()
-        self.sshclient.set_missing_host_key_policy(paramiko.AutoAddPolicy())
-        HOME = os.getenv('HOME')
-        self.pkey = paramiko.RSAKey.from_private_key_file(f'{HOME}/.ssh/id_rsa')
-
-    def __innerssh(self, user, command):
-        self.sshclient.connect(hostname=self.host, port=22, username=user, pkey=self.pkey)
-        stdin, stdout, stderr = self.sshclient.exec_command(f'{command}')
-        res = stdout.read()
-        res = str(res).split('\\n')
-        return res
-
-    def ssh(self, command):
-        return self.__innerssh(self.user, command)
-
-    # 上传文件
-    def upload_file(self, local_path, server_path):
-        try:
-            sftp_upload_file = paramiko.Transport(self.host, 22)
-            sftp_upload_file.connect(username=self.user, pkey=self.pkey)
-            sftp = paramiko.SFTPClient.from_transport(sftp_upload_file)
-            sftp.put(local_path, server_path)
-            sftp.close()
-            return True
-        except Exception as err:
-            print(f'ERROR: Failed to upload files from {local_path} to server:{self.host} {server_path}')
-            print(err)
-            sys.exit(1)
-
-
-def client(path):
-    status, output = subprocess.getstatusoutput(path)
-    if status != 0:
-        print(f'ERROR: "{path}" Command execution failure .')
-        sys.exit(1)
-    return True
-
-
-
-
-
-
-
-
-
-
-
diff --git a/script/SSHCmd/__init__.py b/script/SSHCmd/__init__.py
deleted file mode 100755
index e69de29..0000000
diff --git a/script/getConf/__init__.py b/script/getConf/__init__.py
deleted file mode 100755
index e69de29..0000000
diff --git a/script/getConf/readXml.py b/script/getConf/readXml.py
deleted file mode 100755
index c7fc342..0000000
--- a/script/getConf/readXml.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import os
-
-import xml.etree.cElementTree as ET
-
-
-def readXml(xml_path):
-    if not os.path.exists(xml_path):
-        print('ERROR: XML file not found.')
-        return
-    tree = ET.ElementTree(file=xml_path)
-    root = tree.getroot()
-    for c in root.iter('CLUSTER'):
-        for p in c.iter('PARAM'):
-            if p.get('name') == 'backIp1s':
-                host_list = p.get('value').replace(' ', '').split(',')
-                return host_list
-    print('ERROR: Failed to get XML information.')
-    return
-
-
-def getDataDir(xml_path):
-    if not os.path.exists(xml_path):
-        print('ERROR: XML file not found.')
-    tree = ET.ElementTree(file=xml_path)
-    root = tree.getroot()
-    for d in root.iter("DEVICELIST"):
-        for p in d.iter('DEVICE'):
-            for n in p.iter('PARAM'):
-                if n.get('name') == "dataNode1":
-                    datadir = n.get('value').replace(' ', '').split(',')[0]
-                    return datadir
-    print('ERROR: Failed to obtain datadir. Procedure')
-    return
-
-
-
-
diff --git a/script/gs_install_plugin b/script/gs_install_plugin
index 92bc61c..a82fe96 100755
--- a/script/gs_install_plugin
+++ b/script/gs_install_plugin
@@ -1,102 +1,62 @@
 #!/usr/bin/env python3
-import sys
-import subprocess
-import argparse
-from operation import deploy
-from getConf.readXml import readXml, getDataDir
-
 
-def get_cup():
-    status, output = subprocess.getstatusoutput('uname -m')
-    if status != 0:
-        print('ERROR: Failed to obtain CPU information. Procedure')
-        sys.exit(1)
-    if 'x86_64' in output:
-        return 'x86'
-    return output
 
+import argparse
 
-def get_system_name():
-    status, output = subprocess.getstatusoutput("cat /etc/os-release|grep -e '^NAME='")
-    if status != 0:
-        print('ERROR: Failed to obtain operating system information. Procedure')
-        sys.exit(1)
-    if "openEuler" in output or "Kylin" in output or "UnionTech" in output:
-        return "openEuler"
-    if "CentOS" in output or "Red Hat" in output:
-        return "CentOS"
+from impl.plugininstall.plugininstall import Deploy
 
 
-if __name__ == '__main__':
+all_plugins = [
+    'dblink',
+    'pg_trgm',
+    'wal2json',
+    'pg_repack',
+    'orafce',
+    'pg_bulkload',
+    'pg_prewarm',
+]
 
-    parser = argparse.ArgumentParser(description='Plug-in installer .')
-    parser.add_argument('-X', dest='xml', help='Add the location of the MogDB clusterconfig.xml file .')
-    parser.add_argument('--all', dest='all', help='Install all plug-ins .', action='store_true')
-    parser.add_argument('--dblink', dest='dblink', help='Install dblink plug-in .', action='store_true')
-    parser.add_argument('--pg_trgm', dest='pg_trgm', help='Install pg_trgm plug-in .', action='store_true')
-    parser.add_argument('--wal2json', dest='wal2json', help="Install wal2json plug-in .", action='store_true')
-    parser.add_argument('--pg_repack', dest='pg_repack', help="Install pg_repack plug-in .", action='store_true')
-    parser.add_argument('--orafce', dest='orafce', help="Install orafce plug-in .", action='store_true')
-    parser.add_argument('--pg_bulkload', dest='pg_bulkload', help="Install pg_bulkload plug-in .", action='store_true')
-    parser.add_argument('--pg_prewarm', dest='pg_prewarm', help="Install pg_prewarm plug-in .", action='store_true')
-    parser.add_argument('--plugins', dest='plugins', help="Multiple parameters can be accepted .", nargs='+')
 
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='Plugin installer')
+    parser.add_argument('-X', dest='xml', help='Add the location of the MogDB clusterconfig.xml file .', required=True)
+    parser.add_argument('-p', '--plugin-pkg', dest='plugin_pkg', help="Specify plugin package file path")
+    parser.add_argument('--all', dest='all', help='Install all plugins', action='store_true')
+    parser.add_argument('--dblink', dest='dblink', help='Install dblink plugin', action='store_true')
+    parser.add_argument('--pg_trgm', dest='pg_trgm', help='Install pg_trgm plugin', action='store_true')
+    parser.add_argument('--wal2json', dest='wal2json', help="Install wal2json plugin", action='store_true')
+    parser.add_argument('--pg_repack', dest='pg_repack', help="Install pg_repack plugin", action='store_true')
+    parser.add_argument('--orafce', dest='orafce', help="Install orafce plugin", action='store_true')
+    parser.add_argument('--pg_bulkload', dest='pg_bulkload', help="Install pg_bulkload plugin", action='store_true')
+    parser.add_argument('--pg_prewarm', dest='pg_prewarm', help="Install pg_prewarm plugin", action='store_true')
+    parser.add_argument('--plugins', dest='plugins', help='Multiple parameters can be accepted', nargs='+')
+
+    parser.add_argument('-d', dest='debug', help="Print debug log",  action='store_true')
+    
     args = parser.parse_args()
-    cpu = get_cup()
-    system_name = get_system_name()
-    if args.xml == False:
-        print('ERROR: Add the XML file path.')
-        sys.exit(1)
-    datadir = getDataDir(args.xml)
-    ip_list = readXml(args.xml)
-    deploy = deploy(ip_list, cpu, datadir, system_name)
-
-    if args.plugins != None:
-        for plugin in args.plugins:
-            if plugin not in ['dblink', "pg_trgm", "pg_repack", "wal2json", "orafce", "pg_bulkload", "pg_prewarm"]:
-                print(f'ERROR: {plugin} If the parameter is incorrect, see --help.')
-                sys.exit(1)
-            elif plugin == 'dblink':
-                deploy.dblink_deploy()
-            elif plugin == 'pg_trgm':
-                deploy.pg_trgm_deploy()
-            elif plugin == 'pg_repack':
-                deploy.pg_repack_deploy()
-            elif plugin == 'wal2json':
-                deploy.wal2json_deploy()
-            elif plugin == 'orafce':
-                deploy.orafce_deploy()
-            elif plugin == 'pg_bulkload':
-                deploy.pg_bulkload_deploy()
-            elif plugin == 'pg_prewarm':
-                deploy.pg_prewarm_deploy()
-
-    if args.all == True:
-        deploy.dblink_deploy()
-        deploy.pg_trgm_deploy()
-        deploy.pg_repack_deploy()
-        deploy.wal2json_deploy()
-        deploy.orafce_deploy()
-        deploy.pg_bulkload_deploy()
-        deploy.pg_prewarm_deploy()
-
-    if args.dblink == True:
-        deploy.dblink_deploy()
-    if args.pg_trgm == True:
-        deploy.pg_trgm_deploy()
-    if args.pg_repack == True:
-        deploy.pg_repack_deploy()
-    if args.wal2json == True:
-        deploy.wal2json_deploy()
-    if args.orafce == True:
-        deploy.orafce_deploy()
-    if args.pg_bulkload == True:
-        deploy.pg_bulkload_deploy()
-    if args.pg_prewarm == True:
-        deploy.pg_prewarm_deploy()
-
-
-
-
-
 
+    with Deploy(args.xml, args.plugin_pkg, args.debug) as d:
+        plugins = []
+        if args.all:
+            plugins = all_plugins
+        elif args.plugins:
+            for plugin in args.plugins:
+                if plugin not in all_plugins:
+                    print(f'Please enter the correct parameters: {plugin}')
+                plugins.append(plugin)
+        else:
+            if args.dblink:
+                plugins.append('dblink')
+            if args.pg_trgm:
+                 plugins.append('pg_trgm')
+            if args.pg_repack:
+                 plugins.append('pg_repack')
+            if args.wal2json:
+                 plugins.append('wal2json')
+            if args.orafce:
+                plugins.append('orafce')
+            if args.pg_bulkload:
+                plugins.append('pg_bulkload')
+            if args.pg_prewarm:
+                plugins.append('pg_prewarm')
+        d.deploy(plugins)
diff --git a/script/gs_install_plugin_local b/script/gs_install_plugin_local
index 5ad7643..5345032 100644
--- a/script/gs_install_plugin_local
+++ b/script/gs_install_plugin_local
@@ -1,94 +1,60 @@
 #!/usr/bin/env python3
+
 import sys
-import subprocess
 import argparse
-from operation import PluginInstallLocal
-from getConf.readXml import getDataDir
-
 
-def get_cup():
-    status, output = subprocess.getstatusoutput('uname -m')
-    if status != 0:
-        print('ERROR: Failed to obtain CPU information. Procedure')
-        sys.exit(1)
-    if 'x86_64' in output:
-        return 'x86'
-    return output
+from impl.plugininstall.plugininstall import Deploy
 
 
-def get_system_name():
-    status, output = subprocess.getstatusoutput("cat /etc/os-release|grep -e '^NAME='")
-    if status != 0:
-        print('ERROR: Failed to obtain operating system information. Procedure')
-        sys.exit(1)
-    if "openEuler" in output or "Kylin" in output or "UnionTech" in output:
-        return "openEuler"
-    if "CentOS" in output or "Red Hat" in output:
-        return "CentOS"
+all_plugins = [
+    'dblink',
+    'pg_trgm',
+    'wal2json',
+    'pg_repack',
+    'orafce',
+    'pg_bulkload',
+    'pg_prewarm',
+]
 
 
 if __name__ == '__main__':
-    parser = argparse.ArgumentParser(description='Plug-in installer .')
-    parser.add_argument('-X', dest='xml', help='Add the location of the MogDB clusterconfig.xml file .')
-    parser.add_argument('--all', dest='all', help='Install all plug-ins .', action='store_true')
-    parser.add_argument('--dblink', dest='dblink', help='Install dblink plug-in .', action='store_true')
-    parser.add_argument('--pg_trgm', dest='pg_trgm', help='Install pg_trgm plug-in .', action='store_true')
-    parser.add_argument('--wal2json', dest='wal2json', help="Install wal2json plug-in .", action='store_true')
-    parser.add_argument('--pg_repack', dest='pg_repack', help="Install pg_repack plug-in .", action='store_true')
-    parser.add_argument('--orafce', dest='orafce', help="Install orafce plug-in .", action='store_true')
-    parser.add_argument('--pg_bulkload', dest='pg_bulkload', help="Install pg_bulkload plug-in .", action='store_true')
-    parser.add_argument('--pg_prewarm', dest='pg_prewarm', help="Install pg_prewarm plug-in .", action='store_true')
-    parser.add_argument('--plugins', dest='plugins', help="Multiple parameters can be accepted .", nargs='+')
+    parser = argparse.ArgumentParser(description='Plugin installer')
+    parser.add_argument('-p', '--plugin-pkg', dest='plugin_pkg', help="Specify plugin package file path")
+    parser.add_argument('--all', dest='all', help='Install all plugins', action='store_true')
+    parser.add_argument('--dblink', dest='dblink', help='Install dblink plugin', action='store_true')
+    parser.add_argument('--pg_trgm', dest='pg_trgm', help='Install pg_trgm plugin', action='store_true')
+    parser.add_argument('--wal2json', dest='wal2json', help="Install wal2json plugin", action='store_true')
+    parser.add_argument('--pg_repack', dest='pg_repack', help="Install pg_repack plugin", action='store_true')
+    parser.add_argument('--orafce', dest='orafce', help="Install orafce plugin", action='store_true')
+    parser.add_argument('--pg_bulkload', dest='pg_bulkload', help="Install pg_bulkload plugin", action='store_true')
+    parser.add_argument('--pg_prewarm', dest='pg_prewarm', help="Install pg_prewarm plugin", action='store_true')
+    parser.add_argument('--plugins', dest='plugins', help='Multiple parameters can be accepted', nargs='+')
+    
+    parser.add_argument('-d', dest='debug', help="Print debug log",  action='store_true')
 
     args = parser.parse_args()
-    cpu = get_cup()
-    system_name = get_system_name()
-    if args.xml == False:
-        print('ERROR: Add the XML file path.')
-        sys.exit(1)
-    datadir = getDataDir(args.xml)
-    pluginInstall = PluginInstallLocal(cpu, datadir, system_name)
-
-    if args.plugins != None:
-        for plugin in args.plugins:
-            if plugin not in ['dblink', "pg_trgm", "pg_repack", "wal2json", "orafce", "pg_bulkload", "pg_prewarm"]:
-                print(f'ERROR: {plugin} If the parameter is incorrect, see --help.')
-                sys.exit(1)
-            elif plugin == 'dblink':
-                pluginInstall.deploy_dblink()
-            elif plugin == 'pg_trgm':
-                pluginInstall.deploy_pg_trgm()
-            elif plugin == 'pg_repack':
-                pluginInstall.deploy_pg_repack()
-            elif plugin == 'wal2json':
-                pluginInstall.deploy_wal2json()
-            elif plugin =='orafce':
-                pluginInstall.deploy_orafce()
-            elif plugin == 'pg_bulkload':
-                pluginInstall.deploy_pg_bulkload()
-            elif plugin == 'pg_prewarm':
-                pluginInstall.deploy_pg_prewarm()
-
-    if args.all == True:
-        pluginInstall.deploy_dblink()
-        pluginInstall.deploy_pg_trgm()
-        pluginInstall.deploy_pg_repack()
-        pluginInstall.deploy_wal2json()
-        pluginInstall.deploy_orafce()
-        pluginInstall.deploy_pg_bulkload()
-        pluginInstall.deploy_pg_prewarm()
-
-    if args.dblink == True:
-        pluginInstall.deploy_dblink()
-    if args.pg_trgm == True:
-        pluginInstall.deploy_pg_trgm()
-    if args.pg_repack == True:
-        pluginInstall.deploy_pg_repack()
-    if args.wal2json == True:
-        pluginInstall.deploy_wal2json()
-    if args.orafce == True:
-        pluginInstall.deploy_orafce()
-    if args.pg_bulkload == True:
-        pluginInstall.deploy_pg_bulkload()
-    if args.pg_prewarm == True:
-        pluginInstall.deploy_pg_prewarm()
+    with Deploy('', args.plugin_pkg, args.debug) as d:
+        plugins = []
+        if args.all:
+            plugins = all_plugins
+        elif args.plugins:
+            for plugin in args.plugins:
+                if plugin not in all_plugins:
+                    print(f'Please enter the correct parameters: {plugin}')
+                plugins.append(plugin)
+        else:
+            if args.dblink:
+                plugins.append('dblink')
+            if args.pg_trgm:
+                 plugins.append('pg_trgm')
+            if args.pg_repack:
+                 plugins.append('pg_repack')
+            if args.wal2json:
+                 plugins.append('wal2json')
+            if args.orafce:
+                plugins.append('orafce')
+            if args.pg_bulkload:
+                plugins.append('pg_bulkload')
+            if args.pg_prewarm:
+                plugins.append('pg_prewarm')
+        d.deploy(plugins)
diff --git a/script/impl/plugininstall/plugininstall.py b/script/impl/plugininstall/plugininstall.py
new file mode 100755
index 0000000..c862384
--- /dev/null
+++ b/script/impl/plugininstall/plugininstall.py
@@ -0,0 +1,123 @@
+import os
+import shutil
+import subprocess
+from tempfile import mkdtemp
+import logging
+
+from gspylib.threads.SshTool import SshTool
+from gspylib.common.DbClusterInfo import dbClusterInfo
+from gspylib.common.ErrorCode import ErrorCode
+from gspylib.common.Common import DefaultValue
+
+
+GAUSSHOME = os.getenv("GAUSSHOME")
+BIN_DIR = f'{GAUSSHOME}/bin'
+GPHOME = os.getenv('GPHOME')
+LIB_POSTGRESQL_DIR = f'{GAUSSHOME}/lib/postgresql/'
+EXTENSION_DIR = f'{GAUSSHOME}/share/postgresql/extension'
+CONTRIB_DIR = f'{GAUSSHOME}/share/postgresql/contrib'
+
+
+logger = logging.getLogger(__name__)
+
+
+class Deploy():
+    def __init__(self, xmlfile="", plugin_pkg="", debug=False):
+        self.debug = debug
+        if self.debug:
+            logger.setLevel(logging.DEBUG)
+        self.xml = xmlfile
+        logger.debug(f"use xml file: {xmlfile}")
+        self.plugin_pkg = plugin_pkg
+        if not self.plugin_pkg:
+            self.plugin_pkg = f"{GPHOME}/script/static/plugins-*.tar.gz"
+        logger.debug(f"use plugin package file: {self.plugin_pkg}")
+        self.local_mode = not bool(self.xml)
+        logger.debug(f"local mode is {self.local_mode}")
+        if self.local_mode:
+            self.executor = self.local_execute
+        else:
+            self.nodenames = dbClusterInfo().readClusterHosts(xmlfile)
+            self.ssh_tool = SshTool(self.nodenames)
+            self.executor = self.ssh_execute
+        self._plugins_temp_dir = mkdtemp()
+        logger.debug(f"deconpress plugin package to {self._plugins_temp_dir}")
+        self.local_execute(f"tar -xf {self.plugin_pkg} -C {self._plugins_temp_dir}")
+        self.plugins_dir = os.path.join(self._plugins_temp_dir, 'plugins')
+        logger.debug("make common dirs")
+        self.executor(f"mkdir -p {LIB_POSTGRESQL_DIR} {EXTENSION_DIR} {CONTRIB_DIR}")
+
+    def local_execute(self, cmd):
+        status, output = subprocess.getstatusoutput(cmd)
+        if status != 0:
+            raise Exception(ErrorCode.GAUSS_514["GAUSS_51400"] % cmd)
+        return output
+            
+    def ssh_execute(self, cmd):
+        return self.ssh_tool.executeCommand(cmd, descript='', cmdReturn=DefaultValue.SUCCESS, hostList=self.nodenames)
+
+    def copy_file(self, source, target_dir):
+        if self.local_mode:
+            return shutil.copy2(source, target_dir)
+        return self.ssh_tool.scpFiles(source, target_dir, hostList=self.nodenames)
+
+    def __enter__(self):
+        logger.debug("enter deploy context")
+        return self
+
+    def __exit__(self, *args, **kwargs):
+        logger.debug("exit deploy context")
+        if self._plugins_temp_dir:
+            logger.debug(f"remove temp dir {self._plugins_temp_dir}")
+            shutil.rmtree(self._plugins_temp_dir)
+
+    def deploy(self, plugin_names):
+        logger.debug(f"these plugins will be installed: {plugin_names}")
+        for name in plugin_names:
+            fn_name = f'{name}_deploy'
+            if hasattr(self, fn_name):
+                getattr(self, f'{name}_deploy')()
+
+    def _scp_plugin(self, plugin_name, special_file_dict={}):
+        '''
+        plugin_name: plugin dir name
+        special_file_dict: {filename: target_dir, ...]
+        '''
+        logger.debug(f"installing {plugin_name}")
+        local_dir = os.path.join(self.plugins_dir, plugin_name)
+        for filename in os.listdir(local_dir):
+            filepath = os.path.join(local_dir, filename)
+            target_dir = EXTENSION_DIR
+            if filename in special_file_dict.keys():
+                target_dir = special_file_dict[filename]
+            elif filename.endswith(".so"):
+                target_dir = LIB_POSTGRESQL_DIR
+            self.copy_file(filepath, target_dir)
+        print(f'SUCCESS: {plugin_name}.')
+
+    def dblink_deploy(self):
+        self._scp_plugin('dblink')
+
+    def pg_repack_deploy(self):
+        self._scp_plugin('pg_repack', {'pg_repack': BIN_DIR})
+
+    def wal2json_deploy(self):
+        self._scp_plugin('wal2json')
+
+    def pg_trgm_deploy(self):
+        self._scp_plugin('pg_trgm')
+
+    def orafce_deploy(self):
+        self._scp_plugin('orafce')
+
+    def pg_bulkload_deploy(self):
+        special_file_dict = {
+            'pg_bulkload': BIN_DIR,
+            'postgresql': BIN_DIR,
+            'uninstall_pg_timestamp.sql': CONTRIB_DIR,
+            'pg_timestamp.sql': CONTRIB_DIR,
+        }
+        self._scp_plugin('pg_bulkload', special_file_dict)
+
+    def pg_prewarm_deploy(self):
+        self._scp_plugin('pg_prewarm')
diff --git a/script/operation.py b/script/operation.py
deleted file mode 100755
index 16e9788..0000000
--- a/script/operation.py
+++ /dev/null
@@ -1,334 +0,0 @@
-import sys, os
-import subprocess
-from SSHCmd.SSHCommand import Connect, client
-
-
-class deploy():
-    def __init__(self, ip_list, cpu, datadir, name):
-        self.ip_list = ip_list
-        self.cpu = cpu
-        self.datadir = datadir
-        self.system_name = name
-        if self.cpu:
-            self.tar_mogdb_plugin = f'tar -xf plugins-{self.system_name}-{self.cpu}-2.1.0.tar.gz'
-        status, output = subprocess.getstatusoutput(f'cd {sys.path[0]}/static;{self.tar_mogdb_plugin}')
-        if status != 0:
-            print('ERROR: Failed to decompress the plugins package. Procedure')
-            sys.exit(1)
-        self.GAUSSHOME = os.getenv('GAUSSHOME')
-        mkdir_postgres = f'mkdir -p {self.GAUSSHOME}/lib/postgresql/'
-        mkdir_share = f'mkdir -p {self.GAUSSHOME}/share/postgresql/extension'
-        mkdir_contrib = f'mkdir -p {self.GAUSSHOME}/share/postgresql/contrib'
-        for ip in self.ip_list:
-            connect = Connect(ip)
-            postgres = connect.ssh(mkdir_postgres)
-            share = connect.ssh(mkdir_share)
-            contrib = connect.ssh(mkdir_contrib)
-
-    def dblink_deploy(self):
-        if self.cpu:
-            so_file = sys.path[0] + '/static/plugins/dblink/dblink.so'
-            control = sys.path[0] + '/static/plugins/dblink/dblink.control'
-            dblink_sql = sys.path[0] + '/static/plugins/dblink/dblink--1.0.sql'
-            dblink_unpack_sql = sys.path[0] + '/static/plugins/dblink/dblink--unpackaged--1.0.sql'
-            server_so_file_path = self.GAUSSHOME + '/lib/postgresql/'
-            server_path = self.GAUSSHOME + '/share/postgresql/extension/'
-
-            for ip in self.ip_list:
-                connect = Connect(ip)
-                up_dblink_so = connect.upload_file(so_file, os.path.join(server_so_file_path, 'dblink.so'))
-                up_dblink_control = connect.upload_file(control, os.path.join(server_path, 'dblink.control'))
-                up_dblink_sql = connect.upload_file(dblink_sql, os.path.join(server_path, 'dblink--1.0.sql'))
-                up_dblink_un_sql = connect.upload_file(dblink_unpack_sql,
-                                                       os.path.join(server_path, 'dblink--unpackaged--1.0.sql'))
-            print('SUCCESS: dblink.')
-            return
-        print('ERROR: Installation failed dblink.')
-        return
-
-    def pg_repack_deploy(self):
-        if self.cpu:
-            so_file = sys.path[0] + '/static/plugins/pg_repack/pg_repack.so'
-            control_file = sys.path[0] + '/static/plugins/pg_repack/pg_repack.control'
-            pg_repack_file = sys.path[0] + '/static/plugins/pg_repack/pg_repack'
-            pg_repack_sql = sys.path[0] + '/static/plugins/pg_repack/pg_repack--1.4.6.sql'
-
-            server_bin_path = self.GAUSSHOME + '/bin/'
-            server_so_file_path = self.GAUSSHOME + '/lib/postgresql/'
-            server_sql_file_path = self.GAUSSHOME + '/share/postgresql/extension/'
-            for ip in self.ip_list:
-                connect = Connect(ip)
-                up_pg_repack_so = connect.upload_file(so_file, os.path.join(server_so_file_path, 'pg_repack.so'))
-                up_pg_repack = connect.upload_file(pg_repack_file, os.path.join(server_bin_path, 'pg_repack'))
-                up_control_file = connect.upload_file(control_file,
-                                                      os.path.join(server_sql_file_path, 'pg_repack.control'))
-                up_pg_repack_sql = connect.upload_file(pg_repack_sql,
-                                                       os.path.join(server_sql_file_path, 'pg_repack--1.4.6.sql'))
-            print('SUCCESS: pg_repack.')
-            return
-        print('ERROR: Installation failed pg_repack')
-        return
-
-    def wal2json_deploy(self):
-        if self.cpu:
-            so_file = sys.path[0] + '/static/plugins/wal2json/wal2json.so'
-            server_so_file_path = self.GAUSSHOME + '/lib/postgresql/'
-            for ip in self.ip_list:
-                connect = Connect(ip)
-                up_wal2json_so = connect.upload_file(so_file, os.path.join(server_so_file_path, 'wal2json.so'))
-            gs_ctl_restart = self.GAUSSHOME + '/bin/gs_ctl -D ' + self.datadir + ' restart'
-            wal_level = self.GAUSSHOME + '/bin/gs_guc set -D ' + self.datadir + ' -c \"wal_level = \'logical\'\"'
-            for ip in self.ip_list:
-                connect = Connect(ip)
-                gs_guc = connect.ssh(wal_level)
-                if "Success to perform gs_guc!" in gs_guc:
-                    pass
-                else:
-                    print(f'Warning: {ip} postgresql.conf wal_level Failed to modify parameters. '
-                          f'Please manually modify parameters')
-                restart = connect.ssh(gs_ctl_restart)
-                if 'server started' in str(restart):
-                    pass
-                else:
-                    print(f'Warning: {ip} The database fails to restart. Restart the database manually.')
-                    return
-            print('SUCCESS: wal2json.')
-            return
-        print('ERROR: Installation failed wal2json.')
-        return
-
-    def pg_trgm_deploy(self):
-        if self.cpu:
-            so_file = sys.path[0] + '/static/plugins/pg_trgm/pg_trgm.so'
-            control = sys.path[0] + '/static/plugins/pg_trgm/pg_trgm.control'
-            pg_trgm_sql = sys.path[0] + '/static/plugins/pg_trgm/pg_trgm--1.0.sql'
-            pg_trgm__un_sql = sys.path[0] + '/static/plugins/pg_trgm/pg_trgm--unpackaged--1.0.sql'
-            server_so_file_path = self.GAUSSHOME + '/lib/postgresql/'
-            server_sql_file_path = self.GAUSSHOME + '/share/postgresql/extension/'
-            for ip in self.ip_list:
-                connect = Connect(ip)
-                up_pg_trgm_so = connect.upload_file(so_file, os.path.join(server_so_file_path, 'pg_trgm.so'))
-                up_pg_trgm_control = connect.upload_file(control, os.path.join(server_sql_file_path, 'pg_trgm.control'))
-                up_pg_trgm_sql = connect.upload_file(pg_trgm_sql,
-                                                     os.path.join(server_sql_file_path, 'pg_trgm--1.0.sql'))
-                up_pg_trgm_un_sql = connect.upload_file(pg_trgm__un_sql, os.path.join(server_sql_file_path,
-                                                                                      'pg_trgm--unpackaged--1.0.sql'))
-            print('SUCCESS: pg_trgm.')
-            return
-        print('ERROR: Installation failed pg_trgm.')
-        return
-
-    def orafce_deploy(self):
-        if self.cpu:
-            so_file = sys.path[0] + '/static/plugins/orafce/orafce.so'
-            control = sys.path[0] + '/static/plugins/orafce/orafce.control'
-            orafce_sql1 = sys.path[0] + '/static/plugins/orafce/orafce--3.17.sql'
-            server_so_file_path = self.GAUSSHOME + '/lib/postgresql/'
-            server_sql_file_path = self.GAUSSHOME + '/share/postgresql/extension/'
-            server_doc_path = self.GAUSSHOME + '/share/doc/postgresql/extension/'
-            for ip in self.ip_list:
-                connect = Connect(ip)
-                up_so_file = connect.upload_file(so_file, os.path.join(server_so_file_path, 'orafce.so'))
-                up_orafce_control = connect.upload_file(control, os.path.join(server_sql_file_path, 'orafce.control'))
-                up_orafce_sql1 = connect.upload_file(orafce_sql1,
-                                                     os.path.join(server_sql_file_path, 'orafce--3.17.sql'))
-            print('SUCCESS: orafce.')
-            return
-        print('ERROR: Installation failed orafce.')
-        return
-
-    def pg_bulkload_deploy(self):
-        if self.cpu:
-            pg_bulkload_dir = sys.path[0] + '/static/plugins/pg_bulkload/pg_bulkload'
-            postgresql_dir = sys.path[0] + '/static/plugins/pg_bulkload/postgresql'
-            so_file = sys.path[0] + '/static/plugins/pg_bulkload/pg_bulkload.so'
-            control_file = sys.path[0] + '/static/plugins/pg_bulkload/pg_bulkload.control'
-            pg_bulkload_sql1 = sys.path[0] + '/static/plugins/pg_bulkload/pg_bulkload--1.0.sql'
-            pg_bulkload_sql2 = sys.path[0] + '/static/plugins/pg_bulkload/pg_bulkload--unpackaged--1.0.sql'
-            pg_bulkload_sql3 = sys.path[0] + '/static/plugins/pg_bulkload/uninstall_pg_bulkload.sql'
-            pg_bulkload_sql4 = sys.path[0] + '/static/plugins/pg_bulkload/pg_bulkload.sql'
-            pg_timestamp_so_file = sys.path[0] + '/static/plugins/pg_bulkload/pg_timestamp.so'
-            pg_timestamp_sql_file = sys.path[0] + '/static/plugins/pg_bulkload/uninstall_pg_timestamp.sql'
-            pg_timestamp_sql2_file = sys.path[0] + '/static/plugins/pg_bulkload/pg_timestamp.sql'
-            server_pg_bulkload_dir_path = self.GAUSSHOME + '/bin'
-            server_so_file_path = self.GAUSSHOME + '/lib/postgresql/'
-            server_sql_file_path = self.GAUSSHOME + '/share/postgresql/extension/'
-            server_contrib_path = self.GAUSSHOME + '/share/postgresql/contrib/'
-            for ip in self.ip_list:
-                connect = Connect(ip)
-                up_pg_bulkload_dir = connect.upload_file(pg_bulkload_dir, os.path.join(server_pg_bulkload_dir_path,
-                                                                                       'pg_bulkload'))
-                up_postgresql_dir = connect.upload_file(postgresql_dir, os.path.join(server_pg_bulkload_dir_path,
-                                                                                     'postgresql'))
-                up_so_file = connect.upload_file(so_file, os.path.join(server_so_file_path, 'pg_bulkload.so'))
-                up_control_file = connect.upload_file(control_file, os.path.join(server_sql_file_path,
-                                                                                 'pg_bulkload.control'))
-                up_pg_bulkload_sql1 = connect.upload_file(pg_bulkload_sql1, os.path.join(server_sql_file_path,
-                                                                                         'pg_bulkload--1.0.sql'))
-                up_pg_bulkload_sql2 = connect.upload_file(pg_bulkload_sql2, os.path.join(server_sql_file_path,
-                                                                                         'pg_bulkload--unpackaged--1.0.sql'))
-                up_pg_bulkload_sql3 = connect.upload_file(pg_bulkload_sql3, os.path.join(server_sql_file_path,
-                                                                                         'uninstall_pg_bulkload.sql'))
-                up_pg_bulkload_sql4 = connect.upload_file(pg_bulkload_sql4, os.path.join(server_sql_file_path,
-                                                                                         'pg_bulkload.sql'))
-                up_pg_timestamp_so = connect.upload_file(pg_timestamp_so_file, os.path.join(server_so_file_path,
-                                                                                            'pg_timestamp.so'))
-                up_pg_timestamp_sql_file = connect.upload_file(pg_timestamp_sql_file, os.path.join(server_contrib_path,
-                                                                                                   'uninstall_pg_timestamp.sql'))
-                up_pg_timestamp_sql_file2 = connect.upload_file(pg_timestamp_sql2_file,
-                                                                os.path.join(server_contrib_path,
-                                                                             'pg_timestamp.sql'))
-            print('SUCCESS: pg_bulkload.')
-            return
-        print('ERROR: Installation failed pg_bulkload.')
-        return
-
-    def pg_prewarm_deploy(self):
-        if self.cpu:
-            so_file = sys.path[0] + '/static/plugins/pg_prewarm/pg_prewarm.so'
-            control_file = sys.path[0] + '/static/plugins/pg_prewarm/pg_prewarm.control'
-            pg_prewarm_sql = sys.path[0] + '/static/plugins/pg_prewarm/pg_prewarm--1.1.sql'
-            server_so_file_path = self.GAUSSHOME + '/lib/postgresql/'
-            server_path = self.GAUSSHOME + '/share/postgresql/extension/'
-            for ip in self.ip_list:
-                connect = Connect(ip)
-                up_dblink_so = connect.upload_file(so_file, os.path.join(server_so_file_path, 'pg_prewarm.so'))
-                up_dblink_control = connect.upload_file(control_file, os.path.join(server_path, 'pg_prewarm.control'))
-                up_dblink_sql = connect.upload_file(pg_prewarm_sql, os.path.join(server_path, 'pg_prewarm--1.1.sql'))
-            print('SUCCESS: pg_prewarm.')
-            return
-        print('ERROR: Installation failed pg_prewarm.')
-        return
-
-
-class PluginInstallLocal():
-
-    def __init__(self, cpu, datadir, name):
-        self.cpu = cpu
-        self.datadir = datadir
-        self.system_name = name
-        if self.cpu:
-            tar_mogdb_plugin = client(f'cd {sys.path[0]}/static; tar -xf plugins-{self.system_name}-{self.cpu}-2.1.0.tar.gz')
-        self.gaussHome = os.getenv('GAUSSHOME')
-        mkdir_postgres = client(f'mkdir -p {self.gaussHome}/lib/postgresql/')
-        mkdir_share = client(f'mkdir -p {self.gaussHome}/share/postgresql/extension')
-        mkdir_share_doc = client(f'mkdir -p {self.gaussHome}/share/doc/postgresql/extension')
-        mkdir_contrib = client(f'mkdir -p {self.gaussHome}/share/postgresql/contrib')
-
-    def deploy_dblink(self):
-        if self.cpu:
-            so_file = client(f'cp {sys.path[0]}/static/plugins/dblink/dblink.so {self.gaussHome}/lib/postgresql/')
-            control = client(
-                f'cp {sys.path[0]}/static/plugins/dblink/dblink.control {self.gaussHome}/share/postgresql/extension/')
-            dblink_sql = client(f'cp {sys.path[0]}/static/plugins/dblink/dblink--1.0.sql {self.gaussHome}'
-                                f'/share/postgresql/extension/')
-            dblink_unpack_sql = client(f'cp {sys.path[0]}/static/plugins/dblink/dblink--unpackaged--1.0.sql'
-                                       f' {self.gaussHome}/share/postgresql/extension/')
-            print('SUCCESS: dblink.')
-            return
-        print('ERROR: Installation failed dblink.')
-        return
-
-    def deploy_pg_repack(self):
-        if self.cpu:
-            so_file = client(f'cp {sys.path[0]}/static/plugins/pg_repack/pg_repack.so {self.gaussHome}/lib/postgresql/')
-            control = client(f'cp {sys.path[0]}/static/plugins/pg_repack/pg_repack.control '
-                             f'{self.gaussHome}/share/postgresql/extension/')
-            pg_repack_file = client(f'cp {sys.path[0]}/static/plugins/pg_repack/pg_repack {self.gaussHome}/bin/')
-            pg_repack_sql = client(f'cp {sys.path[0]}/static/plugins/pg_repack/pg_repack--1.4.6.sql {self.gaussHome}'
-                                   f'/share/postgresql/extension/')
-            print('SUCCESS: pg_repack.')
-            return
-        print('ERROR: Installation failed pg_repack')
-        return
-
-    def deploy_wal2json(self):
-        if self.cpu:
-            so_file = client(f'cp {sys.path[0]}/static/plugins/wal2json/wal2json.so {self.gaussHome}/lib/postgresql/')
-            gs_ctl_restart = self.gaussHome + '/bin/gs_ctl -D ' + self.datadir + ' restart'
-            wal_level = self.gaussHome + '/bin/gs_guc set -D ' + self.datadir + ' -c \"wal_level = \'logical\'\"'
-            status, output = subprocess.getstatusoutput(wal_level)
-            if "Success to perform gs_guc!" in str(output):
-                pass
-            else:
-                print('Waining: postgresql.conf wal_level Failed to modify parameters. '
-                      'Please manually modify parameters')
-            status, output = subprocess.getstatusoutput(gs_ctl_restart)
-            if 'server started' in str(output):
-                pass
-            else:
-                print('The database fails to restart. Restart the database manually.')
-            print('SUCCESS: wal2json.')
-            return
-        print('ERROR: Installation failed wal2json.')
-        return
-
-    def deploy_pg_trgm(self):
-        if self.cpu:
-            so_file = client(f'cp {sys.path[0]}/static/plugins/pg_trgm/pg_trgm.so '
-                             f'{self.gaussHome}/lib/postgresql/')
-            control = client(f'cp {sys.path[0]}/static/plugins/pg_trgm/pg_trgm.control '
-                             f'{self.gaussHome}/share/postgresql/extension/')
-            pg_trgm_sql = client(f'cp {sys.path[0]}/static/plugins/pg_trgm/pg_trgm--1.0.sql '
-                                 f'{self.gaussHome}/share/postgresql/extension/')
-            pg_trgm__un_sql = client(f'cp {sys.path[0]}/static/plugins/pg_trgm/pg_trgm--unpackaged--1.0.sql '
-                                     f'{self.gaussHome}/share/postgresql/extension/')
-            print('SUCCESS: pg_trgm.')
-            return
-        print('ERROR: Installation failed pg_trgm.')
-        return
-
-    def deploy_orafce(self):
-        if self.cpu:
-            so_file = client(f'cp {sys.path[0]}/static/plugins/orafce/orafce.so {self.gaussHome}/lib/postgresql/')
-            control = client(f'cp {sys.path[0]}/static/plugins/orafce/orafce.control '
-                             f'{self.gaussHome}/share/postgresql/extension/')
-            orafce_sql = client(f'cp {sys.path[0]}/static/plugins/orafce/orafce--3.17.sql '
-                                f'{self.gaussHome}/share/postgresql/extension/')
-            print('SUCCESS: orafce.')
-            return
-        print('ERROR: Installation failed orafce.')
-        return
-
-    def deploy_pg_bulkload(self):
-        if self.cpu:
-            cp_pg_bulkload = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/pg_bulkload {self.gaussHome}/bin')
-            cp_postgresql = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/postgresql {self.gaussHome}/bin')
-            cp_so_file = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/pg_bulkload.so '
-                                f'{self.gaussHome}/lib/postgresql/')
-            cp_control_file = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/pg_bulkload.control '
-                                     f'{self.gaussHome}/share/postgresql/extension/')
-            cp_pg_bulkload_sql1 = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/pg_bulkload--1.0.sql '
-                                         f'{self.gaussHome}/share/postgresql/extension/')
-            cp_pg_bulkload_sql2 = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/pg_bulkload--unpackaged--1.0.sql '
-                                         f'{self.gaussHome}/share/postgresql/extension/')
-            cp_pg_bulkload_sql3 = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/uninstall_pg_bulkload.sql '
-                                         f'{self.gaussHome}/share/postgresql/extension/')
-            cp_pg_bulkload_sql4 = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/pg_bulkload.sql '
-                                         f'{self.gaussHome}/share/postgresql/extension/')
-            cp_pg_timestamp_so = client(
-                f'cp {sys.path[0]}/static/plugins/pg_bulkload/pg_timestamp.so {self.gaussHome}/lib/postgresql/')
-            cp_pg_timestamp_sql_file = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/uninstall_pg_timestamp.sql'
-                                              f' {self.gaussHome}/share/postgresql/contrib/')
-            cp_pg_timestamp_sql_file2 = client(f'cp {sys.path[0]}/static/plugins/pg_bulkload/pg_timestamp.sql'
-                                               f' {self.gaussHome}/share/postgresql/contrib/')
-            print('SUCCESS: pg_bulkload.')
-            return
-        print('ERROR: Installation failed pg_bulkload.')
-        return
-
-    def deploy_pg_prewarm(self):
-        if self.cpu:
-            so_file = sys.path[0] + '/static/plugins/pg_prewarm/pg_prewarm.so'
-            control_file = sys.path[0] + '/static/plugins/pg_prewarm/pg_prewarm.control'
-            pg_prewarm_sql = sys.path[0] + '/static/plugins/pg_prewarm/pg_prewarm--1.1.sql'
-            cp_dblink_so = client(f'cp {sys.path[0]}/static/plugins/pg_prewarm/pg_prewarm.so '
-                                  f'{self.gaussHome}/lib/postgresql/')
-            cp_dblink_control = client(f'cp {sys.path[0]}/static/plugins/pg_prewarm/pg_prewarm.control '
-                                       f'{self.gaussHome}/share/postgresql/extension/')
-            cp_dblink_sql = client(f'cp {sys.path[0]}/static/plugins/pg_prewarm/pg_prewarm--1.1.sql '
-                                   f'{self.gaussHome}/share/postgresql/extension/')
-            print('SUCCESS: pg_prewarm.')
-            return
-        print('ERROR: Installation failed pg_prewarm.')
-        return
