首页 > 其他分享 >openGauss 5.0 一主两从 复制环境 搭建手册

openGauss 5.0 一主两从 复制环境 搭建手册

时间:2023-05-07 10:22:22浏览次数:51  
标签:5.0 node www Successfully cndba 一主 openGauss data

openGauss 5.0 一主两从 复制环境 搭建手册

2023-04-07 13:49850原创openGauss 本文链接:https://www.cndba.cn/dave/article/116528

在之前的博客我们了解了单机版的openGauss安装。

 

Linux 7.6 平台 openGauss 3.1.1 单机版 安装手册
https://www.cndba.cn/dave/article/116448

 

openGauss 修改 IP 地址 操作步骤
https://www.cndba.cn/dave/article/116525

 

本篇我们看下主从复制环境的搭建过程。基本操作是一样的的差不多的,就是xml配置文件有些不同。

1环境信息

[[email protected] ~]# cat /etc/hosts
127.0.0.1   localhost
192.168.56.105 oracle
192.168.56.106 oracle2
192.168.56.107 oracle3
127.0.0.1  localhost  #Gauss OM IP Hosts Mapping
[[email protected] ~]#

安装依赖包:

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

注意这里需要保证所有节点时间同步,否认会报如下错误:

openGauss cm_ctl: SSL verify certificate failed 错误 解决方法
https://www.cndba.cn/dave/article/116527

2配置XML 文件

[[email protected] software]# cat rep_config.xml 
<?xml version="1.0" encoding="UTF-8"?> :
<ROOT> 
    <!-- openGauss整体信息 --> 
    <CLUSTER> 
        <PARAM name="clusterName" value="Cluster_template" /> 
        <PARAM name="nodeNames" value="oracle,oracle2,oracle3" /> 
        <PARAM name="gaussdbAppPath" value="/data/openGauss/install/app" /> 
        <PARAM name="gaussdbLogPath" value="/var/log/omm" /> 
        <PARAM name="tmpMppdbPath" value="/data/openGauss/tmp"/> 
        <PARAM name="gaussdbToolPath" value="/data/openGauss/install/om" /> 
        <PARAM name="corePath" value="/data/openGauss/corefile"/> 
        <PARAM name="backIp1s" value="192.168.56.105,192.168.56.106,192.168.56.107"/> 

    </CLUSTER> 
    <!-- 每台服务器上的节点部署信息 --> 
    <DEVICELIST> 
        <!-- node1上的节点部署信息 --> 
        <DEVICE sn="oracle"> 
            <PARAM name="name" value="oracle"/> 
            <PARAM name="azName" value="AZ1"/> 
            <PARAM name="azPriority" value="1"/> 
            <!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP --> 
            <PARAM name="backIp1" value="192.168.56.105"/> 
            <PARAM name="sshIp1" value="192.168.56.105"/> 
            <!--CM节点部署信息--> 
            <PARAM name="cmsNum" value="1"/> 
            <PARAM name="cmServerPortBase" value="15000"/> 
            <PARAM name="cmServerListenIp1" value="192.168.56.105,192.168.56.106,192.168.56.107"/> 
            <PARAM name="cmServerHaIp1" value="192.168.56.105,192.168.56.106,192.168.56.107"/> 
            <PARAM name="cmServerlevel" value="1"/> 
            <PARAM name="cmServerRelation" value="oracle,oracle2,oracle3"/> 
            <PARAM name="cmDir" value="/data/openGauss/data/cmserver"/> 
            <!--dn--> 
            <PARAM name="dataNum" value="1"/> 
            <PARAM name="dataPortBase" value="15500"/> 
            <PARAM name="dataNode1" value="/data/openGauss/install/data/dn,oracle2,/data/openGauss/install/data/dn,oracle3,/data/openGauss/install/data/dn"/> 
            <PARAM name="dataNode1_syncNum" value="0"/> 
        </DEVICE> 

        <!-- node2上的节点部署信息,其中“name”的值配置为主机名称 --> 
        <DEVICE sn="oracle2"> 
            <PARAM name="name" value="oracle2"/> 
            <PARAM name="azName" value="AZ1"/> 
            <PARAM name="azPriority" value="1"/> 
            <!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP --> 
            <PARAM name="backIp1" value="192.168.56.106"/> 
            <PARAM name="sshIp1" value="192.168.56.106"/> 
            <!-- cm --> 
            <PARAM name="cmServerPortStandby" value="15000"/> 
            <PARAM name="cmDir" value="/data/openGauss/data/cmserver"/> 
        </DEVICE> 

        <!-- node3上的节点部署信息,其中“name”的值配置为主机名称 --> 
        <DEVICE sn="oracle3"> 
            <PARAM name="name" value="oracle3"/> 
            <PARAM name="azName" value="AZ1"/> 
            <PARAM name="azPriority" value="1"/> 
            <!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP --> 
            <PARAM name="backIp1" value="192.168.56.107"/> 
            <PARAM name="sshIp1" value="192.168.56.107"/> 
            <!-- cm --> 
            <PARAM name="cmServerPortStandby" value="15000"/> 
            <PARAM name="cmDir" value="/data/openGauss/data/cmserver"/> 
        </DEVICE> 
    </DEVICELIST> 
