趟路:centos7.6安装opengauss5.0.0企业版

news2024/9/22 11:28:32

版本选取

 # 下载opengauss安装介质,截止2023年7月份最新版本长期支持版(LTS:Long Term Support)是5.0.0版本;此外,还有预览版3.1.1;这里建议安装openGauss 5.0.0 (LTS)。
 企业版:更像是生产版、极简版:更像开发版本;轻量版:在企业版的基础上去掉了OM、CM等组件。
 https://opengauss.org/zh/download/
 # 这里以CentOS7.6+openGauss_5.0.0 企业版作为验证安装环境;
操作系统CentOS7.6最小化安装
CPU4核心(opengauss建议:8核心+,如单实例部署建议16核心+)
内存4GB(opengauss建议:32GB+,如单实例部署建议128GB+)
磁盘50GB:只做了boot分区、根分区(不用做swap分区:opengauss要求禁用swap)
网卡单网卡(opengauss建议:双网卡做bond)

初始化安装环境

 # 安装依赖包
 yum -y install bzip2 python3 libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel net-tools
 ​
 # 升级pip工具
 pip3 install --upgrade pip
 ​
 # 关闭色Linux和防火墙
 vi /etc/selinux/config 
 #SELINUX=enforcing
 SELINUX=disabled
 systemctl disable firewalld.service
 systemctl stop firewalld.service
 ​
 # 关闭swap
 swapoff -a
 vi /etc/fstab 
 #/dev/mapper/centos_opengauss5--212-swap swap                    swap    defaults        0 0
 ​
 # 关闭logind的RemoveIPC
 vi /etc/systemd/logind.conf
 RemoveIPC=no
 ​
 # 创建安装介质目录,解压安装介质
 mkdir -p /opt/software/openGauss
 chmod 755 -R /opt/software
 mv openGauss-5.0.0-CentOS-64bit-all.tar.gz /opt/software/openGauss
 mv /home/omm/cluster_config.xml /opt/software/openGauss
 cd /opt/software/openGauss
 tar zxvf openGauss-5.0.0-CentOS-64bit-all.tar.gz 
 tar zxvf openGauss-5.0.0-CentOS-64bit-om.tar.gz 
 ​
 # 最好手动配一下hosts,不配也可以,安装脚本会自动安装
 vi /etc/hosts
 192.168.14.212 opengauss5-212
 ​
 # 可以不手动创建omm用户和dbgrp用户组,安装脚本会自动安装;
 groupadd dbgrp
 useradd omm -g dbgrp
 ​
 # 如下python3的模块必须要装,使用普通用户不会有WARNING,使用root也可以。
 su - omm
 $ pip3 install psutil
 $ pip3 install netifaces
 $ pip3 install cffi
 $ pip3 install pycparser
 $ pip3 install cryptography
 $ pip3 install pynacl
 $ pip3 install bcrypt
 $ pip3 install paramiko
 ​
 # 禁用transparent_hugepage
 vi /etc/default/grub 
 #GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_opengauss5-212/root rd.lvm.lv=centos_opengauss5-212/swap rhgb quiet"
 GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos_opengauss5-212/root rd.lvm.lv=centos_opengauss5-212/swap rhgb quiet transparent_hugepage=never"
 grub2-mkconfig -o /boot/grub2/grub.cfg
 ​
 # 调整内核参数
 vi /etc/sysctl.d/99-sysctl.conf 
 net.ipv4.tcp_retries1=5
 net.ipv4.tcp_syn_retries=5
 ​
 # 调整limit限制参数
 vi /etc/security/limits.conf 
 root       soft    nproc  unlimited
 omm       soft    nproc  unlimited
 root       hard    nproc  unlimited
 omm       hard    nproc  unlimited
 ​
 root     soft nofile   1000000
 omm      soft nofile   1000000
 root     hard nofile   1000000
 omm     hard nofile   1000000
 ​
 # 调整网卡参数
 vi /etc/sysconfig/network-scripts/ifcfg-ens160 
 MTU="8192"
 TX="4096"
 RX="4096"
 ​
 # 重启令 selinux等配置生效
 reboot
 ​
 # 执行验证查看是否环境是否准备好:没有Abnormal状态即可;Warning状态的可以处理可以不处理。
 /opt/software/openGauss/script/gs_checkos -i A -h opengauss5-212 --detail
 Checking items:
     A1. [ OS version status ]                                   : Normal     
         [opengauss5-212]
         centos_7.6.1810_64bit
     
     A2. [ Kernel version status ]                               : Normal     
         The names about all kernel versions are same. The value is "3.10.0-957.el7.x86_64".
     A3. [ Unicode status ]                                      : Normal     
         The values of all unicode are same. The value is "LANG=en_US.UTF-8".
     A4. [ Time zone status ]                                    : Normal     
         The informations about all timezones are same. The value is "+0800".
     A5. [ Swap memory status ]                                  : Normal     
         The value about swap memory is correct.            
     A6. [ System control parameters status ]                    : Normal     
         All values about system control  parameters are correct.
     A7. [ File system configuration status ]                    : Normal     
         Both soft nofile and hard nofile are correct.      
     A8. [ Disk configuration status ]                           : Normal     
         The value about XFS mount parameters is correct.   
     A9. [ Pre-read block size status ]                          : Normal     
         The value about Logical block size is correct.     
     A11.[ Network card configuration status ]                   : Warning    
         [opengauss5-212]
 BondMode Null
         Warning reason: network 'ens160' 'rx' RealValue '4032' ExpectValue '4096'.
 ​
     A12.[ Time consistency status ]                             : Warning    
         [opengauss5-212]
         The NTPD not detected on machine and local time is "2023-07-06 21:06:59".
 ​
     A13.[ Firewall service status ]                             : Normal     
         The firewall service is stopped.                   
     A14.[ THP service status ]                                  : Normal     
         The THP service is stopped.                        
 Total numbers:13. Abnormal numbers:0. Warning numbers:2.
 ​

