体验openGauss 5.0极简版一主一备部署,延时回放和主备切换功能

2023年 8月 15日 71.0k 0

三人禾 [openGauss](javascript:void(0)😉 2023-07-29 17:58 发表于四川

收录于合集#第六届openGauss技术文章征集初审合格文章62个

概要

openGauss的安装在官方文档的描述中,以企业生产环境为标准进行安装部署较为详细。但在个人基本的功能测试需求下,这样的安装操作显得有些复杂。

极简版安装的使用主体主要针对高校和个人测试环境,相对企业安装流程更简单快捷,更加适合高校学生或者个人功能测试的场景,该软件包中并不包含OM工具,采用脚本可以实现一键式安装部署一主一备节点。

默认情况下,openGauss备机会尽快恢复来自于主机的XLOG记录。这个功能允许备机将回放延时一段指定的时间后进行回放。提供一份可查询一段时间之前的数据副本,可以更方便的纠正用户误操作等错误。

openGauss支持备机延时回放,本文通过使用极简版进行一主一备安装部署,体验延时回放及主备切换功能。希望通过基本的操作示例对大家能有所帮助。

安装准备

前提条件:

  • 获取openGauss极简版安装包
  • 创建用户组和普通用户
  • 普通用户必须有数据库包解压路径、安装路径的读、写和执行操作权限,并且安装路径必须为空。
  • 普通用户对下载的openGauss压缩包有执行权限。
  • 安装前请检查指定的openGauss端口矩阵中所有端口是否被占用,如果被占用请更改端口或者停止当前使用端口进程。

获取安装包

从openGauss开源社区下载对应平台的安装包,选择极简版安装包(不安装OM等组件)。

准备软硬件安装环境

我们使用x86_64平台的CentOS 7.6操作系统,CPU:2核3.0GHz,内存:16GB,硬盘空间:300GB

软件依赖要求

openGauss的软件依赖要求如表1 软件依赖要求所示。

表1 软件依赖要求

所需软件 建议版本
libaio-devel 建议版本:0.3.109-13
flex 要求版本:2.5.31 以上
bison 建议版本:2.7-4
ncurses-devel 建议版本:5.9-13.20130511
glibc-devel 建议版本:2.17-111
patch 建议版本:2.7.1-10
redhat-lsb-core 建议版本:4.1
readline-devel 建议版本:7.0-13
libnsl(openEuler+x86环境中) 建议版本:2.28-36

使用操作系统ISO源中,下列依赖软件的默认安装包,若不存在下列软件,可参看软件对应的建议版本。

# mount -o loop /mnt/OS/Linux/CentOS/CentOS-7-x86_64-Everything-1810.iso /media/
# vi /etc/yum.repos.d/iso.repo
---添加如下内容:
[iso]
name=iso
baseurl=file:///media
enable=1
gpgcheck=0

# yum makecache

# yum install -y libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel

修改操作系统配置

---关闭防火墙
# systemctl stop firewalld
# systemctl disable firewalld

---永久关闭SELinux
# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux

---配置文件系统描述符
# echo "* soft nofile 1000000" >>/etc/security/limits.conf
# echo "* hard nofile 1000000" >>/etc/security/limits.conf

---重启生效
# reboot

创建组和用户

# groupadd dbgroup
# useradd -g dbgroup omm
# passwd omm

解压安装包

解压安装包,检查安装目录及文件是否齐全。在安装包所在目录执行以下命令:

# cd /opt
# mkdir openGaussSimp
# chown -R omm:dbgroup openGauss
$ tar -jxf /stage/openGauss-5.0.0-CentOS-64bit.tar.bz2 -C /opt/openGaussSimp/
$ ll /opt/openGaussSimp/
总用量 16
drwxr-xr-x. 2 omm dbgroup 4096 3月 29 03:20 bin
drwxr-xr-x. 3 omm dbgroup 22 3月 29 03:20 etc
drwxr-xr-x. 3 omm dbgroup 24 3月 29 03:20 include
drwxr-xr-x. 4 omm dbgroup 95 3月 29 03:20 jre
drwxr-xr-x. 5 omm dbgroup 4096 3月 29 03:20 lib
drwxr-xr-x. 5 omm dbgroup 53 3月 29 03:20 share
drwxr-xr-x. 2 omm dbgroup 78 3月 29 03:20 simpleInstall
-rw-r--r--. 1 omm dbgroup 32 3月 29 03:20 version.cfg

一主一备节点安装部署

安装

$ cd /opt/openGauss/simpleInstall/
$ ll
总用量 56
-rw-r--r--. 1 omm dbgroup 10827 3月 29 03:20 finance.sql
-rw-r--r--. 1 omm dbgroup 13009 3月 29 03:20 install.sh
-rw-r--r--. 1 omm dbgroup 5056 3月 29 03:20 README.md
-rw-r--r--. 1 omm dbgroup 19713 3月 29 03:20 school.sql

$ sh install.sh -w password --multinode
[step 1]: check parameter
[step 2]: check install env and os setting
[step 3]: change_gausshome_owner
[step 4]: set environment variables

[init primary datanode.]
The files belonging to this database system will be owned by user "omm".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default text search configuration will be set to "english".

creating directory /opt/openGauss/data/master ... ok
creating subdirectories ... in ordinary occasionok
creating configuration files ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1024MB
Begin init undo subsystem meta.
[INIT UNDO] Init undo subsystem meta successfully.
creating template1 database in /opt/openGauss/data/master/base/1 ... The core dump path is an invalid directory
2023-07-20 16:55:31.270 [unknown] [unknown] localhost 139958306611456 0[0:0#0] [BACKEND] WARNING: macAddr is 55880/310234098, sysidentifier is 3662156413/3421696841, randomNum is 3743216457
ok
initializing pg_authid ... ok
setting password ... ok
initializing dependencies ... ok
loading PL/pgSQL server-side language ... ok
creating system views ... ok
creating performance views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
initialize global configure for bucketmap length ... ok
creating information schema ... ok
loading foreign-data wrapper for distfs access ... ok
loading foreign-data wrapper for log access ... ok
loading hstore extension ... ok
loading foreign-data wrapper for MOT access ... ok
loading security plugin ... ok
update system tables ... ok
creating snapshots catalog ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
freezing database template0 ... ok
freezing database template1 ... ok
freezing database postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run gs_initdb.

Success. You can now start the database server of single node using:

gaussdb -D /opt/openGauss/data/master --single_node

or
gs_ctl start -D /opt/openGauss/data/master -Z single_node -l logfile

[init slave datanode.]
The files belonging to this database system will be owned by user "omm".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default text search configuration will be set to "english".

creating directory /opt/openGauss/data/slave ... ok
creating subdirectories ... in ordinary occasionok
creating configuration files ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1024MB
Begin init undo subsystem meta.
[INIT UNDO] Init undo subsystem meta successfully.
creating template1 database in /opt/openGauss/data/slave/base/1 ... The core dump path is an invalid directory
2023-07-20 16:55:54.473 [unknown] [unknown] localhost 139719775543552 0[0:0#0] [BACKEND] WARNING: macAddr is 55880/310234098, sysidentifier is 3662156413/3421692616, randomNum is 2853364424
ok
initializing pg_authid ... ok
setting password ... ok
initializing dependencies ... ok
loading PL/pgSQL server-side language ... ok
creating system views ... ok
creating performance views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
initialize global configure for bucketmap length ... ok
creating information schema ... ok
loading foreign-data wrapper for distfs access ... ok
loading foreign-data wrapper for log access ... ok
loading hstore extension ... ok
loading foreign-data wrapper for MOT access ... ok
loading security plugin ... ok
update system tables ... ok
creating snapshots catalog ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
freezing database template0 ... ok
freezing database template1 ... ok
freezing database postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run gs_initdb.

Success. You can now start the database server of single node using:

gaussdb -D /opt/openGauss/data/slave --single_node

or
gs_ctl start -D /opt/openGauss/data/slave -Z single_node -l logfile

[config datanode.]
remote_read_mode = non_authentication
host all all 192.168.9.191/32 trust
[start primary datanode.]
[2023-07-20 16:56:17.641][15074][][gs_ctl]: gs_ctl started,datadir is /opt/openGauss/data/master
[2023-07-20 16:56:17.676][15074][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.

0 LOG: [Alarm Module]Host Name: L7DBMerge.base.online

0 LOG: [Alarm Module]Host IP: L7DBMerge.base.online. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain

0 LOG: [Alarm Module]Cluster Name: dbCluster

0 LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 57

0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
0 WARNING: failed to parse feature control file: gaussdb.version.
0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version.
The core dump path is an invalid directory
2023-07-20 16:56:17.745 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
gaussdb.state does not exist, and skipt setting since it is optional.2023-07-20 16:56:17.750 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.

2023-07-20 16:56:17.750 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host Name: L7DBMerge.base.online

2023-07-20 16:56:17.750 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host IP: L7DBMerge.base.online. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain

2023-07-20 16:56:17.750 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Cluster Name: dbCluster

2023-07-20 16:56:17.750 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 57

2023-07-20 16:56:17.765 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: loaded library "security_plugin"
2023-07-20 16:56:17.775 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2023-07-20 16:56:17.799 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2023-07-20 16:56:17.799 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: reserved memory for backend threads is: 220 MB
2023-07-20 16:56:17.799 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: reserved memory for WAL buffers is: 128 MB
2023-07-20 16:56:17.799 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: Set max backend reserve memory is: 348 MB, max dynamic memory is: 8143 MB
2023-07-20 16:56:17.799 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: shared memory 3284 Mbytes, memory context 8491 Mbytes, max process memory 12288 Mbytes
2023-07-20 16:56:17.799 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: shared memory that key is 5432001 is owned by pid 1786
2023-07-20 16:56:17.849 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [CACHE] LOG: set data cache size(402653184)
2023-07-20 16:56:17.873 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [SEGMENT_PAGE] LOG: Segment-page constants: DF_MAP_SIZE: 8156, DF_MAP_BIT_CNT: 65248, DF_MAP_GROUP_EXTENTS: 4175872, IPBLOCK_SIZE: 8168, EXTENTS_PER_IPBLOCK: 1021, IPBLOCK_GROUP_SIZE: 4090, BMT_HEADER_LEVEL0_TOTAL_PAGES: 8323072, BktMapEntryNumberPerBlock: 2038, BktMapBlockNumber: 25, BktBitMaxMapCnt: 512
2023-07-20 16:56:17.889 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: gaussdb: fsync file "/opt/openGauss/data/master/gaussdb.state.temp" success
2023-07-20 16:56:17.890 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: create gaussdb state file success: db state(STARTING_STATE), server mode(Primary), connection index(1)
2023-07-20 16:56:17.912 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: max_safe_fds = 974, usable_fds = 1000, already_open = 16
The core dump path is an invalid directory
2023-07-20 16:56:17.914 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: user configure file is not found, it will be created.
2023-07-20 16:56:17.918 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: the configure file /opt/openGauss/etc/gscgroup_omm.cfg doesn't exist or the size of configure file has changed. Please create it by root user!
2023-07-20 16:56:17.918 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [BACKEND] LOG: Failed to parse cgroup config file.
2023-07-20 16:56:17.926 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2023-07-20 16:56:17.926 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2023-07-20 16:56:17.926 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2023-07-20 16:56:17.926 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
2023-07-20 16:56:17.927 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2023-07-20 16:56:17.927 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2023-07-20 16:56:17.927 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2023-07-20 16:56:17.927 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
2023-07-20 16:56:17.927 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2023-07-20 16:56:17.927 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2023-07-20 16:56:17.927 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2023-07-20 16:56:17.927 [unknown] [unknown] localhost 139830592221440 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.

[2023-07-20 16:56:18.681][15074][][gs_ctl]: done
[2023-07-20 16:56:18.681][15074][][gs_ctl]: server started (/opt/openGauss/data/master)
[build and start slave datanode.]
[2023-07-20 16:56:18.691][15146][][gs_ctl]: gs_ctl full build ,datadir is /opt/openGauss/data/slave
[2023-07-20 16:56:18.691][15146][][gs_ctl]: fopen build pid file "/opt/openGauss/data/slave/gs_build.pid" success
[2023-07-20 16:56:18.691][15146][][gs_ctl]: fprintf build pid file "/opt/openGauss/data/slave/gs_build.pid" success
[2023-07-20 16:56:18.694][15146][][gs_ctl]: fsync build pid file "/opt/openGauss/data/slave/gs_build.pid" success
[2023-07-20 16:56:18.694][15146][][gs_ctl]: stop failed, killing gaussdb by force ...
[2023-07-20 16:56:18.694][15146][][gs_ctl]: command [ps c -eo pid,euid,cmd | grep gaussdb | grep -v grep | awk '{if($2 == curuid && $1!="-n") print "/proc/"$1"/cwd"}' curuid=`id -u`| xargs ls -l | awk '{if ($NF=="/opt/openGauss/data/slave") print $(NF-2)}' | awk -F/ '{print $3 }' | xargs kill -9 >/dev/null 2>&1 ] path: [/opt/openGauss/data/slave]
[2023-07-20 16:56:18.712][15146][][gs_ctl]: server stopped
[2023-07-20 16:56:18.712][15146][][gs_ctl]: current workdir is (/opt/openGauss/simpleInstall).
[2023-07-20 16:56:18.713][15146][][gs_ctl]: set gaussdb state file when full build build:db state(BUILDING_STATE), server mode(STANDBY_MODE), build mode(FULL_BUILD).
[2023-07-20 16:56:18.713][15146][datanode2][gs_ctl]: Get repl_auth_mode is and repl_uuid is
[2023-07-20 16:56:18.717][15146][datanode2][gs_ctl]: build try host(192.168.9.191) port(5433) success
[2023-07-20 16:56:18.717][15146][datanode2][gs_ctl]: connected to server success, build started.
[2023-07-20 16:56:18.752][15146][datanode2][gs_ctl]: clear old target dir success
[2023-07-20 16:56:18.752][15146][datanode2][gs_ctl]: create build tag file success
[2023-07-20 16:56:18.752][15146][datanode2][gs_ctl]: create build tag file again success
[2023-07-20 16:56:18.752][15146][datanode2][gs_ctl]: get system identifier success
[2023-07-20 16:56:18.771][15146][datanode2][gs_ctl]: receiving and unpacking files...
[2023-07-20 16:56:18.771][15146][datanode2][gs_ctl]: create backup label success
INFO: The starting position of the xlog copy of the full build is: 0/2434A60. The slot minimum LSN is: 0/0. The disaster slot minimum LSN is: 0/0. The logical slot minimum LSN is: 0/0.
[2023-07-20 16:56:18.969][15146][datanode2][gs_ctl]: xlog start point: 0/2434A60
[2023-07-20 16:56:18.969][15146][datanode2][gs_ctl]: begin build tablespace list
[2023-07-20 16:56:18.969][15146][datanode2][gs_ctl]: finish build tablespace list
[2023-07-20 16:56:18.969][15146][datanode2][gs_ctl]: begin get xlog by xlogstream
[2023-07-20 16:56:18.969][15146][datanode2][gs_ctl]: starting background WAL receiver
[2023-07-20 16:56:18.969][15146][datanode2][gs_ctl]: starting walreceiver
[2023-07-20 16:56:18.970][15146][datanode2][gs_ctl]: begin receive tar files
[2023-07-20 16:56:18.970][15146][datanode2][gs_ctl]: receiving and unpacking files...
[2023-07-20 16:56:18.975][15146][datanode2][gs_ctl]: build try host(192.168.9.191) port(5433) success
[2023-07-20 16:56:18.975][15146][datanode2][gs_ctl]: check identify system success
[2023-07-20 16:56:18.983][15146][datanode2][gs_ctl]: send START_REPLICATION 0/2000000 success
[2023-07-20 16:56:19.645][15146][datanode2][gs_ctl]: finish receive tar files
[2023-07-20 16:56:19.645][15146][datanode2][gs_ctl]: xlog end point: 0/3000058
[2023-07-20 16:56:19.646][15146][datanode2][gs_ctl]: fetching MOT checkpoint
gs_ctl: no mot checkpoint exists
[2023-07-20 16:56:19.646][15146][datanode2][gs_ctl]: waiting for background process to finish streaming...
[2023-07-20 16:56:24.005][15146][datanode2][gs_ctl]: starting fsync all files come from source.
[2023-07-20 16:56:37.583][15146][datanode2][gs_ctl]: finish fsync all files.
[2023-07-20 16:56:37.594][15146][datanode2][gs_ctl]: build dummy dw file success
[2023-07-20 16:56:37.594][15146][datanode2][gs_ctl]: rename build status file success
[2023-07-20 16:56:37.596][15146][datanode2][gs_ctl]: full build build completed(/opt/openGauss/data/slave).
[2023-07-20 16:56:37.629][15146][datanode2][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.

0 LOG: [Alarm Module]Host Name: L7DBMerge.base.online

0 LOG: [Alarm Module]Host IP: L7DBMerge.base.online. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain

0 LOG: [Alarm Module]Cluster Name: dbCluster

0 LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 57

0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
0 WARNING: failed to parse feature control file: gaussdb.version.
0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version.
The core dump path is an invalid directory
2023-07-20 16:56:37.699 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
2023-07-20 16:56:37.706 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.

2023-07-20 16:56:37.706 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host Name: L7DBMerge.base.online

2023-07-20 16:56:37.706 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Host IP: L7DBMerge.base.online. Copy hostname directly in case of taking 10s to use 'gethostbyname' when /etc/hosts does not contain

2023-07-20 16:56:37.706 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Cluster Name: dbCluster

2023-07-20 16:56:37.706 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 57

2023-07-20 16:56:37.722 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: loaded library "security_plugin"
2023-07-20 16:56:37.731 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2023-07-20 16:56:37.766 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2023-07-20 16:56:37.766 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: reserved memory for backend threads is: 220 MB
2023-07-20 16:56:37.766 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: reserved memory for WAL buffers is: 128 MB
2023-07-20 16:56:37.766 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: Set max backend reserve memory is: 348 MB, max dynamic memory is: 8143 MB
2023-07-20 16:56:37.766 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: shared memory 3284 Mbytes, memory context 8491 Mbytes, max process memory 12288 Mbytes
2023-07-20 16:56:37.766 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: shared memory that key is 5632001 is owned by pid 1894
2023-07-20 16:56:37.822 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [CACHE] LOG: set data cache size(402653184)
2023-07-20 16:56:37.848 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [SEGMENT_PAGE] LOG: Segment-page constants: DF_MAP_SIZE: 8156, DF_MAP_BIT_CNT: 65248, DF_MAP_GROUP_EXTENTS: 4175872, IPBLOCK_SIZE: 8168, EXTENTS_PER_IPBLOCK: 1021, IPBLOCK_GROUP_SIZE: 4090, BMT_HEADER_LEVEL0_TOTAL_PAGES: 8323072, BktMapEntryNumberPerBlock: 2038, BktMapBlockNumber: 25, BktBitMaxMapCnt: 512
2023-07-20 16:56:37.874 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: gaussdb: fsync file "/opt/openGauss/data/slave/gaussdb.state.temp" success
2023-07-20 16:56:37.874 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: create gaussdb state file success: db state(STARTING_STATE), server mode(Standby), connection index(1)
2023-07-20 16:56:37.897 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: max_safe_fds = 972, usable_fds = 1000, already_open = 18
The core dump path is an invalid directory
2023-07-20 16:56:37.899 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: the configure file /opt/openGauss/etc/gscgroup_omm.cfg doesn't exist or the size of configure file has changed. Please create it by root user!
2023-07-20 16:56:37.899 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [BACKEND] LOG: Failed to parse cgroup config file.
2023-07-20 16:56:37.912 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2023-07-20 16:56:37.912 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2023-07-20 16:56:37.912 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2023-07-20 16:56:37.912 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
2023-07-20 16:56:37.913 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2023-07-20 16:56:37.913 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2023-07-20 16:56:37.913 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2023-07-20 16:56:37.913 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
2023-07-20 16:56:37.913 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] WARNING: Failed to obtain environment value $GAUSSLOG!
2023-07-20 16:56:37.913 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] DETAIL: N/A
2023-07-20 16:56:37.913 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] CAUSE: Incorrect environment value.
2023-07-20 16:56:37.913 [unknown] [unknown] localhost 140210215690496 0[0:0#0] 0 [EXECUTOR] ACTION: Please refer to backend log for more details.
.................
[2023-07-20 16:56:55.660][15146][datanode2][gs_ctl]: done
[2023-07-20 16:56:55.660][15146][datanode2][gs_ctl]: server started (/opt/openGauss/data/slave)
[2023-07-20 16:56:55.660][15146][datanode2][gs_ctl]: fopen build pid file "/opt/openGauss/data/slave/gs_build.pid" success
[2023-07-20 16:56:55.660][15146][datanode2][gs_ctl]: fprintf build pid file "/opt/openGauss/data/slave/gs_build.pid" success
[2023-07-20 16:56:55.727][15146][datanode2][gs_ctl]: fsync build pid file "/opt/openGauss/data/slave/gs_build.pid" success
import sql file
Would you like to create a demo database (yes/no)? yes
Load demoDB [school,finance] success.
[complete successfully]: You can start or stop the database server using:
primary: gs_ctl start|stop|restart -D $GAUSSHOME/data/master -M primary
standby: gs_ctl start|stop|restart -D $GAUSSHOME/data/slave -M standby

安装后检查

安装执行完成后,使用ps和gs_ctl查看进程是否正常。

$ ps ux | grep gaussdb
omm 15077 1.7 8.2 6124380 675456 ? Ssl 16:56 0:02 /opt/openGauss/bin/gaussdb -D /opt/openGauss/data/master -M primary
omm 15173 2.0 5.4 6345480 444352 ? Ssl 16:56 0:02 /opt/openGauss/bin/gaussdb -D /opt/openGauss/data/slave -M standby
$ gs_ctl query -D /opt/openGaussSimp/data/master/
[2023-07-24 17:31:43.810][17978][][gs_ctl]: gs_ctl query ,datadir is /opt/openGauss/data/master
HA state:
local_role : Primary
static_connections : 1
db_state : Normal
detail_information : Normal

Senders info:
sender_pid : 15236
local_role : Primary
peer_role : Standby
peer_state : Normal
state : Streaming
sender_sent_location : 0/403E448
sender_write_location : 0/403E448
sender_flush_location : 0/403E448
sender_replay_location : 0/403E448
receiver_received_location : 0/403E448
receiver_write_location : 0/403E448
receiver_flush_location : 0/403E448
receiver_replay_location : 0/403E448
sync_percent : 100%
sync_state : Sync
sync_priority : 1
sync_most_available : Off
channel : 192.168.9.191:5433-->192.168.9.191:43042

Receiver info:
No information

[omm@L7DBMerge ~]$ gs_ctl query -D /opt/openGaussSimp/data/slave/
[2023-07-24 17:33:08.807][18087][][gs_ctl]: gs_ctl query ,datadir is /opt/openGauss/data/slave
HA state:
local_role : Standby
static_connections : 1
db_state : Normal
detail_information : Normal

Senders info:
No information
Receiver info:
receiver_pid : 15235
local_role : Standby
peer_role : Primary
peer_state : Normal
state : Normal
sender_sent_location : 0/403E568
sender_write_location : 0/403E568
sender_flush_location : 0/403E568
sender_replay_location : 0/403E568
receiver_received_location : 0/403E568
receiver_write_location : 0/403E568
receiver_flush_location : 0/403E568
receiver_replay_location : 0/403E568
sync_percent : 100%
channel : 192.168.9.191:43042192.168.9.191:39950

Receiver info:
No information
---查看原备节点已成为主节点

$ gs_ctl query -D /opt/openGaussSimp/data/master/
[2023-07-25 10:27:09.177][13064][][gs_ctl]: gs_ctl query ,datadir is /opt/openGaussSimp/data/master
HA state:
local_role : Standby
static_connections : 1
db_state : Normal
detail_information : Normal

Senders info:
No information
Receiver info:
receiver_pid : 13049
local_role : Standby
peer_role : Primary
peer_state : Normal
state : Normal
sender_sent_location : 0/5F15DC8
sender_write_location : 0/5F15DC8
sender_flush_location : 0/5F15DC8
sender_replay_location : 0/5F15DC8
receiver_received_location : 0/5F15DC8
receiver_write_location : 0/5F15DC8
receiver_flush_location : 0/5F15DC8
receiver_replay_location : 0/5F15DC8
sync_percent : 100%
channel : 192.168.9.191:39950192.168.9.191:50220

Receiver info:
No information

$ gs_ctl query -D /opt/openGaussSimp/data/slave/
[2023-07-25 10:33:13.628][13580][][gs_ctl]: gs_ctl query ,datadir is /opt/openGaussSimp/data/slave
HA state:
local_role : Standby
static_connections : 1
db_state : Normal
detail_information : Normal

Senders info:
No information
Receiver info:
receiver_pid : 13560
local_role : Standby
peer_role : Primary
peer_state : Normal
state : Normal
sender_sent_location : 0/5F18120
sender_write_location : 0/5F18120
sender_flush_location : 0/5F18120
sender_replay_location : 0/5F18120
receiver_received_location : 0/5F18120
receiver_write_location : 0/5F18120
receiver_flush_location : 0/5F18120
receiver_replay_location : 0/5F18120
sync_percent : 100%
channel : 192.168.9.191:50220

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论