Centos7下GBase 8a 单机安装手册

Linux系统 0 1610 张毅 收藏

1 安装规划

一共1台服务器

/u01是lvm逻辑卷挂载点

操作系统版本

架构

主机名

本地存储

安装位置

安装位置文件系统

Ip


Centos 7.3

X86_64bit

gbase01

1TB

/u01

xfs

192.168.0.241


2   系统要求

2.1  硬件配置

硬件

最低配置

推荐配置

处理器

1×2 核 2.0GHz

2×4 核 2.0GHz

内存

4GB

128GB 或更多

硬盘

SATA 7200 rpm,1TB

100GB SAS 10k rpm,1TB

光驱

CD-ROM

CD-ROM

 

2.2  操作系统配置

GBase 8a MPP Cluster 产品,提供了 Linux平台的安装包文件,支持的 Linux版本如下:

 

操作系统名称

版本

架构

Red Hat Linux

6.1~6.8、7.0~7.3

X86_64bit

CentOS

6.1~6.8、7.0~7.3

X86_64bit

SUSE

11

X86_64bit

中标麒麟

6.0

X86_64bit

 

对于操作系统的安装要求和建议如下:

l  安装操作系统后,需要确认是否能够正常执行 killall 命令,以保证节点替换和扩容操作能够正常执行;

l  针对 RHEL6.x 建议在安装系统或格式化硬盘时,按 ext4 格式进行格式化;针对 RHEL7 系统建议按 xfs 格式进行格式化;

2.3  操作系统环境检查及配置

2.3.1 系统关闭NUMA

dmesg | grep -i transparent_hugepage=never
dmesg | grep -i numa=off
lscpu|grep NUMA

#关闭transparent_hugepage 和NUMA

grubby --update-kernel=ALL --args="transparent_hugepage=never numa=off"

Linux7

grubby --update-kernel=ALL --args="numa=off"

2.3.2 关闭 SELINUX

要求各节点禁用 SELINUX,禁用 SELINUX 的方法如下(需重启系统)。

sed -i 's/^[[:space:]]*SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config
setenforce 0

2.3.3 关闭防火墙状态

建议用户关闭防火墙,具体命令如下:

# service iptables stop
# chkconfig iptables off  --level 2345
# service ip6tables stop
# chkconfig ip6tables off  --level 2345

注:

针对 RHEL7 操作系统而言,防火墙的相关命令如下:

systemctl stop firewalld.service
systemctl disable firewalld.service
systemctl status firewalld.service

如果防火墙为开启状态,则需要为 Gbase单机开放如下端口:

端口名称 默认值

port  5258
SERVER_PORT  5288

需要在每个节点上执行以下命令:

设置默认规则。

# iptables -A INPUT -j DROP
# iptables -A FORWARD -j ACCEPT

开放 gcluster 端口。

# iptables -I INPUT -p tcp  --dport 5258 -j ACCEPT
# iptables -I OUTPUT -p tcp  --dport 5258 -j ACCEPT
# iptables -I INPUT -p tcp  --sport 5258 -j ACCEPT
# iptables -I OUTPUT -p tcp  --sport 5258 -j ACCEPT

2.3.4 更改systemd的进程限制

注:

针对 Redhat7.x 或 SUSE12,需要修改配置文件/etc/systemd/system.conf 中,设置参数 DefaultTasksMax=infinity。

cat >> /etc/systemd/system.conf <<EOF
DefaultTasksMax=infinity
EOF
systemctl daemon-reload

2.3.5 系统包

yum install -y bc net-tools

2.3.6 修改操作系统参数

软件安装前,请您使用 root 用户进行如下参数的修改,重启后生效。

2.3.6.1    内核参数配置

Sysctl 是一个允许您改变正在运行中的 Linux 系统的接口。它包含一些TCP/IP 堆栈和虚拟内存系统的高级选项。

 

cat >> /etc/sysctl.conf  <<EOF
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and
# sysctl.conf(5) for more details.
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
 
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
 
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
 
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
 
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
 
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
 
# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0
 
# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536
 
# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536
 
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
 
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
 
vm.vfs_cache_pressure = 1024
vm.min_free_kbytes=2097152
EOF
 
sysctl -p

2.3.6.2    修改内存参数配置

安装数据库之前,请您将 virtual memory 配置为 unlimited,有 2 种方法能完成虚拟内存的修改:

 

通过修改配置文件/etc/security/limits.conf,添加如下两行,操作系统重启后生效:

cat >> /etc/pam.d/login <<EOF
session    required     pam_limits.so
EOF
 
cat >> /etc/security/limits.conf <<EOF
*               hard    rss             unlimited
*               hard    as              unlimited
EOF