</ROOT>

[[email protected] software]#

3初始化安装环境(root)

https://docs.opengauss.org/zh/docs/5.0.0/docs/InstallationGuide/%E5%88%9D%E5%A7%8B%E5%8C%96%E5%AE%89%E8%A3%85%E7%8E%AF%E5%A2%83.html

以下在节点1 操作即可。

解压安装文件:

tar -zxvf openGauss-5.0.0-CentOS-64bit-all.tar.gz
tar -zxvf openGauss-5.0.0-CentOS-64bit-om.tar.gz

进入script执行:

 

[[email protected] script]# ./gs_preinstall -U omm -G dbgrp -X /software/rep_config.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
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 "/software/script/gs_checkos -i A -h oracle,oracle2,oracle3 --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.
[[email protected] script]#

4执行安装(omm)

[[email protected] ~]$ gs_install -X /software/rep_config.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.
begin deploy..
Installing the cluster.
begin prepare Install Cluster..
Checking the installation environment on all nodes.
begin install Cluster..
Installing applications on all nodes.
Successfully installed APP.
begin init Instance..
encrypt cipher and rand files for database.
Please enter password for database:
Please repeat for database:
begin to create CA cert files
The sslcert will be generated in /data/openGauss/install/app/share/sslcert/om
Create CA files for cm beginning.
Create CA files on directory [/data/openGauss/install/app_a07d57c3/share/sslcert/cm]. file list: ['cacert.pem', 'server.key', 'server.crt', 'client.key', 'client.crt', 'server.key.cipher', 'server.key.rand', 'client.key.cipher', 'client.key.rand']
Non-dss_ssl_enable, no need to create CA for DSS
Cluster installation is completed.
Configuring.
Deleting instances from all nodes.
Successfully deleted instances from all nodes.
Checking node configuration on all nodes.
Initializing instances on all nodes.
Updating instance configuration on all nodes.
Check consistence of memCheck and coresCheck on database nodes.
Successful check consistence of memCheck and coresCheck on all nodes.
Configuring pg_hba on all nodes.
Configuration is completed.
Starting cluster.
……

5 验证

[[email protected] ~]$ gs_om -t status --detail
[  CMServer State   ]

node       node_ip         instance                                     state
-------------------------------------------------------------------------------
1  oracle  192.168.56.105  1    /data/openGauss/data/cmserver/cm_server Primary
2  oracle2 192.168.56.106  2    /data/openGauss/data/cmserver/cm_server Standby
3  oracle3 192.168.56.107  3    /data/openGauss/data/cmserver/cm_server Standby

[   Cluster State   ]

cluster_state   : Normal
redistributing  : No
balanced        : No
current_az      : AZ_ALL

[  Datanode State   ]

node       node_ip         instance                             state            
---------------------------------------------------------------------------------
1  oracle  192.168.56.105  6001 /data/openGauss/install/data/dn P Standby Normal
2  oracle2 192.168.56.106  6002 /data/openGauss/install/data/dn S Primary Normal
3  oracle3 192.168.56.107  6003 /data/openGauss/install/data/dn S Standby Normal
[[email protected] ~]$