准备XML配置文件:cluster_config.xml

<?xml version="1.0" encoding="UTF-8"?>
 <ROOT>
     <!-- openGauss整体信息 -->
     <CLUSTER>
         <!-- 数据库名称 -->
         <PARAM name="clusterName" value="single" />
         <!-- 数据库节点名称(hostname) -->
         <PARAM name="nodeNames" value="opengauss5-212" />
         <!-- 数据库安装目录-->
         <PARAM name="gaussdbAppPath" value="/opt/huawei/install/app" />
         <!-- 日志目录-->
         <PARAM name="gaussdbLogPath" value="/var/log/omm" />
         <!-- 临时文件目录-->
         <PARAM name="tmpMppdbPath" value="/opt/huawei/tmp" />
         <!-- 数据库工具目录-->
         <PARAM name="gaussdbToolPath" value="/opt/huawei/install/om" />
         <!-- 数据库core文件目录-->
         <PARAM name="corePath" value="/opt/huawei/corefile" />
         <!-- 节点IP,与数据库节点名称列表一一对应 -->
         <PARAM name="backIp1s" value="192.168.14.212"/> 
     </CLUSTER>
     <!-- 每台服务器上的节点部署信息 -->
     <DEVICELIST>
         <!-- 节点1上的部署信息 -->
         <DEVICE sn="opengauss5-212">
             <!-- 节点1的主机名称 -->
             <PARAM name="name" value="opengauss5-212"/>
             <!-- 节点1所在的AZ及AZ优先级 -->
             <PARAM name="azName" value="AZ1"/>
             <PARAM name="azPriority" value="1"/>
             <!-- 节点1的IP,如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
             <PARAM name="backIp1" value="192.168.14.212"/>
             <PARAM name="sshIp1" value="192.168.14.212"/>
                
             <!--dbnode-->
             <PARAM name="dataNum" value="1"/>
             <PARAM name="dataPortBase" value="15400"/>
             <PARAM name="dataNode1" value="/opt/huawei/install/data/dn"/>
             <PARAM name="dataNode1_syncNum" value="0"/>
         </DEVICE>
     </DEVICELIST>
 </ROOT>

