2

openeuler安装opengauss3.0.0 一主一从一级联备(各种踩雷) -m6米乐安卓版下载

原创 云和恩墨 2022-05-24
3451

openeuler安装opengauss3.0.0 一主一从一级联备

一、环境配置

1、hosts
172.16.220.141 op01
172.16.220.142 op02
172.16.220.143 op03

可以不做,preinstall会自动添加

2、防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
3、selinux
sed -i 's/^selinux=.*/selinux=disabled/' /etc/selinux/config
setenforce 0
4、字符集
cat>> /etc/profile<
5、时区
rm -fr /etc/localtime
ln -s /usr/share/zoneinfo/asia/shanghai  /etc/localtime
date -r
hwclock
6、交换内存
swapoff -a
cp /etc/fstab /etc/fstab.bak
sed -i '/swap/s/^/#/' /etc/fstab
cat /etc/fstab|grep -v ^#|grep -v '^$'
7、mtu
ifconfig ens33 mtu 1500
8、removeipc
sed -i '/^removeipc/d' /etc/systemd/logind.conf
sed -i '/^removeipc/d' /usr/lib/systemd/system/systemd-logind.service
echo "removeipc=no"  >> /etc/systemd/logind.conf
echo "removeipc=no"  >> /usr/lib/systemd/system/systemd-logind.service
systemctl daemon-reload
systemctl restart systemd-logind
9、root远程登录
sed -i '/banner/s/^/#/' /etc/ssh/sshd_config
sed -i '/permitrootlogin/s/^/#/' /etc/ssh/sshd_config
echo -e "\n" >> /etc/ssh/sshd_config
echo "banner none " >> /etc/ssh/sshd_config
echo "permitrootlogin yes" >> /etc/ssh/sshd_config
10、内核参数
cat >> /etc/sysctl.conf << eof
net.ipv4.tcp_max_tw_buckets = 10000
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_probes = 9
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_retries1 = 5
net.ipv4.tcp_syn_retries = 5
net.ipv4.tcp_synack_retries = 5
net.sctp.path_max_retrans = 10
net.sctp.max_init_retransmits = 10
net.sctp.association_max_retrans = 10
net.sctp.hb_interval = 30000
net.ipv4.tcp_retries2 = 12
vm.overcommit_memory = 0
net.sctp.sndbuf_policy = 0
net.sctp.rcvbuf_policy = 0
net.sctp.sctp_mem = 94500000 915000000 927000000
net.sctp.sctp_rmem = 8192 250000 16777216
net.sctp.sctp_wmem = 8192 250000 16777216
net.ipv4.tcp_rmem = 8192 250000 16777216
net.ipv4.tcp_wmem = 8192 250000 16777216
net.core.wmem_max = 21299200
net.core.rmem_max = 21299200
net.core.wmem_default = 21299200
net.core.rmem_default = 21299200
net.ipv4.ip_local_port_range = 26000 65535
kernel.sem = 250 6400000 1000 25600
vm.min_free_kbytes = 419430 ##suggest to set as physical memory * 5%
net.core.somaxconn = 65535
net.ipv4.tcp_syncookies = 1
net.sctp.addip_enable = 0
net.core.netdev_max_backlog = 65535
net.ipv4.tcp_max_syn_backlog = 65535
net.ipv4.tcp_fin_timeout = 60
kernel.shmall = 1152921504606846720
kernel.shmmax = 18446744073709551615
net.ipv4.tcp_sack = 1
net.ipv4.tcp_timestamps = 1
vm.extfrag_threshold = 500
vm.overcommit_ratio = 90
net.ipv4.ip_local_reserved_ports = 20050-20057,26000-26007
net.sctp.sctp_mem = 94500000 915000000 927000000
net.sctp.sctp_rmem = 8192 250000 16777216
net.sctp.sctp_wmem = 8192 250000 16777216
eof
sysctl -p

这玩意还是别配,交给preinstall吧

