专业只做数据库实训和认证的品牌机构

微信公众号新浪微博
免费咨询电话:400-0909-964
当前位置: 网站首页 > opengauss > 安装openGauss:准备安装用户及环境

安装openGauss:准备安装用户及环境

文章来源: 更新时间:2020/8/17 10:32:56

在线老师点击咨询:

最新学讯:近期OCP认证正在报名中,因考试人员较多请尽快报名获取最近考试时间,报名费用请联系在线老师,甲骨文官方认证,报名从速!

我要咨询

创建完openGauss配置文件后,在执行安装前,为了后续能以最小权限进行安装及openGauss管理操作,保证系统安全性,需要运行安装前置脚本gs_preinstall准备好安装用户及环境。

安装前置脚本gs_preinstall可以协助用户自动完成如下的安装环境准备工作:

自动设置Linux内核参数以达到提高服务器负载能力的目的。这些参数直接影响数据库系统的运行状态,请仅在确认必要时调整。openGauss所设置的Linux内核参数取值请参见配置操作系统参数。

自动将openGauss配置文件、安装包拷贝到openGauss主机的相同目录下。

openGauss安装用户、用户组不存在时,自动创建安装用户以及用户组。

读取openGauss配置文件中的目录信息并创建,将目录权限授予安装用户。

前提条件

已完成安装准备的所有任务。

注意事项

用户需要检查上层目录权限,保证安装用户对安装包和配置文件目录读写执行的权限。

xml文件中各主机的名称与IP映射配置正确。

只能使用root用户执行gs_preinstall命令。

操作步骤

1.以root用户登录待安装openGauss的任意主机,并按规划创建存放安装包的目录。

mkdir -p /opt/software/openGauss

chmod 755 -R /opt/software

说明:

- 不建议把安装包的存放目录规划到openGauss用户的家目录或其子目录下,可能导致权限问题。

- openGauss用户须具有/opt/software/openGauss目录的读写权限。

2.以release包为例,将安装包“openGauss_x.x.x_PACKAGES_RELEASE.tar.gz”和配置文件“clusterconfig.xml”都上传至上一步所创建的目录中。

3.在安装包所在的目录下,解压安装包。

cd /opt/software/openGauss

tar -zxvf openGauss_x.x.x_PACKAGES_RELEASE.tar.gz

解压后的安装包说明见表1。

表 1 安装包说明

openGauss-x.x.x-openEULER-64bit-ClientTools.tar.gz用于Linux的客户端工具安装包。含gsql、dump restore tool、ODBC驱动、JDBC驱动、Libpq库。

openGauss-x.x.x-openEULER-64bit-Jdbc.tar.gz用于Linux的JDBC驱动安装包。

openGauss-x.x.x-openEULER-64bit-Libpq.tar.gz用于Linux的libpq库。

openGauss-x.x.x-openEULER-64bit-Odbc.tar.gz用于Linux的ODBC驱动安装包。

openGauss-x.x.x-openEULER-64bit-symbol.tar.gz用于调试和定位数据库问题的支持文件。

openGauss-x.x.x-openEULER-64bit.tar.gz数据库管理系统安装包。即本手册使用的安装包。

openGauss-x.x.x-Sslcert.tar.gz用于客户端服务器认证的证书。

openGauss-x.x.x-Inspection.tar.gz用于检查数据库健康状况的巡检工具。

4.对openGauss-x.x.x-openEULER-64bit.tar.gz进行解压。

tar -zxvf openGauss-x.x.x-openEULER-64bit.tar.gz

安装包解压后,会在/opt/software/openGauss路径下自动生成script子目录,并且在script目录下生成gs_preinstall等各种OM工具脚本。说明:

- 在执行前置脚本gs_preinstall时,需要规划好openGauss配置文件路径、安装包存放路径、程序安装目录、实例数据目录,后续普通用户使用过程中不能再更改这些路径。

- 运行前置脚本gs_preinstall准备安装环境时,脚本内部会自动将openGauss配置文件、解压后的安装包同步拷贝到其余服务器的相同目录下。

- 在执行前置或者互信前,请检查/etc/profile文件中是否包含错误输出信息,如果存在错误输出,需手动处理。

5.进入到工具脚本存放目录下。

cd /opt/software/openGauss/script

6.如果是openEuler的操作系统,执行如下命令打开performance.sh文件,用#注释sysctl -w vm.min_free_kbytes=112640 &> /dev/null,键入“ESC”键进入指令模式,执行:wq保存并退出修改。

vi /etc/profile.d/performance.sh