执行安装

 # root下执行预安装
 cd /opt/software/openGauss/script
 ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml
 ……
 Preinstallation succeeded.   #--- 表示预安装成功
 ​
 # omm用户下执行安装
 su - omm
 $ gs_install -X /opt/software/openGauss/cluster_config.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..
 The cluster status is Normal.
 Successfully started cluster.
 Successfully installed application.
 end deploy..

 # 验证是否安装成功:cluster_state   : Normal
 $ gs_om -t status
 -----------------------------------------------------------------------
 ​
 cluster_name    : single
 cluster_state   : Normal
 redistributing  : No
 ​
 -----------------------------------------------------------------------
 ​
 # 访问
 $ gsql -d postgres -p 15400
 gsql ((openGauss 5.0.0 build a07d57c3) compiled at 2023-03-29 03:07:56 commit 0 last mr  )
 Non-SSL connection (SSL connection is recommended when requiring high-security)
 Type "help" for help.
 ​
 openGauss=#

FAQ

 #问题:执行pip3 install安装python模块失败
 Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ap19dhuq/psutil/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-_g6qbyqx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ap19dhuq/psutil/
 #解决:
 pip3 install --upgrade pip
 ​
 #问题:执行pip3 install 输出告警
 WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
 WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
 #解决:
 使用普通用户执行pip3 install
 ​
 #问题:执行gs_install安装命令报错
 Traceback (most recent call last):
   File "/opt/huawei/install/om/script/local/Install.py", line 812, in <module>
     functionDict[g_opts.action]()
   File "/opt/huawei/install/om/script/local/Install.py", line 743, in startCluster
     dn.start(self.time_out)
   File "/opt/huawei/install/om/script/local/../gspylib/component/Kernel/Kernel.py", line 106, in start
     "failure details." + "\n" + output)
 Exception: [GAUSS-51607] : Failed to start instance. Error: Please check the gs_ctl log for failure details.
 [2023-07-06 21:15:37.786][10670][][gs_ctl]: gs_ctl started,datadir is /opt/huawei/install/data/dn 
 [2023-07-06 21:15:37.894][10670][][gs_ctl]: waiting for server to start...
 ……
 2023-07-06 21:15:38.181 64a6be79.1 [unknown] 139985881190656 [unknown] 0 dn_6001 01000  0 [BACKEND] WARNING:  Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 Mbytes) or shared memory (3543 Mbytes) is larger.
 2023-07-06 21:15:38.181 64a6be79.1 [unknown] 139985881190656 [unknown] 0 dn_6001 42809  0 [BACKEND] FATAL:  could not create shared memory segment: Cannot allocate memory
 2023-07-06 21:15:38.181 64a6be79.1 [unknown] 139985881190656 [unknown] 0 dn_6001 42809  0 [BACKEND] DETAIL:  Failed system call was shmget(key=15400001, size=3715893576, 03600).
 2023-07-06 21:15:38.181 64a6be79.1 [unknown] 139985881190656 [unknown] 0 dn_6001 42809  0 [BACKEND] HINT:  This error usually means that openGauss's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter.  You can either reduce the request size or reconfigure the kernel with larger SHMALL.  To reduce the request size (currently 3715893576 bytes), reduce openGauss's shared memory usage, perhaps by reducing shared_buffers.
         The openGauss documentation contains more information about shared memory configuration.
 2023-07-06 21:15:38.185 64a6be79.1 [unknown] 139985881190656 [unknown] 0 dn_6001 00000  0 [BACKEND] LOG:  FiniNuma allocIndex: 0.
 [2023-07-06 21:15:38.895][10670][][gs_ctl]: waitpid 10673 failed, exitstatus is 256, ret is 2
 ​
 [2023-07-06 21:15:38.896][10670][][gs_ctl]: stopped waiting
 [2023-07-06 21:15:38.896][10670][][gs_ctl]: could not start server
 Examine the log output.
 ​
 解决:主要是因为小马拉大车的原因
 1、根据服务器内存配置适当的kernel.shmall和kernel.shmmax
 2、$ vi /opt/huawei/install/data/dn/postgresql.conf
 #max_process_memory = 2GB   
 max_process_memory = 3GB
 ​
 #shared_buffers = 720MB                 # min 128kB
 shared_buffers = 128MB                  # min 128kB

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/729036.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Windows故障转移集群