11、资源限制
echo "* soft stack 3072" >> /etc/security/limits.conf
echo "* hard stack 3072" >> /etc/security/limits.conf
echo "* soft nofile 1000000" >> /etc/security/limits.conf
echo "* hard nofile 1000000" >> /etc/security/limits.conf
echo "* soft nproc unlimited" >> /etc/security/limits.d/90-nproc.conf
tail -n 4 /etc/security/limits.conf
tail -n 1 /etc/security/limits.d/90-nproc.conf
12、透明页

此处使用openoular,不管了,玩过oracle都知道怎么搞,具体方法不同操作系统不同,看官方文档

13、root互信
ssh-keygen -t rsa --三台主机都执行
1、2主机均发送至3
scp .ssh/id_rsa.pub  op03:~/.ssh/pub-1
scp .ssh/id_rsa.pub  op03:~/.ssh/pub-2
3号主机整合
cat id_rsa.pub >> authorized_keys
cat pub-1 >> authorized_keys
cat pub-2 >> authorized_keys
3号主机发送至1、2
scp authorized_keys op01:~/.ssh/
scp authorized_keys op02:~/.ssh/
验证
ssh op02 date
ssh op03 date

preinstall会把这个互信都删掉,他提示会配置root互信,但是没有成功,配不配置没啥影响。反正都会被干掉。

14、本地yum源
mount /dev/cdrom /mnt
cd /etc/yum.repos.d
mkdir bk
mv *.repo bk/
echo "[el]" >> /etc/yum.repos.d/openeuler.repo
echo "name =linux 7.x dvd" >> /etc/yum.repos.d/openeuler.repo
echo "baseurl=file:///mnt" >> /etc/yum.repos.d/openeuler.repo
echo "gpgcheck=0" >> /etc/yum.repos.d/openeuler.repo
echo "enabled=1" >> /etc/yum.repos.d/openeuler.repo
cat /etc/yum.repos.d/openeuler.repo
mount /dev/cdrom /mnt
15、安装包
mkdir /soft
chmod 777 -r /soft/
tar -zxvf opengauss-3.0.0-openeuler-64bit-all.tar.gz 
tar -zxvf opengauss-3.0.0-openeuler-64bit-om.tar.gz

下载请确认所需的操作系统、操作系统对应的安装包。操作系统不要选择sp3,神坑

16、配置文件


    
    
        
        
        
        
        
        
        
        
    
    
    
        
        
            
            
            
            
            
            
            
            
                
                
            
        
        
        
            
            
            
            
            
            
        
        
        
            
            
            
            
            
            
            
        
    

二、安装

1、预安装
cd /opt/software/opengauss/script 
chmod -r 775 /soft/script 
chown -r omm:dbgroup /soft/script 
[root@op01 script]# ./gs_preinstall -u omm -g dbgroup -x my_cluster.xml 
parsing the configuration file.
successfully parsed the configuration file.
installing the tools on the local node.
successfully installed the tools on the local node.
are you sure you want to create trust for root (yes/no)?yes
please enter password for root
password: 
successfully created ssh trust for the root permission user.
setting host ip env
successfully set host ip env.
distributing package.
begin to distribute package to tool path.
successfully distribute package to tool path.
begin to distribute package to package path.
successfully distribute package to package path.
successfully distributed package.
are you sure you want to create the user[omm] and create trust for it (yes/no)? yes
please enter password for cluster user.
password: 
please enter password for cluster user again.
password: 
generate cluster user password files successfully.
successfully created [omm] user on all nodes.
preparing ssh service.
successfully prepared ssh service.
installing the tools in the cluster.
successfully installed the tools in the cluster.
checking hostname mapping.
successfully checked hostname mapping.
creating ssh trust for [omm] user.
please enter password for current user[omm].
password: 
checking network information.
all nodes in the network are normal.
successfully checked network information.
creating ssh trust.
creating the local key file.
successfully created the local key files.
appending local id to authorized_keys.
successfully appended local id to authorized_keys.
updating the known_hosts file.
successfully updated the known_hosts file.
appending authorized_key on the remote node.
successfully appended authorized_key on all remote node.
checking common authentication file content.
successfully checked common authentication content.
distributing ssh trust file to all node.
distributing trust keys file to all node successfully.
successfully distributed ssh trust file to all node.
verifying ssh trust on all hosts.
successfully verified ssh trust on all hosts.
successfully created ssh trust.
successfully created ssh trust for [omm] user.
checking os software.
successfully check os software.
checking os version.
successfully checked os version.
creating cluster's path.
successfully created cluster's path.
set and check os parameter.
setting os parameters.
successfully set os parameters.
warning: installation environment contains some warning messages.
please get more details by "/soft/script/gs_checkos -i a -h op01,op02,op03 --detail".
set and check os parameter completed.
preparing cron service.
successfully prepared cron service.
setting user environmental variables.
successfully set user environmental variables.
setting the dynamic link library.
successfully set the dynamic link library.
setting core file
successfully set core path.
setting pssh path
successfully set pssh path.
setting cgroup.
successfully set cgroup.
set arm optimization.
no need to set arm optimization.
fixing server package owner.
setting finish flag.
successfully set finish flag.
preinstallation succeeded.
2、os检查
./gs_checkos -i a -h op01,op02,op03 --detail 

