1.下载安装包
https://cdn-mogdb.enmotech.com/mogdb-media/3.0.3/MogDB-3.0.3-CentOS-x86_64.tar.gz
2.配置clusterconfig.xml
<?xml version="1.0" encoding="UTF-8"?> <ROOT> <!-- MogDB整体信息 --> <CLUSTER> <!-- 数据库名称 --> <PARAM name="clusterName" value="dbCluster" /> <!-- 数据库节点名称(hostname一致) --> <PARAM name="nodeNames" value="test98" /> <!-- 数据库安装目录--> <PARAM name="gaussdbAppPath" value="/data/mogdb/install/app" /> <!-- 日志目录--> <PARAM name="gaussdbLogPath" value="/var/log/omm" /> <!-- 临时文件目录--> <PARAM name="tmpMppdbPath" value="/data/mogdb/tmp" /> <!-- 数据库工具目录--> <PARAM name="gaussdbToolPath" value="/data/mogdb/install/om" /> <!-- 数据库core文件目录--> <PARAM name="corePath" value="/data/mogdb/corefile" /> <!-- 节点IP,与数据库节点名称列表一一对应 --> <PARAM name="backIp1s" value="192.168.0.98"/> </CLUSTER> <!-- 每台服务器上的节点部署信息 --> <DEVICELIST> <!-- 节点1上的部署信息 --> <DEVICE sn="ds125"> <!-- 节点1的主机名称 --> <PARAM name="name" value="test98"/> <!-- 节点1所在的AZ及AZ优先级 --> <PARAM name="azName" value="AZ1"/> <PARAM name="azPriority" value="1"/> <!-- 节点1的IP,如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP --> <PARAM name="backIp1" value="192.168.0.98"/> <PARAM name="sshIp1" value="192.168.0.98"/> <!--dbnode--> <PARAM name="dataNum" value="1"/> <PARAM name="dataPortBase" value="5400"/> <PARAM name="dataNode1" value="/data/mogdb/install/data/dn"/> <PARAM name="dataNode1_syncNum" value="0"/> </DEVICE> </DEVICELIST> </ROOT> 原文链接:https://blog.csdn.net/okc_champion/article/details/127924769
3.安装依赖
yum install -y libaio-devel gcc gcc-c++ zlib-devel expect
4.配置安装
mkdir -p /data/mogdb chmod 755 -R /data/mogdb cd /data/mogdb vi clusterconfig.xml ##将第二步的内容配置好
5.安装mogdb
1)解压
tar zxvf MogDB-3.0.3-CentOS-x86_64.tar.gz tar zxvf MogDB-3.0.3-CentOS-64bit.tar.gz tar zxvf MogDB-3.0.3-CentOS-64bit-om.tar.gz tar zxvf MogDB-3.0.3-CentOS-64bit-cm.tar.gz
2)配置Lib
export LD_LIBRARY_PATH=/data/mogdb/script/gspylib/clib:$LD_LIBRARY_PATH
3)确认hostname(与主机名一致)
hostname vi /etc/hostname 或 hostname test98
4)确认并安装python3
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz mkdir -p /usr/local/python3 tar zxvf Python-3.6.5.tgz cd Python-3.6.5 ./configure --prefix=/usr/local/python3 --enable-shared CFLAGS=-fPIC && make && make install ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
5)初始化,密码要yes进行配置,要三种类型的字符
/data/mogdb/script/gs_preinstall -U omm -G dbgrp -X /data/mogdb/clusterconfig.xml
6)安装
chown -R omm:dbgrp /opt/software/mogdb/lib chown -R omm:dbgrp /opt/software/mogdb/script chown -R omm:dbgrp /opt/software/mogdb/tmp chown -R omm:dbgrp /opt/software/mogdb/install
su omm gs_install -X /data/mogdb/clusterconfig.xml --gsinit-parameter="--locale=en_US.UTF-8" --gsinit-parameter="--encoding=UTF-8"
7)连接
[root@test98 ~]# su omm [omm@test98 ~]$ gsql -d postgres -p 5400 -r gsql ((MogDB 3.0.3 build 23ba838d) compiled at 2022-10-22 09:50:41 commit 0 last mr ) Non-SSL connection (SSL connection is recommended when requiring high-security) Type "help" for help. MogDB=#\l
6.问题
1)初始化时 The port [5400] is occupied or the ip address is incorrectly configured.
注意配置文件中的端口是否使用,IP是否正常。
2)安装时FATAL: could not create shared memory segment: Cannot allocate memory
#1,先创建swap分区文件 dd if=/dev/zero of=/tmp/swap bs=1M count=8 #2,格式化swap分区文件 mkswap /swapfile #3,激活swap分区 swapon /swapfile ##swapoff /swapfile 关闭 #4,查看swap是否启用正常 free -h
参考:
https://blog.csdn.net/okc_champion/article/details/127924769
https://www.31idc.com/helpcontent/54.html
标签:tar,MogDB,mogdb,omm,3.0,安装,python3 From: https://www.cnblogs.com/julian-chang/p/16917925.html