openGauss5.0企业版CentOS单节点安装

2023-05-16

目录

一、安装环境

 二、前置依赖包

 三、安装前准备1

四、安装前准备2

五、安装


一、安装环境

CPU:2核

内存:4G

磁盘:20G

操作系统:CentOS 7.9

python版本:Python 3.6.8

 二、前置依赖包

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

同时还需要:expect和bzip2

1、安装依赖包

yum install -y libaio-devel flex bison ncurses-devel glibc-devel patch lsb_release readline-devel expect bzip2

2、检查是否已安装

rpm -qa libaio-devel flex bison ncurses-devel glibc-devel patch lsb_release readline-devel expect bzip2

 注:redhat-lsb-core系统默认已安装

 三、安装前准备1

1、修改操作系统参数

cat >>/etc/sysctl.conf<<EOF
net.ipv4.tcp_fin_timeout=60
net.ipv4.tcp_retries1=5
net.ipv4.tcp_syn_retries=5
#net.sctp.path_max_retrans=10
#net.sctp.max_init_retransmits=10
EOF

# 检查
cat /etc/sysctl.conf

使其生效

sysctl -p

如果有提示不存在的直接注释掉,再执行

2、关闭透明大页

-- openGauss默认关闭使用transparent_hugepage服务,并将关闭命令写入操作系统启动文件
cat >> /etc/rc.d/rc.local<<EOF
if test -f /sys/kernel/mm/transparent_hugepage/enabled;
    then
	echo never > /sys/kernel/mm/transparent_hugepage/enabled
	fi
	if test -f /sys/kernel/mm/transparent_hugepage/defrag;
    then
	echo never > /sys/kernel/mm/transparent_hugepage/defrag
	fi
EOF

-- 查看是否关闭:
cat /sys/kernel/mm/transparent_hugepage/enabled
cat /sys/kernel/mm/transparent_hugepage/defrag

3、关闭防火墙

systemctl disable firewalld.service
systemctl stop firewalld.service

# 检查防火墙状态
systemctl status firewalld

 4、关闭SELINUX

sed -i 's/^SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

setenforce 0

# 检查
cat /etc/selinux/config | grep SELINUX

 5、修改字符集

cat>> /etc/profile<<EOF
export LANG=en_US.UTF-8
EOF

source /etc/profile
# 检查
cat /etc/profile | grep LANG

 6、修改时区

cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

-- 查看
date

如果出现情况,说明时区正常,可跳过

 7、关闭swap

# 临时关闭
swapoff -a

# 永久关闭注释 swap 行
# vim /etc/fstab

# 查看swap一行全是 0 表示swap关闭
free -h

8、设置网卡MTU,要求数据库各节点的网卡MTU值设置为相同大小。MTU值推荐8192,要求不小于1500,使用默认值 1500 满足要求即可

-- 设置网卡为1500
ifconfig 网卡名 mtu 1500

 9、设置root用户远程登录

cat >>/etc/ssh/sshd_config<<EOF
PermitRootLogin yes
EOF

# 检查
cat /etc/ssh/sshd_config |grep PermitRootLogin

 10、修改Banner配置

cat >>/etc/ssh/sshd_config<<EOF
Banner none
EOF
# 检查
cat /etc/ssh/sshd_config | grep Banner
# 重启生效
systemctl restart sshd.service

11、修改DNS,IP为网关IP,需要根据实际情况填写

# 节点一
cat >>/etc/resolv.conf<<EOF
nameserver 114.114.114.114
EOF

# 检查
cat /etc/resolv.conf

四、安装前准备2

1、修改hostname,local_host替换为本机IP

# 主机名修改 
cat > /etc/hostname<<EOF 
node1 
EOF

# 检查
cat /etc/hostname

2、创建目录

# 创建存放安装包的目录
mkdir -p /opt/software/openGauss
chmod 755 -R /opt/software

# 创建数据库软件相关目录
mkdir -p /opt/openGauss
chmod -R 755 /opt/openGauss