这玩意弹出的提示让输入几个节点root密码或者yes、no,挺乱,反正我没搞明白,忽略

3、安装
[omm@op01 script]$ ./gs_install -x my_cluster.xml 
parsing the configuration file.
check preinstall on every node.
successfully checked preinstall on every node.
creating the backup directory.
last time end with start cluster.
continue this step.
successfully created the backup directory.
begin deploy..
[success] op01:
using omm:dbgroup to install database.
using installation program path : /gauss/app_02c14696
$gausshome points to /gauss/app_02c14696, no need to create symbolic link.
[2022-05-24 08:29:27.624][59583][][gs_ctl]: gs_ctl started,datadir is /gauss/data/db1 
[2022-05-24 08:29:27.961][59583][][gs_ctl]: waiting for server to start...
.0 log:  [alarm module]can not read gauss_warning_type env.
0 log:  [alarm module]host name: op01 
0 log:  [alarm module]host ip: 172.16.220.141                                             
0 log:  [alarm module]cluster name: gscluster 
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.
0 log:  bbox_dump_path is set to /gauss/corefile/
2022-05-24 08:29:28.140 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 db010  0 [redo] log:  recovery parallelism, cpu count = 2, max = 4, actual = 2
2022-05-24 08:29:28.140 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 db010  0 [redo] log:  configrecoveryparallelism, true_max_recovery_parallelism:4, max_recovery_parallelism:4
gaussdb.state does not exist, and skipt setting since it is optional.2022-05-24 08:29:28.145 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]can not read gauss_warning_type env.
2022-05-24 08:29:28.145 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]host name: op01 
2022-05-24 08:29:28.146 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]host ip: 172.16.220.141 
2022-05-24 08:29:28.146 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]cluster name: gscluster 
2022-05-24 08:29:28.146 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]invalid data in alarmitem file! read alarm english name failed! line: 57
2022-05-24 08:29:28.153 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  loaded library "security_plugin"
2022-05-24 08:29:28.155 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  could not create any ha tcp/ip sockets
2022-05-24 08:29:28.157 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  initnuma numanodenum: 1 numa_distribute_mode: none inheritthreadpool: 0.
2022-05-24 08:29:28.158 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 mbytes) or shared memory (3300 mbytes) is larger.
2022-05-24 08:29:28.783 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [cache] log:  set data cache  size(805306368)
2022-05-24 08:29:29.141 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [cache] log:  set metadata cache  size(268435456)
2022-05-24 08:29:33.682 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  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
.2022-05-24 08:29:34.517 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  gaussdb: fsync file "/gauss/data/db1/gaussdb.state.temp" success
2022-05-24 08:29:34.517 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  create gaussdb state file success: db state(starting_state), server mode(primary), connection index(1)
2022-05-24 08:29:34.549 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  max_safe_fds = 974, usable_fds = 1000, already_open = 16
bbox_dump_path is set to /gauss/corefile/
2022-05-24 08:29:34.589 628c26e8.1 [unknown] 140196187737152 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  user configure file is not found, it will be created.
.
[2022-05-24 08:29:36.485][59583][][gs_ctl]:  done
[2022-05-24 08:29:36.485][59583][][gs_ctl]: server started (/gauss/data/db1)
[failure] op02:
[gauss-50201] : the /soft/script/my_cluster.xml does not exist.
[failure] op03:
[gauss-50201] : the /soft/script/my_cluster.xml does not exist.

