首页 > 数据库 > > 数据库管理工具-gs_install
数据库的部署是一个复杂的过程,分布式数据库的安装和部署更是复杂。GaussDB 100提供了gs_install工具来帮助完成集群的安装和部署。
集群安装部署,要求用户指定配置文件,配置文件中会指定程序安装路径、实例数据目录、主备关系、实例数、各实例的业务IP端口等信息。
gs_install -X XMLFILE [--autostart=yes|no] [-f SQLFILE] [-l LOGFILE] [--dngucfile=DNFILE] [--coogucfile=CNFILE] [--gtsgucfile=GTSFILE]gs_install { -? | --help }显示版本号信息
gs_install { -V | --version }参数说明
集群配置文件的路径。
取值范围:clusterconfig.xml的文件路径。

执行gs_install脚本时,必须输入参数-X,后面跟安装集群的配置文件。
指定安装日志文件及日志文件存放的路径。
当既不明确指定-l,又不在XML文件中配置gaussdbLogPath时,默认值为“$GAUSSLOG/om/gs_install.log”;
当不明确指定-l,但在XML文件中配置了gaussdbLogPath时,默认值为“gaussdbLogPath的值、用户名和om/gs_install.log”的组合。
指定集群配置完成后是否启动。
指定DN内核参数文件,其格式为:parameter = value,具体参数参考实例。
指定CN内核参数文件,其格式为:parameter = value,具体参数参考实例。
指定GTS内核参数文件,其格式为:parameter = value,具体参数参考实例。
指定自定义的建库sql文件。
可解压当前安装包获取建库sql文件后修改参数,文件路径为/opt/software/gaussdb/GaussDB_100_1.0.1-DATABASE-EULER20SP8-64bit/GaussDB_100_1.0.1-RUN-EULER20SP8-64bit/admin/scripts/create_database.sample.sql,其中,/opt/software/gaussdb 为一个用户可访问的安装包的存放路径,并且用户需要对create_database.sample.sql有读权限。也可自己创建一个sql文件,复制如下建库模版后修改参数:
CREATE DATABASE gauss CHARACTER SET binary CONTROLFILE
('?/data/cntl1',
'?/data/cntl2',
'?/data/cntl3')
LOGFILE
('?/data/log1' size 2G,
'?/data/log2' size 2G,
'?/data/log3' size 2G,
'?/data/log4' size 2G,
'?/data/log5' size 2G,
'?/data/log6' size 2G)
SYSTEM TABLESPACE DATAFILE
'?/data/system' size 1G
UNDO TABLESPACE DATAFILE
'?/data/undo' size 1G
DEFAULT TABLESPACE DATAFILE
'?/data/user1' size 1G autoextend on next 32M,
'?/data/user2' size 1G autoextend on next 32M,
'?/data/user3' size 1G autoextend on next 32M,
'?/data/user4' size 1G autoextend on next 32M,
'?/data/user5' size 1G autoextend on next 32M
TEMPORARY TABLESPACE TEMPFILE
'?/data/temp1' size 160M autoextend on next 32M,
'?/data/temp2' size 160M autoextend on next 32M
NOLOGGING TABLESPACE TEMPFILE
'?/data/temp2_01' size 160M autoextend on next 32M
NOLOGGING UNDO TABLESPACE TEMPFILE
'?/data/temp2_undo' size 160M autoextend on next 32M
ARCHIVELOG;
显示帮助信息。
显示版本号信息。
使用gs_install安装集群。
omm@plat1:/opt/software/gaussdb/script> gs_install -X /opt/software/gaussdb/ClusterConfig.xml
Parsing the configuration file.
Check preinstall on every node.
Successfully checked preinstall on every node.
Creating the backup directory.
Successfully created the backup directory.
Check the time difference between hosts in the cluster.
Installing the cluster.
Installing applications on all nodes.
Successfully installed APP.
Distribute etcd communication keys.
Successfully distrbute etcd communication keys.
Initializing cluster instances
....144s
Initializing cluster instances is completed.
Configuring standby datanode.
.....65s
Successfully configure datanode.
Cluster installation is completed.
Configuring.
Load cluster configuration file.
Configuring the cluster.
Successfully configuring the cluster.
Configuration is completed.
Start cm agent.
Successfully start cm agent and ETCD in cluster.
Starting the cluster.
==============================================
...........11s
Successfully starting the cluster.
==============================================
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69959250/viewspace-3127238/ ,如需转载,请注明出处,否则将追究法律责任。