1.環境說明
[omm@node1 bak]$ cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
[omm@node1 bak]$ lscpu
Architecture: x86_64
說明:使用om工具需要python3,而centos7.6是python2,有網的情況直接yum install -y python3,無網則需要手動編譯Python3,https://docs.mogdb.io/zh/mogdb/v3.0/standard-installation
2.檢查環境
systemctl disable firewalld.service
systemctl stop firewalld.service
setenforce=0
sed -i '/^SELINUX=/c'SELINUX=disabled /etc/selinux/config
3.安裝基礎包
yum install -y libaio-devel
yum install -y bzip2 libaio-devel flex bison ncurses-devel glibc-devel libxml2-devel patch redhat-lsb-core unzip gcc gcc-c++ perl openssl-devel libffi-devel libtool zlib-devel
4.規劃安裝目錄
mkdir -p /opt/software/mogdb
cd /opt/software/mogdb
chmod -R 755 /opt/software/mogdb/
[root@node1 mogdb]# wget https://cdn-mogdb.enmotech.com/mogdb-media/3.0.1/MogDB-3.0.1-CentOS-x86_64.tar.gz
--2022-08-31 23:31:26-- https://cdn-mogdb.enmotech.com/mogdb-media/3.0.1/MogDB-3.0.1-CentOS-x86_64.tar.gz
正在解析主機 cdn-mogdb.enmotech.com (cdn-mogdb.enmotech.com)... 124.236.20.228
正在連接 cdn-mogdb.enmotech.com (cdn-mogdb.enmotech.com)|124.236.20.228|:443... 已連接。
已發出 HTTP 請求,正在等待回應... 200 OK
長度:139264406 (133M) [application/gzip]
正在保存至: “MogDB-3.0.1-CentOS-x86_64.tar.gz”
100%[============================================================================================================================================>] 139,264,406 13.0MB/s 用時 10s
2022-08-31 23:31:36 (12.8 MB/s) - 已保存 “MogDB-3.0.1-CentOS-x86_64.tar.gz” [139264406/139264406])
[root@node1 mogdb]# tar -xf MogDB-3.0.1-CentOS-x86_64.tar.gz
[root@node1 mogdb]# tar -xf MogDB-3.0.1-CentOS-64bit-om.tar.gz
5 .編寫配置文件(單機)
[root@node1 mogdb]# cat clusterconfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<!-- MogDB整體信息 -->
<CLUSTER>
<PARAM name="clusterName" value="dbCluster" />
<PARAM name="nodeNames" value="node1" />
<PARAM name="backIp1s" value="172.24.11.219"/>
<PARAM name="gaussdbAppPath" value="/opt/mogdb/app" />
<PARAM name="gaussdbLogPath" value="/var/log/mogdb" />
<PARAM name="gaussdbToolPath" value="/opt/enmo/wisequery" />
<PARAM name="corePath" value="/opt/mogdb/corefile"/>
<PARAM name="clusterType" value="single-inst"/>
</CLUSTER>
<!-- 每臺服務器上的節點部署信息 -->
<DEVICELIST>
<!-- mogdb-kernel-0005上的節點部署信息 -->
<DEVICE sn="1000001">
<PARAM name="name" value="node1"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- 如果服務器只有一個網卡可用,將backIP1和sshIP1配置成同一個IP -->
<PARAM name="backIp1" value="172.24.11.219"/>
<PARAM name="sshIp1" value="172.24.11.219"/>
<!--dbnode-->
<PARAM name="dataNum" value="1"/>
<PARAM name="dataPortBase" value="26000"/>
<PARAM name="dataNode1" value="/opt/mogdb/data"/>
</DEVICE>
</DEVICELIST>
</ROOT>
5.預安裝
[root@node1 opt]# /opt/software/mogdb/script/gs_preinstall -U omm -G dbgrp -X /opt/software/mogdb/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 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/mogdb/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.
6.正式安裝
[root@node1 opt]# cd /opt/software/mogdb/script
[root@node1 script]# chmod -R 755 /opt/software/mogdb/script
[root@node1 script]# chown -R omm:dbgrp /opt/software/mogdb/script
[root@node1 script]# su - omm
上一次登錄:三 8月 31 23:42:06 CST 2022
[omm@node1 ~]$ /opt/software/mogdb/script/gs_install -X /opt/software/mogdb/clusterconfig.xml --gsinit-parameter="--locale=en_US.UTF-8" --gsinit-parameter="--encoding=UTF-8"
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 /opt/mogdb/app/share/sslcert/om
NO cm_server instance, no need to create CA for CM.
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..
7.測試鏈接
su - omm
gsql ((MogDB 3.0.1 build 1a363ea9) compiled at 2022-08-05 17:31:04 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
MogDB=# select version();
version
--------------------------------------------------------------------------------------------------------------------------------------------------
(MogDB 3.0.1 build 1a363ea9) compiled at 2022-08-05 17:31:04 commit 0 last mr on x86_64-unknown-linux-gnu, compiled by g++ (GCC) 7.3.0, 64-bit
(1 row)
最后修改時間:2022-09-01 08:47:13
「喜歡這篇文章,您的關注和贊賞是給作者最好的鼓勵」
關注作者
【版權聲明】本文為墨天輪用戶原創內容,轉載時必須標注文章的來源(墨天輪),文章鏈接,文章作者等基本信息,否則作者和墨天輪有權追究責任。如果您發現墨天輪中有涉嫌抄襲或者侵權的內容,歡迎發送郵件至:contact@modb.pro進行舉報,并提供相關證據,一經查實,墨天輪將立刻刪除相關內容。




