openGauss5.0.0极简版环境搭建(4)

举报
redtea 发表于 2024/08/07 20:08:58 2024/08/07
【摘要】 openGauss5.0.0极简版环境搭建(4):安装openGauss5.0.0极简版

openGauss5.0.0极简版环境搭建(4):安装openGauss5.0.0极简版

1.set gloabal parameters

[root@openEuler2203 ~]# mkdir -p /opt/software/openGauss

[root@openEuler2203 ~]# touch /etc/profile.d/custom.sh

[root@openEuler2203 ~]# vim /etc/profile.d/custom.sh

在文末添加

export MY_HOSTNAME=openEuler2203             ## 主机名

export MY_HOSTIP=192.168.116.147             ## IP地址

export MY_SOFTWARE_DIRECTORY=/opt/software/openGauss  ## 软件包所在目录

export MY_XML=/opt/software/openGauss/clusterconfig.xml   ##集群配置XML文件

export OPENGAUSS_DOWNLOAD_URL= https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.1/x86_openEuler_2203/openGauss-5.0.0-openEuler-64bit.tar.bz2 ##openGauss安装压缩包下载地址

[root@openEuler2203 ~]# source /etc/profile.d/custom.sh

[root@openEuler2203 ~]# hostnamectl set-hostname $MY_HOSTNAME

[root@openEuler2203 ~]# vim /etc/hosts

在文末添加

192.168.116.147  openEuler2203   #openGauss OM IP Hosts Mapping

后保存退出

[root@openEuler2203 ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 locahost4.localdomain4

::1         localhost localhost.localdomain localhost6 locahost6.localdomain6

192.168.116.147  openEuler2203   #openGauss OM IP Hosts Mapping

2.Disable firewalld service

[root@openEuler2203 ~]# systemctl disable firewalld.service #使防火墙服务失效

Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.

Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@openEuler2203 ~]# systemctl stop firewalld.service #停止防火墙服务

[root@openEuler2203 ~]# systemctl status firewalld.service #查看防火墙状态

firewalld.service - firewalld - dynamic firewall daemon

     Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor prese>

     Active: inactive (dead)

       Docs: man:firewalld(1)

Mar 27 19:24:28 openEuler2203 systemd[1]: Starting firewalld - dynamic firewall daemon>

Mar 27 19:24:28 openEuler2203 systemd[1]: Started firewalld - dynamic firewall daemon.

Mar 27 19:39:00 openEuler2203 systemd[1]: Stopping firewalld - dynamic firewall daemon>

Mar 27 19:39:01 openEuler2203 systemd[1]: firewalld.service: Deactivated successfully.

Mar 27 19:39:01 openEuler2203 systemd[1]: Stopped firewalld - dynamic firewall daemon.

lines 1-10/10 (END)

[1]+  Stopped                 systemctl status firewalld.service

3.Disable SELINUX

[root@openEuler2203 ~]# echo "SELINUX=disabled" >> /etc/selinux/config

[root@openEuler2203 ~]# cat /etc/selinux/config | grep "SELINUX=disabled"

SELINUX=disabled

[root@openEuler2203 ~]# reboot #重启系统

4.Configure encoding

[root@openEuler2203 ~]# echo "LANG=en_US.UTF-8" >> /etc/profile

或者

[root@openEuler2203 ~]# vim /etc/profile

在文档末尾输入

LANG=en_US.UTF-8

[root@openEuler2203 ~]# source /etc/profile

5.Configure Timezone

[root@openEuler2203 ~]# date -R

Wed, 27 Mar 2024 19:52:08 +0800

[root@openEuler2203 ~]# hwclock

2024-03-27 19:52:30.992513+08:00

6.Close swap partition

[root@openEuler2203 ~]# swapoff -a

7.在各数据库节点上,关闭RemoveIPC

1)修改/etc/systemd/logind.conf文件中的“RemoveIPC”值为“no”

[root@openEuler2203 ~]# vim  /etc/systemd/logind.conf

RemoveIPC=no

#RuntimeDirectorySize=10%

#RuntimeDirectoryInodesMax=

RemoveIPC=no

#InhibitorsMax=8192

#SessionsMax=8192

2)修改/usr/lib/systemd/system/systemd-logind.service文件中的“RemoveIPC”值为“no”

[root@openEuler2203 ~]# echo "RemoveIPC=no" >>

 /usr/lib/systemd/system/systemd-logind.service

3)重新加载配置参数

[root@openEuler2203 ~]# systemctl daemon-reload

[root@openEuler2203 ~]# systemctl restart systemd-logind

4)检查修改是否生效

[root@openEuler2203 ~]# loginctl show-session | grep RemoveIPC

RemoveIPC=no

[root@openEuler2203 ~]# systemctl show systemd-logind | grep RemoveIPC

RemoveIPC=no

8.Configure SSH Service

[root@openEuler2203 ~]# echo "Banner none " >> /etc/ssh/sshd_config

[root@openEuler2203 ~]# echo "PermitRootLogin yes" >> /etc/ssh/sshd_config

或者

[root@openEuler2203 ~]# vim /etc/ssh/sshd_config

设置或输入

Banner none

PermitRootLogin yes

[root@openEuler2203 ~]# cat /etc/ssh/sshd_config

Banner none

PermitRootLogin yes

  1. 关闭HISTORY记录

[root@openEuler2203 ~]# echo "HISTSIZE=0 " >> /etc/profile

  1. 检查Python version

[root@openEuler2203 ~]# python3 --version

或者

[root@openEuler2203 ~]# python3 -V

Python 3.9.9

11.Configure sysctl.conf and performanc.sh