preinstall会把gs_install.sh文件权限搞没,不知道什么鬼,重新给个777吧。

[alarm module]invalid data in alarmitem file! read alarm english name failed! line: 57

看日志说内存不足,虚拟机,4g内存,当然不够,改成8g试试

三、启动

1、修改内存参数

安装报内存不足,修改下内存参数吧,三个节点

vi postgresql.conf
max_process_memory = 3gb
max_connections = 1000
shared_buffers = 256kb
2、启动节点
[omm@op01 ~]$ gs_om -t start
starting cluster.
=========================================
enter passphrase for key '/home/omm/.ssh/id_rsa': 
omm@op02's password: 
enter passphrase for key '/home/omm/.ssh/id_rsa': 
omm@op03's password: 
[success] op01
2022-05-24 08:56:55.003 628c2d56.1 [unknown] 139750693022784 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  could not create any ha tcp/ip sockets
2022-05-24 08:56:55.004 628c2d56.1 [unknown] 139750693022784 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 mbytes) or shared memory (1478 mbytes) is larger.
=========================================
[gauss-53600]: can not start the database, the cmd is source /home/omm/.bashrc; python3 '/gauss/om/script/local/startinstance.py' -u omm -r /gauss/app -t 300 --security-mode=off,  error:
[gauss-51400] : failed to execute the command: source /home/omm/.bashrc; python3 '/gauss/om/script/local/startinstance.py' -u omm -r /gauss/app -t 300 --security-mode=off. error:
[failure] op02:
.[gauss-51400] : failed to execute the command: source /home/omm/.bashrc; python3 '/gauss/om/script/local/startinstance.py' -u omm -r /gauss/app -t 300 --security-mode=off. error:
[failure] op03:

互信又不灵了,不理他

3、检查状态
[omm@op01 ~]$ gs_om -t status --detail
[   cluster state   ]
cluster_state   : degraded
redistributing  : no
current_az      : az_all
[  datanode state   ]
    nodenode_ip         port      instance                state