2.3.6.3    修改 I/O 调度方式

cat /sys/block/sd*/queue/scheduler

 

安装前请您修改 I/O 调度方式,设置系统使用 deadline 调度器,有 2种方法能完成 I/O 调度方式的修改

2.3.6.4    关闭transparent_hugepage

为保证数据库高效运行,需要关闭 transparent_hugepage 参数,具体操作如下:

linux7关闭transparent_hugepage

#1.查看transparent_hugepage是否启用

cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never

#2.关闭transparent_hugepage

echo never > /sys/kernel/mm/transparent_hugepage/enabled
grubby --update-kernel=ALL --args="transparent_hugepage=never"

#3.确认关闭transparent_hugepage

cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]

#*4.重新生成grub.cfg

grub2-mkconfig -o /boot/grub2/grub.cfg

2.3.6.5    Swap分区

Swap 分区大小设置为和物理内存大小相同,建议 swap 文件和数据文件放到不同的磁盘上。

2.3.6.6    各节点修改/etc/hosts配置文件

安装集群前,需要修改主机名配置文件/etc/hosts, 在 127.0.0.1后对应上 hostname。

示例:hostname 为 gc110,具体设置如下:

# vi /etc/hosts
127.0.0.1   gbase   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.241    gbase

命令:

name=$(hostname)
host_ip=$(ifconfig | grep inet | grep broadcast | awk '{print $2}' | awk -F: '{print $NF}' | head -1)
sed -i "s/^127.0.0.1/127.0.0.1   $name/" /etc/hosts
echo "${host_ip} ${name}" >> /etc/hosts

3   安装

3.1  获取安装文件(上传到任意一个管理结点的安目录/u01)

将安装光盘放入光驱,使用 mount 命令将光驱挂载到 Linux 文件系统。加载光驱命令如下(加载光驱需要 root 用户):

# mkdir /mnt/cdrom
# mount /dev/cdrom /mnt/cdrom

将光驱中的安装包的压缩文件 GBase8a-<productversion>-<build version>-<os version and archtecture>.tar.bz2(如:GBase8a -8.6.1.1_build6.1-redhat6.2-x86_64.tar.bz2)复制到文件系统的某个目录下。

进入该目录(下文将以安装包放在了/root 目录下为例),在命令行模式下使用 tar 命令进行解压。解压命令如下:

# tar xfj GBase8a_MPP_Cluster-8.6.1.1_build6.1-redhat6.2-x86_64.tar.bz2

解压后,将会在解压目录下生成 gcinstall 目录。

注:

在安装或升级前,需确认安装包和平台、操作系统的匹配性,不可使用跨平台和操作系统的安装包进行安装或升级。

3.2  Root用户创建用户

groupadd -g 1300 gbase
useradd -u 1310 -g gbase gbase
echo gbase | passwd  --stdin gbase

3.3  Root用户创建安装目录

mkdir -p /u01
chown -R gbase:gbase /u01

3.4  上传安装包到/u01,并更改权限

chown gbase:gbase GBase8a-NoLicense-Free-8.6.2_build43-R7-redhat7.3-x86_64.tar.bz2

3.5  Gbase用户解压安装包

tar xfj GBase8a-NoLicense-Free-8.6.2_build43-R7-redhat7.3-x86_64.tar.bz2

执行安装

3.5.1 安装

cd /u01/GBaseInstall
$ sh ./Install_lin.sh

3.5.2 安装日志

[gbase@gbase GBaseInstall]$ sh ./Install_lin.sh
 
*******************************************************************************
Thank you for choosing GBase product!
 
Please read carefully the following licencing agreement before installing any product:
 
