环境
主备库 |
云环境规格 |
操作系统 |
主机名 |
IP地址 |
端口号 |
主库 |
4vCPUs 8G |
EulerOS 2.8 64bit with ARM |
THR102-0001 |
192.168.0.164 |
1888 |
备库 |
4vCPUs 8G |
EulerOS 2.8 64bit with ARM |
THR102-0002 |
192.168.0.231 |
1888 |
主备机分别完成以下操作
groupadd dbgrp
useradd -g dbgrp -d /home/omm -m -s /bin/bash omm
passwd omm
mkdir -p /opt/software/gaussdb
GaussDB_T_1.0.2-EULER20SP8-ARM-64bit.tar.gz
主机操作
[root@thr102-0001 ~]# cd /opt/software/gaussdb/
[root@thr102-0001 gaussdb]# ls
GaussDB_T_1.0.2-EULER20SP8-ARM-64bit.tar.gz
[root@thr102-0001 gaussdb]# tar -zxvf GaussDB_T_1.0.2-EULER20SP8-ARM-64bit.tar.gz
[root@thr102-0001 gaussdb]# tar -zxvf GaussDB_T_1.0.2-DATABASE-EULER20SP8-64bit.tar.gz
[root@thr102-0001 gaussdb]# cd GaussDB_T_1.0.2-DATABASE-EULER20SP8-64bit/
[root@thr102-0001 GaussDB_T_1.0.2-DATABASE-EULER20SP8-64bit]# python install.py -U omm:dbgrp -R /opt/gaussdb/app -D /opt/gaussdb/data -C LSNR_ADDR=127.0.0.1,192.168.0.164 -C LSNR_PORT=1888 -C REPL_PORT=1889 -C "LOG_ARCHIVE_DEST_2=SERVICE=192.168.0.231:1889 SYNC"
# 输出信息
Checking runner.
Checking parameters.
End check parameters.
Checking user.
End check user.
Checking old install.
End check old install.
Checking kernel parameters.
Checking directory.
Checking integrality of run file...
Decompressing run file.
Setting user env.
Checking data dir and config file
Initialize db instance.
Creating database.
Creating database succeed.
Changing file permission due to security audit.
Install successfully, for more detail information see /home/omm/zengineinstall.log.
[root@thr102-0001 GaussDB_T_1.0.2-DATABASE-EULER20SP8-64bit]# cd
[root@thr102-0001 ~]# su - omm
Last login: Mon Mar 23 18:44:52 CST 2020
[omm@thr102-0001 ~]$ zsql / as sysdba -q
connected.
SQL> select database_role from dv_database;
DATABASE_ROLE
------------------------------
PRIMARY
1 rows fetched.
备机操作
[root@thr102-0002 ~]# cd /opt/software/gaussdb/
[root@thr102-0002 gaussdb]# ls
GaussDB_T_1.0.2-EULER20SP8-ARM-64bit.tar.gz
[root@thr102-0002 gaussdb]# tar -zxvf GaussDB_T_1.0.2-EULER20SP8-ARM-64bit.tar.gz
[root@thr102-0002 gaussdb]# tar -zxvf GaussDB_T_1.0.2-DATABASE-EULER20SP8-64bit.tar.gz
[root@thr102-0002 gaussdb]# cd GaussDB_T_1.0.2-DATABASE-EULER20SP8-64bit/
[root@thr102-0002 GaussDB_T_1.0.2-DATABASE-EULER20SP8-64bit]# python install.py -U omm:dbgrp -R /opt/gaussdb/app -D /opt/gaussdb/data -C LSNR_ADDR=127.0.0.1,192.168.0.231 -C LSNR_PORT=1888 -C REPL_PORT=1889 -C "LOG_ARCHIVE_DEST_2=SERVICE=192.168.0.164:1889 SYNC" -O
# 输出信息
Checking runner.
Checking parameters.
End check parameters.
Checking user.
End check user.
Checking old install.
End check old install.
Checking kernel parameters.
Checking directory.
Checking integrality of run file...
Decompressing run file.
Setting user env.
Checking data dir and config file
Initialize db instance.
Changing file permission due to security audit.
Install successfully, for more detail information see /home/omm/zengineinstall.log.
[root@thr102-0002 GaussDB_T_1.0.2-DATABASE-EULER20SP8-64bit]# su - omm
[omm@thr102-0002 ~]$ cd /opt/gaussdb/app/bin/
[omm@thr102-0002 bin]$ python zctl.py -t build
# 输出信息
Check if incremental build is available ...
Begin to shutdown database ...
Done
Begin to clear data and log ...
Done
Begin to startup instance nomount ...
Done
Is incremental build: False
Begin to build database ...
Done
Successfully build database
[omm@thr102-0002 bin]$ zsql / as sysdba -q
connected.
SQL> select database_role from dv_database;
DATABASE_ROLE
------------------------------
PHYSICAL_STANDBY
1 rows fetched.
同步验证
SQL> create table henry(id number);
Succeed.
SQL> insert into henry values(1);
1 rows affected.
SQL> commit;
Succeed.
SQL> select * from henry;
ID
----------------------------------------
1
1 rows fetched.
SQL> select * from henry;
ID
----------------------------------------
1
1 rows fetched.