Windows2012作为根域 两台Windows2008加入域 创建三台Windows 分别是Windows2012和两台Windows2008 并选择其环境 创建三个十g的卷&#xff0c;连接至Windows2012 清理三台主机的后台数据 然后修改三台主机的IP 本机IP要相对应 Windows2008-1主机IP 第二块网卡不需要填写网…

液滴接触角边界曲线识别—巧用Ovito

关注 M r . m a t e r i a l , \color{Violet} \rm Mr.material\ , Mr.material , 更 \color{red}{更} 更 多 \color{blue}{多} 多 精 \color{orange}{精} 精 彩 \color{green}{彩} 彩&#xff01; 主要专栏内容包括&#xff1a; †《LAMMPS小技巧》&#xff1a; ‾ \textbf…

Navicat 连接orcal11g

Navicat 连接orcal11g orcal12g 在不安装客户端的情况下是可以连接上的&#xff0c;orcal11g不行 1、下载客户端 官网传送门 传送门 csdn下载 传送门 2、配置客户端 解压下载的文件到D:\Program Files\PremiumSoft\Navicat Premium 16\instantclient_11_2 相同的可以备份原…

基于springboot+Mybatis+mysql+vue疗养中心管理系统

基于springbootMybatismysqlvue疗养中心管理系统 一、系统介绍二、功能展示1.登陆2.信息管理3.膳食管理4.护理管理5.床位管理6.后勤管理7.后勤管理 三、其它系统实现四.获取源码 一、系统介绍 系统主要功能&#xff1a; 信息管理模块&#xff1a;包括入住登记、退住登记、档案…

锐浪报表 Grid++Report 打印数据表图像

锐浪报表 GridReport 打印数据表时&#xff0c;特别是需要在Cell中打印图像时。例如&#xff1a; 二、图像的保存方式 1、图像以文件形式。保存在指定目录中。 2、数据表中&#xff0c;图像字段&#xff0c;仅保存图像的完整文件名&#xff08;指定目录&#xff09;。 3、打印表…

Windows Server 配置(七)VPN服务器的安装

VPN服务器的安装 VPN服务器是双网卡或多网卡的配置&#xff0c;一块网卡连接内网&#xff0c;另一块连接外网&#xff0c;同时外网或远程的客户端可以通过建立VPN连接访问到内网资源。 两块网卡分别设置好地址&#xff0c;外网网卡的地址是否能做的&#xff0c;或者是在路由器…

19 区域生长用于图像分割(matlab程序)

1.简述 区域生长法 区域生长的基本思想是将具有相似性质的像素集中起来构建成分割区域。以一组种子点开始&#xff0c;将与种子性质相似(如灰度级)的领域像素附加到生长区域的每个种子上 算法步骤 a.随机选取图像中的一个像素作为种子像素&#xff0c;并将其表示出来 b.检索种…

说一说spring boot服务的健康检测

一、判断服务的健康状态 服务健康与否&#xff0c;对我们的重要性&#xff0c;主要是体现在应用部署与服务调用。具体可以是如下&#xff1a; consul/nacos 服务注册中心api网关docker/k8s 容器部署发版结果应用监控 服务注册中心要对外提供服务&#xff0c;仅限于健康的节点…

天猫厨房大电市场分析(淘宝天猫数据)

如今&#xff0c;消费者对于厨房电器的需要不断增长&#xff0c;厨房电器领域的发展规模也越来越大。在国内市场中&#xff0c;由于中国人在烹饪时喜欢煎炒烹炸&#xff0c;油烟较重&#xff0c;因此&#xff0c;以油烟机和燃气灶为代表的厨房大电也成为千家万户不可少的厨用电…

2023黑马头条.微服务项目.跟学笔记(四)

2023黑马头条.微服务项目.跟学笔记 四 自媒体文章-自动审核今日内容介绍1.自媒体文章自动审核流程2.内容安全第三方接口2.1 概述2.2 准备工作2.3 文本内容审核接口2.4 图片审核接口2.5 项目集成 3.app端文章保存接口3.1 表结构说明3.2 分布式id3.3 思路分析3.4 feign接口 4.自媒…

常用的 34 个 Linux Shell 脚本,一定能帮到你!

