作者:葛二萌

一. openGauss单机版安装步骤

硬件及软件环境:

硬件环境:虚拟机的内存8GB,4核心CPU,900G磁盘(非必须)软件环境:CentOS7.6数据库版本:opengauss2.0企业版:openGauss-2.0.0-CentOS-64bit-all.tar.gz

注:内存一定要8G以上,不然没有足够的内存安装会失败。

安装步骤:

1.1. 关闭防火墙

#停止firewallsystemctl stop firewalld.service
#禁止firewall开机启动
systemctl disable firewalld.service
#检查防火墙是否关闭。
systemctl status firewalld

说明:若防火墙状态显示为active (running),则表示防火墙未关闭。

若防火墙状态显示为inactive (dead),则无需再关闭防火墙。

1.2. 设置时区和时间

将各数据库节点的时区设置为相同时区,可以将/usr/share/zoneinfo/目录下的时区文件拷贝为/etc/localtime文件。

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

1.3.关闭SELinux

[root@node1 ~]#

getenforce
sed -i 's/^SELINUX=./SELINUX=disabled/’ /etc/selinux/config
setenforce 0
getenforce
#检查
cat /etc/selinux/config|grep SELINUX

输出:# SELINUX= can take one of these three values:SELINUX=disabled# SELINUXTYPE= can take one of three values:SELINUXTYPE=targeted[root@node1 ~]#

1.4. 修改/etc/hosts

#添加一行

cat >>/etc/hosts <<EOF
192.168.183.28 node1
EOF

1.5. 配置库路径

cat>> /etc/profile<<EOF
export LD_LIBRARY_PATH=/opt/software/openGauss/script/gspylib/clib:KaTeX parse error: Expected 'EOF', got '&' at position 41: …></pre><h2>1.6.&̲nbsp;<b>关闭</b><… python3 -V

Python 3.6.8

其他软件包,如需要可以安装(也可以直接使用安装):

yum install -y libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel
yum install openssl -y
yum install -y java-1.8.0-openjdk* psmisc bzip2 python3 python3-devel lksctp*
reboot   #重新启动服务器 

1.6. 关闭os交换区

编辑/etc/fstab文件,将交换区的那一行注释掉

vi /etc/fstab

:wq保存退出vi

临时关闭交换区命令:

swapoff -a
free

1.7. 设置root用户远程登陆

sed -i "s/#Banner none/Banner none/g" /etc/ssh/sshd_config
cat >>/etc/ssh/sshd_config<<EOF
PermitRootLogin yes
EOFsystemctl restart sshd
#检查
cat /etc/ssh/sshd_config  | grep PermitRootLogin
cat /etc/ssh/sshd_config | grep Banner

如下显示修改正确:

PermitRootLogin yes

Banner none

1.8. 文件系统参数、系统支持的最大进程数

echo "* soft nofile 1000000" >>/etc/security/limits.conf
echo "* hard nofile 1000000" >>/etc/security/limits.conf
echo "* soft nproc unlimited" >>/etc/security/limits.conf
echo "* hard nproc unlimited" >>/etc/security/limits.conf

1.9. 安装python3.6.x

yum install openssl* -y
yum install python3* -y

检查

[omm@node1 dn]$ python3 -V

Python 3.6.8

其他软件包,如需要可以安装(也可以直接使用安装):

yum install -y libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel
yum install openssl* -y
yum install -y java-1.8.0-openjdk* psmisc bzip2 python3 python3-devel lksctp*
reboot   #重新启动服务器

1.10. 创建安装包的存放目录

mkdir -p /opt/software/openGauss
chmod 755 -R /opt/software

1.11. 下载openGauss数据库软件

下载地址为:https://opengauss.org/zh/download.html

下载完成后上传到centos机器的 /opt/software/ 目录中。

1.12. 解压缩openGauss DBMS介质

cd /opt/software/openGauss
tar -zxvf openGauss-2.0.0-CentOS-64bit-all.tar.gz
tar -zxvf openGauss-2.0.0-CentOS-64bit-om.tar.gz

1.13. 创建XML文件

下面是xml文件官方模板,一般只需要改一下自己centos机器的IP