[root@openEuler2203 ~]# sysctl -w kernel.sem="250 85000 250 330"

kernel.sem = 250 85000 250 330

12.openGauss software download

[root@openEuler2203 ~]# cd $MY_SOFTWARE_DIRECTORY

[root@openEuler2203 openGauss]# wget $OPENGAUSS_DOWNLOAD_URL

--2024-03-27 21:46:48--  https://opengauss.obs.cn-south-1.myhuaweicloud.com/5.0.1/x86_openEuler_2203/openGauss-5.0.1-openEuler-64bit.tar.bz2 ##需先注册并登录opnGuass.org网站

Resolving opengauss.obs.cn-south-1.myhuaweicloud.com (opengauss.obs.cn-south-1.myhuaweicloud.com)... 122.9.127.163, 122.9.127.162

Connecting to opengauss.obs.cn-south-1.myhuaweicloud.com (opengauss.obs.cn-south-1.myhuaweicloud.com)|122.9.127.163|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 100889548 (96M) [application/x-bzip2]

Saving to: ‘openGauss-5.0.1-openEuler-64bit.tar.bz2’

openGauss-5.0.1-openE 100%[========================>]  96.21M  31.0MB/s    in 3.1s

2024-03-27 21:46:52 (31.0 MB/s) - ‘openGauss-5.0.1-openEuler-64bit.tar.bz2’ saved [100889548/100889548]

13.Uncompress openGauss Package and Modify directory permissions

[root@openEuler2203 openGauss]# ls

openGauss-5.0.0-openEuler-64bit.tar.bz2

[root@openEuler2203 openGauss]# tar -jxvf  openGauss-5.0.0-openEuler-64bit.tar.bz2

/bin/

./bin/kdb5_util

./bin/klist

......

./simpleInstall/README.md

./simpleInstall/school.sql

./simpleInstall/install.sh

./version.cfg

[root@openEuler2203 openGauss]# ls

[root@openEuler2203 openGauss]# rm -f openGauss-5.0.1-openEuler-64bit.tar.bz2

[root@openEuler2203 openGauss]# chown -R ouser:dbGroup /opt/software/openGauss/

[root@openEuler2203 openGauss]# chmod -R 755 $MY_SOFTWARE_DIRECTORY

或者

[root@openEuler2203 openGauss]# chmod g=rwx -R  $MY_SOFTWARE_DIRECTORY

[root@openEuler2203 openGauss]# chmod o=r-x -R  $MY_SOFTWARE_DIRECTORY

bin  include  lib                                      share          version.cfg

etc  jre      openGauss-5.0.0-openEuler-64bit.tar.bz2  simpleInstall

[root@openEuler2203 openGauss]# ls -l /opt/software/openGauss

total 32

drwxrwxr-x. 2 ouser dbGroup 4096 Dec 15 20:01 bin

drwxrwxr-x. 3 ouser dbGroup 4096 Dec 15 20:01 etc

drwxrwxr-x. 3 ouser dbGroup 4096 Dec 15 20:01 include

drwxrwxr-x. 4 ouser dbGroup 4096 Dec 15 20:01 jre

drwxrwxr-x. 5 ouser dbGroup 4096 Dec 15 20:01 lib

drwxrwxr-x. 5 ouser dbGroup 4096 Dec 15 20:01 share

drwxrwxr-x. 2 ouser dbGroup 4096 Dec 15 20:01 simpleInstall

-rwxrwxr-x. 1 ouser dbGroup   32 Dec 15 20:01 version.cfg

14.execute openGauss install

(1)install

[root@openEuler2203 openGauss]#su - ouser

[ouser@openEuler2203 ~]$ cd $MY_SOFTWARE_DIRECTORY

[ouser@openEuler2203 openGauss]$ ls

bin  etc  include  jre  lib  share  simpleInstall  version.cfg

[ouser@openEuler2203 openGauss]$ cd simpleInstall

[ouser@openEuler2203 simpleInstall]$ ls

finance.sql  install.sh  README.md  school.sql

sh install.sh

[ouser@openEuler2203 simpleInstall]$ sh install.sh -w "Mar152024@" -p 5432 &&source ~/.bashrc

[step 1]: check parameter

[step 2]: check install env and os setting

[step 3]: change_gausshome_owner

[step 4]: set environment variables

......

[2024-03-27 22:05:26.129][2589][][gs_ctl]:  done

[2024-03-27 22:05:26.129][2589][][gs_ctl]: server started (/opt/software/openGauss/data/single_node)

import sql file

Would you like to create a demo database (yes/no)? yes

Load demoDB [school,finance] success.

[complete successfully]: You can start or stop the database server using:

    gs_ctl start|stop|restart -D $GAUSSHOME/data/single_node -Z single_node

(2) 安装执行完成后,使用psgs_ctl查看进程是否正常

[ouser@openEuler2203 simpleInstall]$ ps ux | grep gaussdb

ouser       2592  2.1 10.2 5864372 777648 ?      Ssl  22:05   0:03 /opt/software/openGauss/bin/gaussdb -D /opt/software/openGauss/data/single_node

ouser       2868  0.0  0.0  22096  2348 pts/0    S+   22:08   0:00 grep --color=auto gaussdb

(3)查询数据库节点信息

[ouser@openEuler2203 simpleInstall]$ gs_ctl query -D /opt/software/openGauss/data/single_node

HA state:

        local_role                     : Normal

        static_connections             : 0

        db_state                       : Normal

        detail_information             : Normal

 Senders info:

No information

 Receiver info:

No information

 

【版权声明】本文为华为云社区用户原创内容,未经允许不得转载,如需转载请自行联系原作者进行授权。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。