标签:5.0,node,www,Successfully,cndba,一主,openGauss,data
From: https://www.cnblogs.com/yaoyangding/p/17378973.html

相关文章

  • openGauss 5.0 主从集群 日常运维
    在之前的博客我们看了openGauss主从集群的搭建,如下:openGauss5.0一主两从复制环境搭建手册https://www.cndba.cn/dave/article/116528本篇我们看下主从集群的维护。 1查看集群状态查看集群所有节点:[[email protected]~]$gs_om-tstatus--detail[CMServerSta......
  • CWOI 2023.05.04 题解
    mzx的动态规划杂题选讲。stoARC153D-SumofSumofDigitsP7152[USACO20DEC]BovineGeneticsGCF1542E2AbnormalPermutationPairs(hardversion)题意给定\(n,m\),求有多少对长度为\(n\)的排列\(p,q\),满足以下条件:\(p\)的字典序小于\(q\);\(p\)的逆序对......
  • 13、当主节点坏了,怎么办?或者主节点性能不佳,替掉他(一主双从下把从节点变为新主)
    主从复制默认为异步复制,当主节点坏了,怎么办?或者主节点性能不佳,替掉他。一主双从下把从节点变为新主把哪台从节点提升为主节点?两个从节点中选取一个当主节点,数据一致或者数据差别最小的,提升为主节点如何查看两个从节点谁复制的数据信息最多mysql>showslavestatus\G查看......
  • 【2023.05.04】幸运的猫(下)
    本次博客主要写黑猫回家后的故事未到家前我打电话和我父亲开玩笑说要带女朋友回家过年我爹还蛮激动的,问是哪里的女孩子,我说是福州的忘记了带回家后他是什么心情了哈哈果然还是要多写日记啊,不然什么都忘记了可太糟糕了初到家中初到家里的时候是还关在笼子里的,因为想把猫养......
  • 【23.05.03】好题题解
    好题题解A题目大意:计算一个项数为\(n\)的多项式除以\(x^3-x\)的余数多项式。数据范围:对于\(100\%\)的数据:\(2\leqn\leq2\times10^5\)解题分析:水题,直接多项式除法模拟即可。需要注意细节。ACCode:#include<bits/stdc++.h>usingnamespacestd;#d......
  • drools5.0 下载地址
    http://download.jboss.org/drools/release/5.5.0.Final/参考:http://book.51cto.com/art/201405/439406.htm......
  • 终于有人把openGauss3.0.0分布式原理讲透了,openGauss X ShardingSphere分布式原理和部
    本文为原理精讲,部署文章链接如下https://www.cnblogs.com/opengauss/p/17364285.html一、opengauss的背景和行业现状2022年,七大openGauss商业版发布,是基于openGauss3.0推出商业发行版目前海量数据库Vastbase表现最佳,一直是TOP1作者认为之所以海量数据库Vastbase......
  • 终于有人把openGauss3.0.0分布式原理讲透了,openGauss X ShardingSphere分布式原理和部
    本文为原理精讲,部署文章链接如下https://blog.51cto.com/u_13808894/6236819一、opengauss的背景和行业现状2022年,七大openGauss商业版发布,是基于openGauss3.0推出商业发行版目前海量数据库Vastbase表现最佳,一直是TOP1作者认为之所以海量数据库Vastbase目前无法被同......
  • OpenGauss备份与恢复
    备份与恢复概述数据备份是保护数据安全的重要手段之一,为了更好的保护数据安全,openGauss数据库支持三种备份恢复类型,以及多种备份恢复方案,备份和恢复过程中提供数据的可靠性保障机制。备份与恢复类型可分为逻辑备份与恢复、物理备份与恢复、闪回恢复。逻辑备份与恢复:通过逻辑......
  • android5.0使用Notification报RemoteServiceException的解决办法
    有时android5.0下使用Notification会报如下错误信息(比如开启重启动系统就要发送通知)android.app.RemoteServiceException:Badnotificationpostedfrompackage*:Couldn'tcreateicon:StatusBarIcon这个问题多数集中在setSmallIcon(R.drawable.scan......