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

openGauss训练营学习心得之OpenGauss 3.0.0 轻量版单机安装初体验

原创 Harbin70KG 2022-05-19
2397

背景

写在前面,刚刚参加了5月14日和15日的8小时玩转openGauss训练营(第三期),让我对opengauss有了初步的了解,干货满满,知识点超级多,感谢主办方的精彩课程,8小时只是开始,还懵懵懂懂,训练营结束后,需要不断练习巩固,需要更多的时间,去完善自己的知识体系,

所以有了这篇文章,利用虚拟机体验一下OpenGauss 3.0.0 轻量版的安装部署

硬件环境

硬件信息:16c16g 1T SSD

软件:VMware Workstation 15 Pro

ISO:镜像CentOS-7-x86_64-DVD-2003

OpenGauss版本:3.0.0轻量版

虚拟机VM数量:1个

VM配置:4c8g 硬盘60G

软件包准备:

软件包下载地址:https://opengauss.org/zh/download.html

操作系统配置准备:

关闭防火墙和SELINUX

# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config 
# setenforce 0   
# systemctl stop firewalld && systemctl disable firewalld   
# getenforce
Disabled
# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

关闭THP

    vi /etc/rc.d/rc.local
    1:新增:
    #add
    if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
    echo never > /sys/kernel/mm/transparent_hugepage/enabled
    fi
    if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
    echo never > /sys/kernel/mm/transparent_hugepage/defrag
    fi
    2:授权执行:
    chmod +x /etc/rc.d/rc.local
    3:重启后生效(这里先不要重启)

配置内核参数

执行install.sh脚本安装openGauss出现以下错误
On systemwide basis, the maximum number of SEMMNI is not correct. the current SEMMNI value is: 128. Please check it.
需要:在/etc/sysctl.conf中加入语句kernel.sem = 250 32000 100 999,然后执行sysctl -p(其他参数未配置不会报错)

    echo "fs.file-max = 1000000">> /etc/sysctl.conf
    echo "net.core.somaxconn = 32768">> /etc/sysctl.conf
    echo "net.ipv4.tcp_tw_recycle = 0">> /etc/sysctl.conf
    echo "net.ipv4.tcp_syncookies = 0">> /etc/sysctl.conf
    echo "vm.overcommit_memory = 1">> /etc/sysctl.conf
    echo "kernel.sem = 250 32000 100 999">> /etc/sysctl.conf

配置limits.conf

cat << EOF >>/etc/security/limits.conf
    *          soft    nofile          1000000
    *          hard    nofile          1000000
    *          soft    stack          32768
    *          hard    stack          32768

安装需要使用普通用户,使用root会报错

创建安装用户和组

groupadd dbgrp 
useradd -g dbgrp -d /home/omm -m -s /bin/bash omm 
echo "70kg" | passwd --stdin omm
Changing password for user omm.
passwd: all authentication tokens updated successfully.

创建安装目录

[root@Harbin70KG ~]# mkdir /opengauss

解压安装包到安装目录

tar -zxvf /soft/openGauss-Lite-3.0.0-CentOS-x86_64.tar.gz  -C /opengauss/
    ./dependency/
    ./dependency/libstdc++.so.6
    ./install.sh
    ./openGauss-Lite-3.0.0-CentOS-x86_64.bin
    ./openGauss-Lite-3.0.0-CentOS-x86_64.sha256
    ./opengauss_lite.conf
    ./uninstall.sh
    ./upgrade_common.sh
    ./upgrade_config.sh
    ./upgrade_errorcode.sh
    ./upgrade_GAUSSV5.sh
    ./upgrade_sql.sha256
    ./upgrade_sql.tar.gz
    ./version.cfg

操作系统检查

阅读install.sh发现安装脚本有操作系统的检查,
推荐使用centOS7.6以上或者openEule操作系统安装openGauss

[omm@Harbin70KG /opengauss]$grep openEuler  install.sh -n
549:    elif [ -f "/etc/openEuler-release" ]
551:        kernel=$(cat /etc/openEuler-release | awk -F ' ' '{print $1}')    

给安装目录授权

chown  -R omm:dbgrp /opengauss/
chmod  -R 755 /opengauss/

开始安装

切换omm用户安装

会检查操作系统配置等信息

[omm@Harbin70KG /opengauss]$echo OpenGauss@70kg | sh ./install.sh --mode single -D /opengauss/data -R /opengauss/install  --start
    info:[check install env and os setting success.]
    info:[set GAUSSDATA environment variables success.]
    export PATH=/opengauss/install/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/omm/.local/bin:/home/omm/bin >> /home/omm/.bashrc
    export LD_LIBRARY_PATH=/opengauss/install/lib:/opengauss/dependency: >> /home/omm/.bashrc
    info:[set GAUSSHOME environment variables success.]
    kernel: CentOS
    bin file: openGauss-Lite-3.0.0-CentOS-x86_64.bin
    verification file: openGauss-Lite-3.0.0-CentOS-x86_64.sha256
    info:[begin decompressing binary files success.]
    
    info:run cmd 'source /home/omm/.bashrc' to make the environment variables take effect.

安装完成后的相关配置

配置环境变量

[omm@Harbin70KG /opengauss]$source /home/omm/.bashrc

查看相关进程和状态

[omm@Harbin70KG /opengauss]$ps aux | grep gaussdb
    omm        7184  1.8  4.0 2250096 330568 ?      Ssl  22:48   0:00 /opengauss/install/bin/gaussdb -D /opengauss/data
    omm        7237  0.0  0.0 112816   980 pts/0    S+   22:48   0:00 grep --color=auto gaussdb

登录数据库

[omm@Harbin70KG /opengauss]$gsql -d postgres
gsql ((openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:29:12 commit 0 last mr  release)
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.


总结

OpenGauss 3.0.0 轻量版的安装部署和postgresql单机安装部署还是有一些差别的,最后感谢openGauss训练营活动,

希望大家收获的不仅仅是openGauss!!!

最后修改时间:2022-05-20 10:32:31
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论