作为一名 Linux 工程师&#xff0c;会写好的脚本不仅能提高工作效率&#xff0c;还能有更多的时间做自己的事。最近在网上冲浪的时候&#xff0c;也注意收集一些大佬写过的脚本&#xff0c;汇总整理一下&#xff0c;欢迎收藏&#xff0c;与君共勉&#xff01; &#xff08;1&a…

antd-React Popover 点击空白不隐藏

1.问题原因&#xff1a;自己写的点击事件把默认事件覆盖掉了&#xff0c;所以点击会不生效 2.解决方案&#xff1a;给按钮在添加一个焦点事件即可&#xff0c;当失去焦点的时候取反 3.代码如下 const [closeVisible, setCloseVisible] useState(false);<Popover content{c…

SSM学习笔记-------Spring(三)

SSM学习笔记-------Spring&#xff08;三&#xff09; Spring_day031、AOP简介1.1 什么是AOP?1.2 AOP作用1.3 AOP核心概念 2、AOP入门案例2.1 需求分析2.2 思路分析2.3 环境准备2.4 AOP实现步骤步骤1:添加依赖步骤2:定义接口与实现类步骤3:定义通知类和通知步骤4:定义切入点 步…

在任何文件夹下打开jupyter 内核都是同一个文件夹

我在 D:\anaconda实例代码 下打开jupyter notebook 无论我在那个文件下打开jupyter 都是同一个文件这是因为你可能在jupyter notebook 的那个配置文件中设置固定的路径 假如你的.py 文件在D:\anaconda实例代码 下 你想通过jupyter notebook 运行它很简单 上传到jupyter notebo…

Linux系统运行时参数命令(性能监控、测试)(2)虚拟内存和物理内存、内存性能监控、文件IO性能监控

目录 3. 内存性能监控3.1 内存是什么-虚拟内存和物理内存3.1.1 为什么需要有虚拟内存3.1.2 虚拟内存的原理 3.2 内存中的buffer和cache3.2.1 buff/cache3.2.2 **free 与 available** 4.文件IO性能监控4.1 IO的两种方式4.1.1 缓存IO4.1.2 直接IO 4.2 监控磁盘IO的命令4.2.1 iost…

【指针进阶】

1 字符指针 #include <stdio.h> int main() {char str1[] "hello bit.";char str2[] "hello bit.";const char* str3 "hello bit.";const char* str4 "hello bit.";if (str1 str2)printf("str1 and str2 are same\n&…

DataEase安装与教程,人人都会的大数据可视化与BI工具!!!

文章目录 一 DataEase介绍1.1 可视化工具介绍1.2 什么是 DataEase1.3 DataEase 的优势1.4 DataEase 支持的数据源1.5 DataEase 模板市场1.6 快速开始 二 Dataease安装部署2.1 登陆DataEase2.2 DataEase界面2.3 数据源连接2.4 数据集2.5 看板案例 一 DataEase介绍 1.1 可视化工…

第三节 给SpringBootAdmin的client端加入spring security安全控制

前言 本来想用一节就写完SpringBootAdmin的&#xff0c;但随着研究的深入发现一节应该是不够的&#xff0c;网上的资料也不会非常系统&#xff0c;官网的例子有些已经好几年没更新了&#xff0c;所以接下来还是系统性的来写下吧 第一节 完成基础配置&#xff0c;暴露所有端点…

B2B2C商城模式适合哪些的企业?

随着互联网的发展&#xff0c;电商也变得的越来越火热&#xff0c;很多个人和企业进驻其中&#xff0c;所以竞争激烈&#xff0c;如天猫和京东&#xff0c;他们内部的店家多不胜数&#xff0c; 在这种大环境下&#xff0c;企业开始做出不一样的举动&#xff0c;纷纷都搭建一个b…

samba参数配置教程(samba配置参数讲解)(/etc/samba/smb.conf )

文章目录 samba smb.conf配置文档smb.conf重要配置参数讲解1. workgroup&#xff1a;指定Samba服务器所在的工作组名称。2. server string&#xff1a;指定Samba服务器的描述信息。3. security&#xff1a;指定Samba服务器的安全模式&#xff0c;可以是user、share或domain。4.…