7.为确保openssl版本正确,执行预安装前请加载安装包中lib库。执行命令如下,其中_{packagePath}_为用户安装包放置的路径,本示例中为/opt/software/openGauss。

export LD_LIBRARY_PATH={packagePath}/script/gspylib/clib:$LD_LIBRARY_PATH

8.为确保成功安装,检查 hostname 与 /etc/hostname 是否一致。预安装过程中,会对hostname进行检查。

9.使用gs_preinstall准备好安装环境。若为共用环境需加入–sep-env-file=ENVFILE参数分离环境变量避免与其他用户相互影响,ENVFILE为用户自行指定的环境变量分离文件的路径。

·采用交互模式执行前置,并在执行过程中自动创建root用户互信和openGauss用户互信:

./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml

omm为数据库管理员(也是运行openGauss的操作系统用户),dbgrp为运行openGauss的操作系统用户的群组名称,/opt/software/openGauss/clusterconfig.xml为openGauss配置文件路径。在执行过程中,用户根据提示选择是否创建互信,并输入root用户或openGauss用户的密码。

·不允许创建root用户互信时,创建omm用户,在各主机上执行本地模式前置,然后用户手动创建openGauss用户互信:如果预安装指定-L参数,预安装前需手动将所有节点的主机名和ip映射关系,写入各个主机的/etc/hosts,并在每个映射关系后边加入注释内容:#Gauss OM IP Hosts Mapping。

1.执行下面命令准备安装环境。

cd /opt/software/openGauss/script

./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/clusterconfig.xml

说明:

此操作需要在每台主机上执行该命令。

·采用非交互模式执行前置:

1.参考手工建立互信章节手工建立root用户互信和openGauss用户互信。

2.执行下面命令准备安装环境。

cd /opt/software/openGauss/script

./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml --non-interactive

说明:

- 此模式要求用户确保在执行前,已经建立了各节点root用户互信和openGauss用户互信。

- root用户互信可能会存在安全隐患,因此建议用户在执行完安装后,立即删除各主机上root用户的互信。

示例

执行前置脚本:

plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/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.

Are you sure you want to create trust for root (yes/no)? yes

Please enter password for root.

Password:

Creating SSH trust for the root permission user.

Checking network information.

All nodes in the network are Normal.

Successfully checked network information.

Creating SSH trust.

Creating the local key file.

Successfully created the local key files.

Appending local ID to authorized_keys.

Successfully appended local ID to authorized_keys.

Updating the known_hosts file.

Successfully updated the known_hosts file.

Appending authorized_key on the remote node.

Successfully appended authorized_key on all remote node.

Checking common authentication file content.

Successfully checked common authentication content.

Distributing SSH trust file to all node.

Successfully distributed SSH trust file to all node.

Verifying SSH trust on all hosts.

Successfully verified SSH trust on all hosts.

Successfully created SSH trust.

Successfully created SSH trust for the root permission user.

Setting pssh path

Successfully set core path.

Distributing package.

Begin to distribute package to tool path.

Successfully distribute package to tool path.

Begin to distribute package to package path.

Successfully distribute package to package path.

Successfully distributed package.

Are you sure you want to create the user[omm] and create trust for it (yes/no)? yes

Please enter password for cluster user.

Password:

Please enter password for cluster user again.

Password:

Successfully created [omm] user on all nodes.

Preparing SSH service.

Successfully prepared SSH service.

Installing the tools in the cluster.

Successfully installed the tools in the cluster.

Checking hostname mapping.

Successfully checked hostname mapping.

Creating SSH trust for [omm] user.

Checking network information.

All nodes in the network are Normal.

Successfully checked network information.

Creating SSH trust.

Creating the local key file.

Successfully created the local key files.

Appending local ID to authorized_keys.

Successfully appended local ID to authorized_keys.

Updating the known_hosts file.

Successfully updated the known_hosts file.

Appending authorized_key on the remote node.

Successfully appended authorized_key on all remote node.

Checking common authentication file content.

Successfully checked common authentication content.

Distributing SSH trust file to all node.

Successfully distributed SSH trust file to all node.

Verifying SSH trust on all hosts.

Successfully verified SSH trust on all hosts.

Successfully created SSH trust.

Successfully created SSH trust for [omm] user.

Checking OS software.

Successfully check os software.

Checking OS version.

Successfully checked OS version.

Creating cluster's path.

Successfully created cluster's path.

Setting SCTP service.

Successfully set SCTP service.

Set and check OS parameter.

Setting OS parameters.

Successfully set OS parameters.

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.

Set ARM Optimization.

No need to set ARM Optimization.

Fixing server package owner.

