【openGauss学习】CentOS7.9系统安装单节点集群
1.实验环境工具
VMware Workstation 16.1.1 MobaXterm Personal Edition v21.1
2.实验资源规划
CPU:2C MEM:8GB DSK:20GB NIC:ens32(host-only)/ens33(nat) CentOS7.9 Minimal Install(勾选“Compatibility Libraries”、“Development Tools”和“System Administration Tools”)
3.系统环境准备
yum -y install python3 libaio-devel ncurses-devel glibc-devel redhat-lsb readline-devel systemctl disable firewalld sed -i 's/enforcing/disabled/g' /etc/selinux/config sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab echo "192.168.10.90 ogdb">>/etc/hosts echo "CentOS Linux release 7.6.1810 (Core)">/etc/centos-release groupadd dbgrp && useradd -g dbgrp omm cat << EOF >>/etc/sysctl.conf 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 << EOF >>/etc/systemd/system.conf DefaultLimitNOFILE=1000000 DefaultLimitNPROC=unlimited EOF shutdown -r now
4.数据库配置文件准备(/tmp/cluster_config.xml)
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<!-- openGauss整体信息 -->
<CLUSTER>
<PARAM name="clusterName" value="dbCluster" />
<PARAM name="nodeNames" value="ogdb" />
<PARAM name="gaussdbAppPath" value="/opt/ogdb/install/app" />
<PARAM name="gaussdbLogPath" value="/var/log/omm" />
<PARAM name="tmpMppdbPath" value="/opt/ogdb/tmp" />
<PARAM name="gaussdbToolPath" value="/opt/ogdb/install/om" />
<PARAM name="corePath" value="/opt/ogdb/corefile" />
<PARAM name="backIp1s" value="192.168.10.90"/>
</CLUSTER>
<!-- 每台服务器上的节点部署信息 -->
<DEVICELIST>
<!-- node1上的节点部署信息 -->
<DEVICE sn="ogdb">
<PARAM name="name" value="ogdb"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- 如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
<PARAM name="backIp1" value="192.168.10.90"/>
<PARAM name="sshIp1" value="192.168.10.90"/>
<!--dbnode-->
<PARAM name="dataNum" value="1"/>
<PARAM name="dataPortBase" value="15400"/>
<PARAM name="dataNode1" value="/opt/ogdb/install/data/dn"/>
<PARAM name="dataNode1_syncNum" value="0"/>
</DEVICE>
</DEVICELIST>
</ROOT>
5.安装文件准备
上传openGauss-2.0.0-CentOS-64bit-all.tar.gz文件到/tmp tar -zxvf openGauss-2.0.0-CentOS-64bit-all.tar.gz tar -zxvf openGauss-2.0.0-CentOS-64bit-om.tar.gz
6.数据库安装环境准备及检查
/tmp/script/gs_preinstall -U omm -G dbgrp -L -X /tmp/cluster_config.xml /tmp/script/gs_checkos -i A --detail
7.安装单节点数据库
chmod 777 /tmp su - omm gs_install -X /tmp/cluster_config.xml --gsinit-parameter="--locale=en_US.utf8"
8.初始化数据库
gsql -d postgres -p 15400 create database mydb with encoding 'UTF8' template=template0;
9.查看数据库状态
gs_om -t status ----------------------------------------------------------------------- cluster_name : dbCluster cluster_state : Normal redistributing : No -----------------------------------------------------------------------
10.安装目录结构
序号 | 类型 | 目录 | 说明 |
---|---|---|---|
1 | 软件安装目录 | /opt/ogdb/install/app | |
2 | 数据存放目录 | /opt/ogdb/install/data/dn | |
3 | 日志存放目录 | /var/log/omm/omm | |
4 | 系统工具目录 | /opt/ogdb/install/om | |
5 | core文件目录 | /opt/ogdb/corefile | |
6 | 临时文件目录 | /opt/ogdb/tmp |
12.单节点集群启停
gs_om -t stop Stopping cluster. ========================================= Successfully stopped cluster. ========================================= End stop cluster. gs_om -t start Starting cluster. ========================================= [SUCCESS] ogdb ========================================= Successfully started.
13.数据库软件卸载
/tmp/script/gs_uninstall --delete-date -L rm -rf /opt/ogdb
最后修改时间:2021-05-28 08:54:47
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。