暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Mogdb 3.0标准安装

原创 小郑同学 2022-08-31
1144

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进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论