Setting finish flag.

Successfully set finish flag.

Preinstallation succeeded.

S


root密码不一致也不能修改为一致,执行前置脚本本地安装模式:

plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -L -X /opt/software/openGauss/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.

Checking OS version.

Successfully checked OS version.

Creating cluster's path.

Successfully created cluster's path.

Setting SCTP service.

Successfully set SCTP service.

Set and check OS parameter.

Setting OS parameters.

Successfully set OS parameters.

Warning: Installation environment contains some warning messages.

Please get more details by "/home/package/r8c00/script/gs_checkos -i A -h SIA1000068990".

Set and check OS parameter completed.

Preparing CRON service.

Successfully prepared CRON service.

Preparing SSH service.

Successfully prepared SSH service.

Setting user environmental variables.

Successfully set user environmental variables.

Configuring alarms on the cluster nodes.

Successfully configured alarms on the cluster nodes.

Setting the dynamic link library.

Successfully set the dynamic link library.

Setting Cgroup.

Successfully set Cgroup.

Setting finish flag.

Successfully set finish flag.

Preinstallation succeeded.


以非交互模式执行前置:

plat1:/opt/software/openGauss/script # ./gs_preinstall -U omm -G dbgrp -X /opt/software/openGauss/clusterconfig.xml --non-interactive

Parsing the configuration file.

Successfully parsed the configuration file.

Installing the tools on the local node.

Successfully installed the tools on the local node.

Distributing package.

Begin to distribute package to tool path.

Successfully distribute package to tool path.

Begin to distribute package to package path.

Successfully distribute package to package path.

Successfully distributed package.

Installing the tools in the cluster.

Successfully installed the tools in the cluster.

Checking hostname mapping.

Successfully checked hostname mapping.

Checking OS version.

Successfully checked OS version.

Creating cluster's path.

Successfully created cluster's path.

Setting SCTP service.

Successfully set SCTP service.

Set and check OS parameter.

Setting OS parameters.

Successfully set OS parameters.

Set and check OS parameter completed.

Preparing CRON service.

Successfully prepared CRON service.

Preparing SSH service.

Successfully prepared SSH service.

Setting user environmental variables.

Successfully set user environmental variables.

Configuring alarms on the cluster nodes.

Successfully configured alarms on the cluster nodes.

Setting the dynamic link library.

Successfully set the dynamic link library.

Setting Cgroup.

Successfully set Cgroup.

Set ARM Optimization.

Successfully set ARM Optimization.

Setting finish flag.

Successfully set finish flag.

Preinstallation succeeded.


错误排查

如果准备安装环境失败请根据openGauss日志目录“$GAUSSLOG/om”下的“gs_preinstall-YYYY-MM-DD_HHMMSS.log”和“gs_local-YYYY-MM-DD_HHMMSS.log”中的日志信息排查错误。例如配置文件中“gaussdbLogPath”参数指定的路径为“/var/log/gaussdb”,则“$GAUSSLOG/om”路径为“/var/log/gaussdb/omm/om”,omm用户为运行openGauss的用户。

须知:

准备安装用户及环境的过程中会使用root添加定时任务用于定时巡检和上报。

本文地址:http://www.cuug.com.cn/opengauss/25388118647.html 转载请注明!


在线预约 抢先报名 获取课程排期

Oracle培训机构

金牌讲师<>

冉乃纲-老师CUUG金牌讲师
冉老师 CUUG金牌讲师 Oracle及RedHat高级讲师、Unix/Linux 资深专家...[详细了解老师]

免费咨询上课流程 客服在线中

陈卫星-老师CUUG金牌讲师
陈老师 CUUG金牌讲师 精通Oracle管理、备份恢复、性能优化 11年Ora...[详细了解老师]

免费咨询上课流程 客服在线中

选学校如何选择适合自己的学校

CUUG -CHINA UNIX USER GROUP,是国际UNIX组织UNIFORUM的中国代表,是国内悠久的专业UNIX培训机构,被誉为中国UNIX 的摇篮。多年来,以提高教学质量为本,强调素质教育,积极引进、消化国外的新技术,有效的结合中国....[详情]

一站式服务(从入学到就业一帮到底)

入学

学习

就业

实操

食宿
地址:北京市海淀区田村山南路35号院17号楼
课程咨询:010-59426307 010-59426319 400-0909-964
企业服务:137 1818 8639(陈经理)
部分信息来源于网络,如有错误请联系指正!
版权所有@北京神脑资讯技术有限公司 (CUUG,中国UNIX用户协会) Copyright 2016 ALL Rights Reserved 京ICP备11008061号-1