Disclaimer of Product Trial License:
1. Any user who tries out (including self-downloaded trial or trial version provided by General Data Technology Co., Ltd) General Data Technology Co., Ltd Software Products should read this statement carefully. Users may choose not to try Nanda General Software Products. The user's tries out General Data Technology Co., Ltd Software Products will be deemed to be an endorsement of the full content of this statement.
2. Universal software products of General Data Technology Co., Ltd have complete autonomous knowledge rights and do not infringe on the relevant rights and interests of any other unit or individual. Universal software products of General Data Technology Co., Ltd are protected by law. Any transfer, reproduction, dissemination or use in unauthorized projects are strictly prohibited without the written permission of Universal of Nanda. Otherwise, the infringer will bear full responsibility.
3. Except for the terms of service specified by General Data Technology Co., Ltd, General Data Technology Co., Ltd is not liable or liable for any accident, negligence, contract destruction, defamation, copyright or intellectual property infringement caused by the trial use of General Data Technology Co., Ltd software products and any losses (including virus infection due to downloading).
4. The relevant information of General Data Technology Co., Ltd Software Products is the original information released. If there are any changes, no further notice will be given. Software may run differently from the final version, and features and functions in pre-release software may not appear in the final version. The risk of trying out the software should be borne by you.
5. Users assume their own risks for the trial of General Data Technology Co., Ltd Software Products. General Data Technology Co., Ltd does not guarantee any form of guarantee, does not guarantee that the trial products meet the user's requirements, does not guarantee that the trial service is uninterrupted, and does not guarantee the safety of the trial products. Due to any technical reasons such as network status, communication lines and so on, users can not normally try out General Data Technology Co., Ltd Products, or the impact or loss on third parties in the process of trial, General Data Technology Co., Ltd does not bear any legal liability.
6. General Data Technology Co., Ltd respects and protects the personal privacy rights of all users who try out General Data Technology Co., Ltd Products. Without the personal permission of users or mandatory provisions of relevant laws, General Data Technology Co., Ltd will not voluntarily disclose other third parties.
7. Any unit or individual who considers that General Data Technology Co., Ltd Software products may be suspected of infringing on its legitimate rights and interests should promptly give written feedback to General Data Technology Co., Ltd or its service website, and provide identity certificates, ownership certificates and detailed tort proof. After receiving the verification of the above-mentioned legal documents, General Data Technology Co., Ltd l will make corresponding treatment as soon as possible.
8. General Data Technology Co., Ltd Corporation has the final right to interpret General Data Technology Co., Ltd Products and this statement.
*******************************************************************************
Do you accept the above licence agreement (Yes/No, default=No) ?
Yes
 
*******************************************************************************
                     Welcome to install GBase products
*******************************************************************************
Please input the GBase software installation directory (Default:/home/gbase/GBase):
/u01/gbase
 
Installing all software packages ...
 
Software packages installation done.
 
*******************************************************************************
                  Welcome to create GBase database instance
*******************************************************************************
Please input the new database instance name (default: gbase8a):
 
 
Please input the port number for the new database instance (default:5258):
 
GBase is creating the New 'gbase8a' instance ...
 
hostkey: 164bd0b57129b1c67365b3db366bf095
The host key file is genarate at GBASE_BASE/config/gbase_host.cnf.
 
 
Congratulations.  Your GBase installation is successful.
 
Please execute $source ~/.bashrc manually on the first run.
 
Please refer to the product's manuals and readme.txt to start using GBase product.
 
[gbase@gbase GBaseInstall]$ source ~/.bashrc


3.5.3 服务状况

3.5.3.1    查看服务:

[gbase@gbase config]$ gbase.server status
 ERROR! GBase is not running

3.5.3.2    启动服务

[gbase@gbase config]$ gbase.server start
Starting GBase. SUCCESS!

3.5.3.3    查看服务

[gbase@gbase config]$ gbase.server status
 SUCCESS! GBase running (2583)

3.5.3.4    使用root用户登录gbase

[gbase@gbase config]$ gbase -uroot -p
Enter password: 
 
GBase client Free Edition 8.6.2.43-R7-free.110605. Copyright (c) 2004-2021, GBase.  All Rights Reserved.
 
gbase>

3.5.3.5    需改root用户密码(密码为P@ssword)

SET PASSWORD FOR root = PASSWORD('P@ssword');
Query OK, 0 rows affecte
 
SET PASSWORD FOR gbase = PASSWORD('gbase');

3.5.3.6    创建用户

CREATE USER 'guser'@'%' IDENTIFIED BY 'guser';
GRANT all ON *.* TO 'guser'@'%';
FLUSH PRIVILEGES;
select user,host from gbase.user;
SHOW GRANTS FOR 'guser'@'%';

启动服务:

$ gbase.server start

停止服务:

$ gbase.server stop

重启服务:

$ gbase.server restart

3.6  打License

3.6.1 采集指纹

注:

若您安装的 NOLICENSE 版本集群,请忽略此小节。

 

首先,使用 gbase 用户运行如下程序:gbase_gethostkey,本地生成一个32 字符的 host 串:

$ gbase_gethostkey
hostkey: 9a482beffd2a4a9cff664881ba680bcf

3.6.2 导入license  文件

注:

若您安装的 NOLICENSE 版本集群,请忽略此小节。

 

将授权文件拷贝到 $GBASE_BASE/config/目录下。具体如下:

$GBASE_BASE/config/gbase.lic 文件中(如果不存在 gbase.lic,需要手工建立)。


相关推荐:

网友留言:

您需要 登录账户 后才能发表评论

我要评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
验证码