-------------------------------------------------------------------------------
1  op01 172.16.220.141  26000      6001 /gauss/data/db1   p primary normal
2  op02 172.16.220.142  26000      6002 /gauss/data/db1   s down    manually stopped
3  op03 172.16.220.143  26000      6003 /gauss/data/db1   c down    manually stopped
[omm@op01 ~]$ gsql -d postgres -p 26000
gsql ((opengauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:12:19 commit 0 last mr  )
non-ssl connection (ssl connection is recommended when requiring high-security)
type "help" for help.
opengauss=# select * from dbe_perf.replication_stat;
 pid | usesysid | usename | application_name | client_addr | client_hostname | client_port | backend_start | state | sender_sent_location | receiver_write_location | receiver_flush_location | receiver_replay_location | sync_priority | s
ync_state 
----- ---------- --------- ------------------ ------------- ----------------- ------------- --------------- ------- ---------------------- ------------------------- ------------------------- -------------------------- --------------- --
----------
(0 rows)
opengauss=# exit
opengauss-# ^[[a\
invalid command \. try \? for help.

就起来主节点,其它的手动起来试试吧

4、手动启动2节点
[omm@op02 ~]$ gs_om -t start
starting cluster.
=========================================
[success] op01:
[2022-05-24 09:10:09.927][26665][][gs_ctl]: gs_ctl started,datadir is /gauss/data/db1 
[2022-05-24 09:10:09.932][26665][][gs_ctl]:  another server might be running; please use the restart command
[success] op02
2022-05-24 09:10:11.338 628c3073.1 [unknown] 139686372580416 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  could not create any ha tcp/ip sockets
2022-05-24 09:10:11.340 628c3073.1 [unknown] 139686372580416 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 mbytes) or shared memory (777 mbytes) is larger.
[success] op03:
[2022-05-24 09:10:14.414][22674][][gs_ctl]: gs_ctl started,datadir is /gauss/data/db1 
[2022-05-24 09:10:14.418][22674][][gs_ctl]:  another server might be running; please use the restart command
waiting for check cluster state...
waiting for check cluster state...
waiting for check cluster state...
waiting for check cluster state...
[gauss-51607] : failed to start cluster. after startup, the last check results were degraded. please check manually.
[omm@op02 ~]$ gs_om -t start                    
starting cluster.
=========================================
[success] op01:
[2022-05-24 09:11:04.166][28199][][gs_ctl]: gs_ctl started,datadir is /gauss/data/db1 
[2022-05-24 09:11:04.170][28199][][gs_ctl]:  another server might be running; please use the restart command
[success] op02:
[2022-05-24 09:11:05.495][29738][][gs_ctl]: gs_ctl started,datadir is /gauss/data/db1 
[2022-05-24 09:11:05.499][29738][][gs_ctl]:  another server might be running; please use the restart command
[success] op03:
[2022-05-24 09:11:07.538][24166][][gs_ctl]: gs_ctl started,datadir is /gauss/data/db1 
[2022-05-24 09:11:07.541][24166][][gs_ctl]:  another server might be running; please use the restart command
waiting for check cluster state...
waiting for check cluster state...
waiting for check cluster state...
^ctraceback (most recent call last):
  file "/gauss/om/script/gs_om", line 830, in 
    main()
  file "/gauss/om/script/gs_om", line 799, in main
    impl.dostart()
  file "/gauss/om/script/impl/om/omimpl.py", line 88, in dostart
    self.dostartcluster()
  file "/gauss/om/script/impl/om/olap/omimplolap.py", line 248, in dostartcluster
    time.sleep(5)
keyboardinterrupt
5、手动启动3节点
omm@op03 ~]$ gs_om -t start
starting cluster.
=========================================
[success] op01:
[2022-05-24 08:37:36.598][65024][][gs_ctl]: gs_ctl started,datadir is /gauss/data/db1 
[2022-05-24 08:37:36.603][65024][][gs_ctl]:  another server might be running; please use the restart command
[success] op02:
[2022-05-24 08:37:38.377][42759][][gs_ctl]: gs_ctl started,datadir is /gauss/data/db1 
[2022-05-24 08:37:38.381][42759][][gs_ctl]:  another server might be running; please use the restart command
[success] op03:
[2022-05-24 08:37:39.204][35582][][gs_ctl]: gs_ctl started,datadir is /gauss/data/db1 
[2022-05-24 08:37:39.209][35582][][gs_ctl]:  another server might be running; please use the restart command
waiting for check cluster state...
waiting for check cluster state...
waiting for check cluster state...
waiting for check cluster state...
[gauss-51607] : failed to start cluster. after startup, the last check results were degraded. please check manually.
6、查看集群状态
[omm@op01 db1]$ gs_om -t status --detail
[   cluster state   ]
cluster_state   : degraded
redistributing  : no
current_az      : az_all
[  datanode state   ]
    nodenode_ip         port      instance                state