cat > clusterconfig.xml<<EOF
<?xml version=“1.0” encoding=“UTF-8”?>
<ROOT>
<!-- openGauss整体信息 -->
<CLUSTER>
<!-- 数据库名称 -->
<PARAM name=“clusterName” value=“dbCluster” />
<!-- 数据库节点名称(hostname) -->
<PARAM name=“nodeNames” value=“node1” />
<!-- 数据库安装目录–>
<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.183.28”/>
</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.183.28”/>
<PARAM name=“sshIp1” value=“192.168.183.28”/>
<!–dbnode–>
<PARAM name=“dataNum” value=“1”/>
<PARAM name=“dataPortBase” value=“26000”/>
<PARAM name=“dataNode1” value="/opt/huawei/install/data/dn"/>
<PARAM name=“dataNode1_syncNum” value=“0”/>
</DEVICE>
</DEVICELIST>
</ROOT>
EOF

1.14. 检查环境变量

echo $LD_LIBRARY_PATH

1.15. 安装前进行交互式检查

[root@node1 script]#  ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.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 pssh path
Successfully set core path.
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: omm123
Please enter password for cluster user again.
Password: omm123
Successfully created [omm] user on all nodes.
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.
Setting SCTP service.
Successfully set SCTP service.
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.
Set ARM Optimization.
No need to set ARM Optimization.
Fixing server package owner.
Setting finish flag.
Successfully set finish flag.
Preinstallation succeeded

1.16. 开始安装openGauss DBMS和创建数据库

使用root执行如下命令

cd /opt/software/openGauss/script
chmod -R 755 /opt/software/openGauss/script
chown -R omm:dbgrp /opt/software/openGauss/script

使用omm用户安装openGauss DBMS和创建openGauss数据库

su - omm
cd /opt/software/openGauss/script
cp ../clusterconfig.xml .
gs_install -X /opt/software/openGauss/script/clusterconfig.xml

重要提示:用户需根据提示输入数据库的密码,密码需要具有一定的复杂度,为保证用户正常使用该数据库,请记住输入的数据库密码。此处建议密码设置为huawei@1234

[omm@node1 ~]$ cd /opt/software/openGauss/script
[omm@node1 script]$ cp ../clusterconfig.xml .
[omm@node1 script]$ gs_install -X /opt/software/openGauss/script/clusterconfig.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:huawei@1234
Please repeat for database:huawei@1234
begin to create CA cert files
The sslcert will be generated in /opt/huawei/install/app/share/sslcert/om
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.
Successfully started cluster.
Successfully installed application.
end deploy..

查看数据库状态:

[omm@node1 script]$ gs_om -t status

会出现以下内容:


cluster_name    : dbCluster
cluster_state   : Normal
redistributing  : No
---------------------------------------------------------------------
[omm@node1 script]$

启动数据库(安装完默认已经启动):

[omm@node1 db1]$ gs_om -t start

Starting cluster.

=========================================

[SUCCESS] node1:

[2021-04-01 16:50:13.969][29784][][gs_ctl]: gs_ctl started,datadir is /opt/huawei/install/data/dn

[2021-04-01 16:50:13.974][29784][][gs_ctl]: another server might be running; Please use the restart command

=========================================

Successfully started.

使用omm用户执行下面的操作。

登录到数据库,

gsql -d postgres -p 26000 -r
#执行上条命令会出现以下提示内容。
gsql ((openGauss 2.0.0 build 78689da9) compiled at 2021-03-31 21:04:03 commit 0 last mr  )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

基本的建表、插入、查询操作:

其他基本的命令

\q  #退出会话
gs_om  -t stop #关闭数据库
gs_om  -t restart  #重启数据库

更多操作使用说明见openGauss官网: https://opengauss.org/zh/docs/2.1.0/docs/Quickstart/Quickstart.html

二. 总结
安装过程步骤虽有一点多,但是不太复杂,值得注意的是机器内存要不少于8G内存,少于8G则安装不成功(亲试)。