3、下载安装包

# 下载地址:openGauss
openGauss

或者直接命令行执行

wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.0/x86/openGauss-5.0.0-CentOS-64bit-all.tar.gz

 4、解压安装包

# 将下载的安装包移到安装目录
mv openGauss-5.0.0-CentOS-64bit-all.tar.gz /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

五、安装

1、xml配置

安装openGauss前需要创建cluster_config.xml文件。cluster_config.xml文件包含部署openGauss的服务器信息、安装路径、IP地址以及端口号等。 用于告知openGauss如何部署。用户需根据不同场景配置对应的XML文件。

# 查找xml配置模板
find / -name cluster_config_template.xml

# 移动到安装目录

# 编辑xml文件
vi /opt/software/openGauss/cluster_config.xml

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

 2、创建omm用户和用户组,并授权

# 创建用户组
groupadd dbgrp 

# 在用户组下创建用户,并设置密码
useradd -g dbgrp omm
passwd
# 授权
chown -R omm:dbgrp /opt/software
chown -R omm:dbgrp /opt/openGauss

3、预安装

cd /opt/software/openGauss/script/

./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml

# 或者直接
/opt/software/openGauss/script/gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_config.xml
异常情况1:
[GAUSS-51405] : You need to install software:expect

原因没有安装expect,执行:
yum install -y expect

异常情况2:
Parsing the configuration file.
Successfully parsed the configuration file.
[GAUSS-50217] : Failed to decompress version.cfg.The cmd is cd /opt/software/openGauss/script/.. && tar -xpf `ls openGauss*.tar.bz2|tail -1` ./version.cfg ./bin/encrypt && \mv ./bin/encrypt /opt/software/openGauss/script/../script/gspylib/clib && cd /opt/software/openGauss/script/.. && rm -rf bin. The output is tar (child): lbzip2: Cannot exec: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error is not recoverable: exiting now.

原因:没安装bzip2,执行:
yum -y install bzip2

异常3:
[GAUSS-50202] : The /opt/openGauss must be empty. Or user [omm] has write permission to directory /opt/openGauss. Because it will create symbolic link [/opt/openGauss/app] to install path [/opt/openGauss/app_a07d57c3] in gs_install process with this user.