-------------------------------------------------------------------------------
1  op01 172.16.220.141  26000      6001 /gauss/data/db1   p primary normal
2  op02 172.16.220.142  26000      6002 /gauss/data/db1   s standby need repair(system)
3  op03 172.16.220.143  26000      6003 /gauss/data/db1   c cascade need repair(system)

状态不对,那就修理一下吧

7、重建一下试试

2、3节点都执行

[omm@op03 ~]$  gs_ctl build -d /gauss/data/db1/ -b full
[2022-05-24 09:20:05.484][28612][][gs_ctl]: gs_ctl full build ,datadir is /gauss/data/db1
waiting for server to shut down.... done
server stopped
[2022-05-24 09:20:06.496][28612][][gs_ctl]: current workdir is (/home/omm).
[2022-05-24 09:20:06.496][28612][][gs_ctl]: fopen build pid file "/gauss/data/db1/gs_build.pid" success
[2022-05-24 09:20:06.496][28612][][gs_ctl]: fprintf build pid file "/gauss/data/db1/gs_build.pid" success
[2022-05-24 09:20:06.498][28612][][gs_ctl]: fsync build pid file "/gauss/data/db1/gs_build.pid" success
[2022-05-24 09:20:06.500][28612][][gs_ctl]: set gaussdb state file when full build build:db state(building_state), server mode(standby_mode), build mode(full_build).
[2022-05-24 09:20:06.520][28612][dn_6001_6002_6003][gs_ctl]: build try host(172.16.220.141) port(26001) success
[2022-05-24 09:20:06.520][28612][dn_6001_6002_6003][gs_ctl]: connect to server success, build started.
[2022-05-24 09:20:06.520][28612][dn_6001_6002_6003][gs_ctl]: create build tag file success
[2022-05-24 09:20:06.583][28612][dn_6001_6002_6003][gs_ctl]: clear old target dir success
[2022-05-24 09:20:06.583][28612][dn_6001_6002_6003][gs_ctl]: create build tag file again success
[2022-05-24 09:20:06.584][28612][dn_6001_6002_6003][gs_ctl]: get system identifier success
[2022-05-24 09:20:06.584][28612][dn_6001_6002_6003][gs_ctl]: receiving and unpacking files...
[2022-05-24 09:20:06.585][28612][dn_6001_6002_6003][gs_ctl]: create backup label success
[2022-05-24 09:20:06.671][28612][dn_6001_6002_6003][gs_ctl]: xlog start point: 0/23f3ae8
[2022-05-24 09:20:06.671][28612][dn_6001_6002_6003][gs_ctl]: begin build tablespace list
[2022-05-24 09:20:06.671][28612][dn_6001_6002_6003][gs_ctl]: finish build tablespace list
[2022-05-24 09:20:06.671][28612][dn_6001_6002_6003][gs_ctl]: begin get xlog by xlogstream
[2022-05-24 09:20:06.671][28612][dn_6001_6002_6003][gs_ctl]: starting background wal receiver
[2022-05-24 09:20:06.672][28612][dn_6001_6002_6003][gs_ctl]: starting walreceiver
[2022-05-24 09:20:06.672][28612][dn_6001_6002_6003][gs_ctl]: begin receive tar files
[2022-05-24 09:20:06.672][28612][dn_6001_6002_6003][gs_ctl]: receiving and unpacking files...
[2022-05-24 09:20:06.686][28612][dn_6001_6002_6003][gs_ctl]: build try host(172.16.220.141) port(26001) success
[2022-05-24 09:20:06.688][28612][dn_6001_6002_6003][gs_ctl]: check identify system success
[2022-05-24 09:20:06.689][28612][dn_6001_6002_6003][gs_ctl]: send start_replication 0/2000000 success
[2022-05-24 09:20:07.463][28612][dn_6001_6002_6003][gs_ctl]: finish receive tar files
[2022-05-24 09:20:07.463][28612][dn_6001_6002_6003][gs_ctl]: xlog end point: 0/4000058
[2022-05-24 09:20:07.463][28612][dn_6001_6002_6003][gs_ctl]: fetching mot checkpoint
[2022-05-24 09:20:07.466][28612][dn_6001_6002_6003][gs_ctl]: waiting for background process to finish streaming...
[2022-05-24 09:20:12.033][28612][dn_6001_6002_6003][gs_ctl]: starting fsync all files come from source.
[2022-05-24 09:20:12.600][28612][dn_6001_6002_6003][gs_ctl]: finish fsync all files.
[2022-05-24 09:20:12.601][28612][dn_6001_6002_6003][gs_ctl]: build dummy dw file success
[2022-05-24 09:20:12.601][28612][dn_6001_6002_6003][gs_ctl]: rename build status file success
[2022-05-24 09:20:12.604][28612][dn_6001_6002_6003][gs_ctl]: full build build completed(/gauss/data/db1).
[2022-05-24 09:20:12.642][28612][dn_6001_6002_6003][gs_ctl]: waiting for server to start...
.0 log:  [alarm module]can not read gauss_warning_type env.
0 log:  [alarm module]host name: op03 
0 log:  [alarm module]host ip: 172.16.220.143 
0 log:  [alarm module]cluster name: gscluster 
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
2022-05-24 09:20:12.717 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 db010  0 [redo] log:  recovery parallelism, cpu count = 2, max = 4, actual = 2
2022-05-24 09:20:12.717 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 db010  0 [redo] log:  configrecoveryparallelism, true_max_recovery_parallelism:4, max_recovery_parallelism:4
2022-05-24 09:20:12.724 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]can not read gauss_warning_type env.
2022-05-24 09:20:12.724 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]host name: op03 
2022-05-24 09:20:12.724 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]host ip: 172.16.220.143 
2022-05-24 09:20:12.724 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]cluster name: gscluster 
2022-05-24 09:20:12.724 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  [alarm module]invalid data in alarmitem file! read alarm english name failed! line: 57
2022-05-24 09:20:12.727 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  loaded library "security_plugin"
2022-05-24 09:20:12.728 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  could not create any ha tcp/ip sockets
2022-05-24 09:20:12.730 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  initnuma numanodenum: 1 numa_distribute_mode: none inheritthreadpool: 0.
2022-05-24 09:20:12.731 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 mbytes) or shared memory (777 mbytes) is larger.
2022-05-24 09:20:12.780 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [cache] log:  set data cache  size(805306368)
2022-05-24 09:20:12.819 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [cache] log:  set metadata cache  size(268435456)
2022-05-24 09:20:12.943 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  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
2022-05-24 09:20:12.987 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  gaussdb: fsync file "/gauss/data/db1/gaussdb.state.temp" success
2022-05-24 09:20:12.988 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  create gaussdb state file success: db state(starting_state), server mode(standby), connection index(1)
2022-05-24 09:20:13.022 628c32cc.1 [unknown] 140271149931584 [unknown] 0 dn_6001_6002_6003 00000  0 [backend] log:  max_safe_fds = 972, usable_fds = 1000, already_open = 18
the core dump path is an invalid directory
[2022-05-24 09:20:13.666][28612][dn_6001_6002_6003][gs_ctl]:  done
[2022-05-24 09:20:13.666][28612][dn_6001_6002_6003][gs_ctl]: server started (/gauss/data/db1)
[2022-05-24 09:20:13.666][28612][dn_6001_6002_6003][gs_ctl]: fopen build pid file "/gauss/data/db1/gs_build.pid" success
[2022-05-24 09:20:13.666][28612][dn_6001_6002_6003][gs_ctl]: fprintf build pid file "/gauss/data/db1/gs_build.pid" success
[2022-05-24 09:20:13.667][28612][dn_6001_6002_6003][gs_ctl]: fsync build pid file "/gauss/data/db1/gs_build.pid" success
8、查看状态
[omm@op03 ~]$ gs_om -t status --detail
[   cluster state   ]
cluster_state   : normal
redistributing  : no
current_az      : az_all
[  datanode state   ]
    nodenode_ip         port      instance                state