【参赛作品97】openGauss单机版安装步骤相关推荐

  1. ES单机版安装步骤详解

    本篇博客的主要目的是介绍ES单机版的安装方式. elasticsearch-5.4.3.tar.gz 百度云地址链接:https://pan.baidu.com/s/1z9yA2Ai34ZqiteMM ...

  2. 【参赛作品14】Windows安装华为openGauss数据库——openGauss基于x86架构openEuler虚拟机的编译以及JDBC的连接

    1.Hype-V虚拟机安装openEuler 虚拟机平台有很多,像vmware.Hype-V.VirtualBox等等,考虑到与wsl2的兼容,这里选用Hype-V来安装x86架构的openEuler ...

  3. HBase单机版安装详细步骤

    HBase介绍 HBase是一个分布式的.面向列的开源数据库,该技术来源于 Fay Chang 所撰写的Google论文"Bigtable:一个结构化数据的分布式存储系统".就像B ...

  4. Oracle Primavera P6 R84单机版安装教程

    本教程用于指导Oracle Primavera P6 R84版本的单机版安装过程.P6 R84版本于2014年9月30日发布.其功能较之前版本有较大提升.单机版的安装方式也发生了很大的变化.P6 R8 ...

  5. 《SolidCAM+SolidWorks 2014中文版数控加工从入门到精通》——1.2 SolidCAM安装步骤

    本节书摘来自异步社区<SolidCAM+SolidWorks 2014中文版数控加工从入门到精通>一书中的第1章,第1.2节,作者:赵罘 , 杨晓晋 , 刘玥著,更多章节内容可以访问云栖社 ...

  6. 单机版安装,伪分布式安装

    单机版安装,伪分布式安装 单机版安装:适合做一些调试,mapreduce调试(debug),实际开发中不用 伪分布式安装:在一台服务器上模拟出来多台服务器的效果(模拟多服务的启动方式) 官网地址 单机 ...

  7. GBase 8c V5 单机版安装示例

    GBase 8c V5 单机版安装示例 一.前言 二.准备 三.安装 四.数据库启停 五.卸载 六.连接和 SQL 测试 一.前言 GBase 8c 是 GBASE公司(天津南大通用数据技术股份有限公 ...

  8. Greenplum【部署 07】6.19.0详细安装步骤libnsl/libcrypto/libssl/libreadline No such file or directory 问题解决

    问题解决所需文件网盘资源: 链接:https://pan.baidu.com/s/1uMrhVmHlvEQ-sEGZtqhqiw 提取码:kkab 文件列表: libnsl-2.17.so libcr ...

  9. Greenplum 单机版安装问题及解决记录

    安装步骤及资源见连接[Linux部署]Greenplum单机版(CentOS Linux release 7.5)详细步骤+问题解决(含安装包 greenplum-db-6.13.0-rhel7-x8 ...

最新文章

  1. 为什么Python没有main函数?
  2. java成员变量和局部变量的初始化和内存中的运行机制
  3. FlashCC学习札记
  4. Verilog实现AXI4-Lite源代码
  5. [转]bad interpreter:No such file or directory的原因
  6. 四边形不等式优化-石子合并
  7. 互联网晚报 | 9/28星期三 | 微信退群可选保留聊天记录 ;iPhone 14 Pro被吐槽信号差;​贾跃亭率获1亿美元融资...
  8. 通过bat文件批量判断url地址的状态
  9. 局域网在线计算机扫描仪,局域网内也共享扫描仪
  10. 联想新计算机开机黑屏,联想笔记本开机黑屏怎么办
  11. 张柏芝感动落泪:“没有任何一份礼物珍贵过两个儿子!”
  12. 00 SQL课程简介
  13. 第14节 三个败家子(14)——在辉煌中走向深渊
  14. Intellidea创建maven project遇到的问题
  15. Composing Photos Like a Photographer_2021_CVPR论文笔记
  16. uni一t 说明书_UNI-T 优利德 UT202 钳形万用表 日常生活使用体验
  17. mysql连接不上 显示密码错误,mysql输入正确密码连接不上怎么办
  18. 合肥工业大学2021离散数学上机实验一
  19. 2019年中升学季3K-4K预算笔记本电脑推荐
  20. 无人驾驶 -- 自行车模型感悟

热门文章

  1. 蓝牙宠物食物称重碗方案开发
  2. java jfreechart 折线图_java程序使用JfreeChart画折线图
  3. JavaScript实现动态添加员工信息
  4. Windows9x系统下汉字输入法的基本原理
  5. win7防火墙入站规则
  6. android bluetooth——蓝牙的开启、搜索、配对与连接
  7. LPN(Request,Offer,Poll / Update,Establish,Cache)
  8. 互斥锁的应用与pthread_mutex_destory的出错
  9. 能排毒的芦笋海苔三明治
  10. 告别疫情红利Q1同比转亏,声网的护城河为何护不住盈利?