原因:之前预安装失败,产生的文件,需要删除,也可能是omm没有文件权限
rm -rf /opt/openGauss/*
chown omm:dbgrp -R /opt/openGauss
chown omm:dbgrp -R /opt/software/openGauss
[root@node1 openGauss]# ./script/gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/cluster_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.
Setting host ip env
Successfully set host ip env.
Are you sure you want to create the user[omm] (yes/no)? yes
Preparing SSH service.
Successfully prepared SSH service.
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 "/opt/software/openGauss/script/gs_checkos -i A -h node1 --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.

3、安装

切换到omm用户,设置数据库初始账号omm密码要求

最少包含8个字符,最多包含16个字符。
不能和用户名、当前密码(ALTER)、或当前密码反序相同。
至少包含大写字母(A-Z)、小写字母(a-z)、数字、非字母数字字符(限定为~!@#$%^&*()-_=+\|[{}];:,<.>/?)四类字符中的三类字符
[omm@node1 openGauss]$ su omm

[omm@node1 openGauss]$ 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 Install cluster.
Continue this step.
Successfully created the backup directory.
begin deploy..
Rolling back.
Rollback succeeded.
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:
[GAUSS-50306] : The password of database is incorrect.The two passwords are different, please enter password again.
Please enter password for database:
Please repeat for database:
begin to create CA cert files
The sslcert will be generated in /opt/openGauss/app/share/sslcert/om
NO cm_server instance, no need to create CA for CM.
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.
Configuring pg_hba on all nodes.
Configuration is completed.
The cluster status is Normal.
Successfully started cluster.
Successfully installed application.
end deploy..
[omm@node1 openGauss]$ 

8、安装验证

gs_om -t status --detail

4、数据库基本操作

# 关闭服务
gs_om -t stop

# 启动服务
gs_om -t start

# 登录数据库
gsql -d postgres -p 15400

# 查看数据库版本
select version();

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

openGauss5.0企业版CentOS单节点安装 的相关文章

  • CMake编译CUDA项目报错

    CMake编译CUDA项目报错 现象解决方法结果 现象 configure后显示如下错误 CMake Error at C Program Files CMake share cmake 3 26 Modules CMakeDetermin
  • 程序设计思维 week11 作业

    A 题意 蒜头君从现在开始工作 xff0c 年薪 NN 万 他希望在蒜厂附近买一套 6060 平米的房子 xff0c 现在价格是 200200 万 假设房子价格以每年百分之 KK 增长 xff0c 并且蒜头君未来年薪不变 xff0c 且不吃
  • windows->wsl&ubuntu config

    ref https blog csdn net weixin 45883933 article details 106085184 安装前配置 ref 适用于 Linux 的 Windows 子系统安装指南 Windows 10 1 启用
  • 线程阻塞与唤醒

    线程阻塞与唤醒的方法如图 xff1a span class hljs keyword package span newThread span class hljs keyword import span java util Scanner
  • Android的死机、重启问题分析方法

    Android的死机 重启问题分析方法 原文链接 xff1a https blog csdn net jinlu7611 article details 50592385 1 死机现象 1 1 死机定义 当手机长时间无法再被用户控制操作时
  • JAVA小白工具人PHPer

    PHP写多了 xff0c 确实很松散 xff0c 什么都是array xff0c 不像java这么资深 xff0c 个个都是大佬 慢慢学习 1 二维数组取某一列的值 php的写法 array column array 39 id 39 ja
  • 当大恒相机采集帧率没有达到理论帧率时

    当大恒相机采集帧率没有达到理论帧率时 xff0c 可设置最大带宽
  • iOS——UITabBarController

    一 UITabBarController简介 1 UITabBarController 对象可以保存多个 视图控制器 并进行切换 xff0c 并且底部还会有一个 工具栏 xff08 UITabBar xff09 xff0c 工具栏里会有多个
  • nomachine NX 远程连接相关问题

    由于xavier等硬件设备不支持x86指令集 xff0c 因此无法使用诸如teamviewer 向日葵 todesk等远程控制软件 这里我们使用nomachine软件实现远程访问 远程连接分以下两种情况 xff1a 局域网内远程连接和公网远
  • loki部署

    官方最佳示例 xff1a Best practices Grafana Loki documentation helm repo add loki https grafana github io loki charts helm repo
  • C++中的string与char数据类型以及路径字符串拼接以及写txt文件的问题

    作为一个计算机小白 xff0c 最近学习C 43 43 xff0c 这里做一个小记录 xff0c 欢迎各路大神共同交流 分割线 C 43 43 中string与char的区别 xff1a 在C 43 43 中 xff0c 字符串有两种 xf
  • 计蒜客救援问题 java

    救生船从大本营出发 xff0c 营救若干屋顶上的人回到大本营 xff0c 屋顶数目以及每个屋顶的坐标和人数都将由输入决定 xff0c 求出所有人都到达大本营并登陆所用的时间 在直角坐标系的原点是大本营 xff0c 救生船每次从大本营出发 x
  • 在keil中观察STM32产生的PWM 用示波器观察实质频率与仿真不符 是计算值的10倍(疑惑中。。。)

    第一步 xff1a 选择软件仿真 1 配置软件仿真 第二步 xff1a 进入仿真 xff0c 调用logicc analyer 观察波形 1 按仿真按键进入仿真界面 2 打开模拟 示波器 界面 3 设置观察端口 4 开始仿真 全速运行 5
  • 工厂模式——简单工厂、工厂方法、抽象工厂入门及总结

    背景 相信我们很多开发人员 xff0c 在平时的系统开发过程中 xff0c 都或多或少等接触过一些设计模式 比如java程序员必须会接触到的Spring类库 xff0c 它就综合运用了多种设计模式 xff0c 从而使源码更加抽象 xff0c
  • IDEA插件开发-学习

    IDEA插件资料其实挺少的 xff0c 可能我姿势不对 闲暇无事 xff0c 当作练手 这东西挺难调试的 xff0c 官方文档实在看不下去 xff0c 谷歌资料也挺少的 把下面这些东西复制进去可以当调试用了 Project project
  • 树莓派 通过opencv 调用csi摄像头

    树莓派使用csi摄像头 在设置里面打开摄像头 检测摄像头 安装opencv 读取图像测试 socket 网络传图测试 opencv多线程 取图测试 在设置里面打开摄像头 span class token function sudo span
  • Centos7.2下安装Pyspider

    本来一直使用的python3 X的 xff0c 之前一直弄的Python3 6 1 xff0c 不知道为啥 xff0c 搭建了好几次都没有成功 xff0c 不知道是什么地方的问题 xff0c 后面再找一下问题 还有就是在Windows上搭建
  • OFD版式文件的优势

    OFD版式文件的优势 OFD格式是我国自主可控的电子文件版式文档格式 在OFD格式产生之前 xff0c 电子文件存档格式并没有统一的国家或行业标准 xff0c 档案工作中普遍采用DOC WPS PPTX等流式文件格式 内容易更改 转移过程存
  • OFD是什么?

    OFD是什么 xff1f OFD格式文件介绍 OFD xff08 Open Fixed layout Document的简称 xff0c 意为开放版式文档 xff09 xff0c 是按照我国自主研发制定的版式文档格式标准 GB T 3319
  • ofd格式文件转换成pdf格式的方法

    ofd格式文件很多人还比较陌生 xff0c 很多人接收到文件都不知如何打开阅读 xff0c 把文件发给对方 xff0c 还需要对方安装个专门的阅读软件 xff0c 我们还有另一个办法 xff0c 就是将OFD文件转换为PDF格式文件 xff

随机推荐

  • 比较出名的导航类网站

    网址导航是把很多网站集合起来 xff0c 按照一定的条件进行分类的网站 网址导航方便网民快速找到自己需要的网站 xff0c 可以直接到需要的网站 xff0c 而不必记住各个网站的网址 现在的网址导航一般都提供自己常用的查询工具 xff0c
  • 使用NGINX作为HTTPS正向代理服务器

    简介 xff1a NGINX主要设计作为反向代理服务器 xff0c 但随着NGINX的发展 xff0c 它同样能作为正向代理的选项之一 正向代理本身并不复杂 xff0c 而如何代理加密的HTTPS流量是正向代理需要解决的主要问题 本文将介绍
  • 超级小的docker镜像

    超级小的docker镜像 xff0c 通过可用来做基础镜像或者测试使用 拉镜像尽量选择带有apline或slim标签的 xff0c 体积很小 alpine镜像官方地址 xff1a https hub docker com alpine 拉取
  • 16进制转Base64的实现原理及代码

    随着计算机技术的发展 xff0c 数据的存储和传输方式也在不断更新 xff0c 其中十六进制字符串和Base64编码是两种常见的数据表示方式 本文将介绍16进制字符串和Base64编码的原理 xff0c 并提供Java代码实现16进制字符串
  • MySQL错误-this is incompatible with sql_mode=only_full_group_by解决办法

    原因分析 xff1a 一 原理层面 这个错误发生在mysql 5 7 5 版本及以上版本会出现的问题 xff1a mysql 5 7 5版本以上默认的sql配置是 sql mode 61 ONLY FULL GROUP BY xff0c 这
  • pulsar-admin接入项目

    练手项目 第一步 xff1a 添加依赖 lt dependency gt lt groupId gt org apache pulsar lt groupId gt lt artifactId gt pulsar client admin
  • C/C++语言——函数返回临时变量、对象

    函数内部栈上创建的临时变量 临时对象 xff0c 生命周期只在函数运行期间 xff0c 函数运行结束后 xff0c 就会释放对应内存空间 错误的函数写法 int amp test1 int x 61 1 return x 错误的函数写法 i
  • VS2008——调试方法大全

    一 断点调试 总结以下VS2008的调试方法 xff0c 首先最常用的就是使用断点了 xff0c 断点分为两种 xff1a 普通断点 跟踪点 普通断点就是红色圆点 xff0c 跟踪点是红色菱形 可以通过右键设置断点相关内容 xff0c 让断
  • Effective C++——22.将成员变量声明为private

    1 一致性 xff1a 如果public中的每样东西都是函数 xff0c 就不需要思考使用的时候要不要带小括号 2 使用函数可以让成员变量的处理有更精确的控制 3 封装性 xff1a 有时候要根据不同情况修改set和get的实现方式 xff
  • Effective C++——4.确定对象被使用前已经初始化

    1 为防止有的情况下对象未初始化导致的混乱 xff0c 最佳的处理办法就是 xff1a 永远在使用对象之前先将它初始化 对于无任何成员的内置类型 xff0c 必须手工完成 2 内置类型以外的任何其他东西 xff0c 初始化责任在构造函数中
  • Effective C++——32.确定public继承是“is-a”关系

    1 is a关系的概念 xff0c 就是基类可以实现的事情 xff0c 子类就一定要能实现 如果不能实现 xff0c 可以修改设计 xff0c 比如将基类能实现 xff0c 子类却不能实现的事情派生出一个中间基类 记住一点 xff1a 1
  • Java中repaint方法清除原来图像问题

    虽然Java界面编程作用不大 xff0c 但在兴趣的驱使下还是了解了一下 xff0c 在写小程序的时候发现了repaint方法有时候会清理原来的图像 xff0c 有时候又不清理 下面贴出我通过API文档得出的结论 xff0c 以下例子窗口为
  • 怎样找回自己CSDN丢失博客?

    写博客是件很欢快的事情 xff0c 但没多久就发现自己刚写的博客丢失 xff0c 这是一件更加 欢快 的事情 百度了一下关于CSDN博客丢失的现象 xff0c 虽然不算很多 xff0c 但还是有个别人也同样发生了这样的情况 注 xff1a
  • 拓扑排序(队列实现)

    什么是拓扑排序呢 xff1f 就是将一个有向无环图中所有顶点在不违反先决条件关系的前提下排成线性序列的过程称为拓扑排序 学拓扑排序有什么用呢 xff1f 当然有用啦 比如说学校排课的时候 xff0c 会考虑到有的课程需要先修 我们学完C程序
  • Arch的VBox安装笔记

    Arch Version archlinux 2015 12 01 dual Virtual Box Version 5 0 16 r105871 Update xff1a 2016 03 26 17 08 18 1 分区 xff08 cf
  • Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file

    maven打包报错 org springframework boot maven BuildInfoMojo hasbeen copiled by a more recent version of the Java Runtime clas
  • 前端JS接收服务端的二进制文件流实现文件下载

    前端JS接收服务端的二进制文件流实现文件下载 var binaryData 61 binaryData push res 改成Boole或者file类型 const url 61 window URL createObjectURL new
  • debian10ssh配置用户限制,日志等

    需求 xff1a 工作端口为2021 xff1b 只允许用户user01 xff0c 密码ChinaSkill21登录到router 其他用户 xff08 包括root xff09 不能登录 xff0c 创建一个新用户 xff0c 新用户可
  • CentOS搭建PySpider爬虫服务

    1 环境准备 前置环境部署 在开始部署前 xff0c 我们需要做一些前置准备 yum 更新 yum span class hljs operator span class hljs keyword update span y span 安装
  • openGauss5.0企业版CentOS单节点安装

    目录 一 安装环境 二 前置依赖包 三 安装前准备1 四 安装前准备2 五 安装 一 安装环境 CPU xff1a 2核 内存 xff1a 4G 磁盘 xff1a 20G 操作系统 xff1a CentOS 7 9 python版本 xff