-------------------------------------------------------------------------------
1  op01 172.16.220.141  26000      6001 /gauss/data/db1   p primary normal
2  op02 172.16.220.142  26000      6002 /gauss/data/db1   s standby normal
3  op03 172.16.220.143  26000      6003 /gauss/data/db1   c standby normal
[omm@op01 db1]$ gsql -d postgres -p 26000
gsql ((opengauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:12:19 commit 0 last mr  )
non-ssl connection (ssl connection is recommended when requiring high-security)
type "help" for help.
opengauss=# select * from dbe_perf.replication_stat;
       pid       | usesysid | usename |       application_name        |  client_addr   | client_hostname | client_port |         backend_start         |   state   | sender_sent_location | receiver_write_location | receiver_flush_locatio
n | receiver_replay_location | sync_priority | sync_state 
----------------- ---------- --------- ------------------------------- ---------------- ----------------- ------------- ------------------------------- ----------- ---------------------- ------------------------- -----------------------
-- -------------------------- --------------- ------------
 139693219632896 |       10 | omm     | walsender to standby[dn_6003] | 172.16.220.143 |                 |       28752 | 2022-05-24 09:20:13.295994 08 | streaming | 0/5000da8            | 0/5000da8               | 0/5000da8             
  | 0/5000da8                |             0 | async
 139693066417920 |       10 | omm     | walsender to standby[dn_6002] | 172.16.220.142 |                 |       27824 | 2022-05-24 09:19:34.80319 08  | streaming | 0/5000da8            | 0/5000da8               | 0/5000da8             
  | 0/5000da8                |             0 | async
(2 rows)
9、重启试试
[omm@op03 db1]$ gs_om -t restart
stopping cluster.
=========================================
successfully stopped cluster.
=========================================
end stop cluster.
starting cluster.
=========================================
[success] op01
2022-05-24 10:20:45.110 628c40fd.1 [unknown] 140049071512640 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  could not create any ha tcp/ip sockets
2022-05-24 10:20:45.111 628c40fd.1 [unknown] 140049071512640 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 mbytes) or shared memory (777 mbytes) is larger.
[success] op02
2022-05-24 10:20:48.129 628c4100.1 [unknown] 140500375858240 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  could not create any ha tcp/ip sockets
2022-05-24 10:20:48.130 628c4100.1 [unknown] 140500375858240 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 mbytes) or shared memory (777 mbytes) is larger.
[success] op03
2022-05-24 10:20:51.132 628c4103.1 [unknown] 140383888440384 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  could not create any ha tcp/ip sockets
2022-05-24 10:20:51.134 628c4103.1 [unknown] 140383888440384 [unknown] 0 dn_6001_6002_6003 01000  0 [backend] warning:  failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 mbytes) or shared memory (777 mbytes) is larger.
=========================================
successfully started.
[omm@op03 db1]$ gs_om -t status --detail
[   cluster state   ]
cluster_state   : normal
redistributing  : no
current_az      : az_all
[  datanode state   ]
    nodenode_ip         port      instance                state
-------------------------------------------------------------------------------
1  op01 172.16.220.141  26000      6001 /gauss/data/db1   p primary normal
2  op02 172.16.220.142  26000      6002 /gauss/data/db1   s standby normal
3  op03 172.16.220.143  26000      6003 /gauss/data/db1   c cascade normal

看来参数还是有问题

四、以上报错的解决办法

以上报错其实都是内存不足导致,所以安装的时候限制一下内存相关参数即可

./gs_install -x my_cluster.xml --gsinit-parameter="--encoding=utf8" --dn-guc="max_connections=1000" --dn-guc="max_process_memory=2gb" --dn-guc="shared_buffers=128mb" --dn-guc="bulk_write_ring_size=128mb" --dn-guc="cstore_buffers=16mb"
最后修改时间:2022-05-24 22:20:34
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【米乐app官网下载的版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

网站地图