GBase 8c V5 集群版安装示例

  • 一、前言
  • 二、环境准备
  • 三、集群安装
  • 四、数据库启停
  • 五、卸载
  • 六、连接和 SQL 测试

一、前言

GBase 8c 是 GBASE公司(天津南大通用数据技术股份有限公司)自主研发的一款多模多态的企业级分布式数据库:支持行存、列存、内存等多种存储模式;支持单机、主备式、分布式等多种部署形态。
        GBase 8c 具备高性能、高可用、弹性伸缩、高安全性等特性,可以部署在物理机、虚拟机、容器、私有云和公有云,为关键行业核心系统、互联网业务系统和政企业务系统提供安全、稳定、可靠的数据存储和管理服务。
        本文讲解集群版安装部署步骤、卸载、连接测试。属于入门级别的实操课程。

二、环境准备

0、标识符约定:
命令前的 # 表示以 root 账户执行;
命令前的 $ 表示以 DBA 账户执行。

1、操作系统

硬件 配置
CPU Intel® Xeon® CPU E5-2699 v3 @ 2.30GHz
Memory 16G
Disk SSD 50G

2、集群配置(三个节点):

IP 角色
10.168.10.70 gha_server(高可用服务)、dcs(分布式配置存储)、gtm(全局事务管理)、coordinator(协调器)
10.168.10.71 datanode(数据节点) 1
10.168.10.72 datanode(数据节点) 2

3、确保关闭防火墙
(1) 每个节点都要执行
# systemctl status firewalld.service
如果系统提示以下信息说明防火墙已被禁用

● firewalld.service - firewalld - dynamic firewall daemonLoaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)Active: inactive (dead)Docs: man:firewalld(1)

(2) 否则,执行
# systemctl stop firewalld.service
# systemctl disable firewalld.service
可以关闭防火墙并禁止防火墙开机自启动。

4、确保每个节点的 SELINUX 是关闭的
(1) 每个节点执行
# sestatus
如果系统提示以下信息说明 selinux 已被禁用

SELinux status:                 disabled

(2) 否则,打开每个节点的 selinux 配置文件
# vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

将 SELINUX 关键字的值修改为 disabled,存盘退出,执行
# shutdown -r
重启操作系统。

5、三个节点重新设置主机名
[10.168.10.70]# hostnamectl set-hostname gbase8c_1
[10.168.10.71]# hostnamectl set-hostname gbase8c_2
[10.168.10.72]# hostnamectl set-hostname gbase8c_3

6、配置三个节点的 IP 主机名映射:
编辑三个节点的 hosts 文件
# vi /etc/hosts
将以下三行信息追加到 hosts 文件中

192.168.10.70    gbase8c_1
192.168.10.71   gbase8c_2
192.168.10.72   gbase8c_3

三、集群安装

1、每个节点都要创建 DBA 用户
# useradd gbase
# passwd gbase

2、添加gbase 用户至sudoer 列表
三个节点都要执行
# visudo
打开 sudoer 配置文件,找到 ”root ALL=(ALL) ALL” 行,在下方增加
“gbase ALL=(ALL) NOPASSWD:ALL”

## Allow root to run any commands anywhere
root ALL=(ALL) ALL
gbase ALL=(ALL) NOPASSWD:ALL

完成 sudoer 配置后,数据库安装就可以用 gbase 用户了。

本文使用的安装包是不能在 root 账户下安装的。

3、配置gbase用户ssh互信:
每个节点都要执行以下命令——
(1) 切换到 gbase 用户下
# su - gbase
(2) 创建秘钥目录和必要的授权
$ mkdir ~/.ssh
$ chmod 700 ~/.ssh
(3) 生成秘钥文件(连续回车即可)
$ ssh-keygen -t rsa
(4) 将公钥文件上传至其他节点即可实现免密登录:
此操作需输入 gbase 的密码,三个节点都要执行——
$ ssh-copy-id gbase@10.168.10.70
$ ssh-copy-id gbase@10.168.10.71
$ ssh-copy-id gbase@10.168.10.72
$ echo 'StrictHostKeyChecking no' >> ~/.ssh/config; echo 'UserKnownHostsFile ~/.ssh/known_hosts' >> ~/.ssh/config; chmod 644 ~/.ssh/config

4、配置系统时间同步
(1) 主安装节点(10.168.10.70)作为 server
执行
$ vi /etc/ntp.conf
打开 NTP 服务配置文件,修改如下:

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 192.168.10.70 nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 127.127.1.0
Fudge 127.127.1.0 stratum 10

ntp.conf 文件存盘退出后,执行
$ sudo service ntpd start # 启动NTP服务
$ sudo chkconfig ntpd on # 设置 NTP 服务开机自启

(2) 修改数据节点一(10.168.10.71)NTP 配置
执行
$ vi /etc/ntp.conf
打开 NTP 服务配置文件,修改如下:

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 192.168.10.71 nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.10.70
Fudge 192.168.10.70 stratum 10

ntp.conf 文件存盘退出后,执行
$ sudo service ntpd start # 启动NTP服务
$ sudo chkconfig ntpd on # 设置 NTP 服务开机自启

(3) 修改数据节点二(10.168.10.72)NTP 配置
执行
$ vi /etc/ntp.conf
打开 NTP 服务配置文件,修改如下:

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 192.168.10.72 nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 192.168.10.70
Fudge 192.168.10.70 stratum 10

ntp.conf 文件存盘退出后,执行
$ sudo service ntpd start # 启动NTP服务
$ sudo chkconfig ntpd on # 设置 NTP 服务开机自启

5、使用 SSH 工具上传安装包(GBase8cV5_S3.0.0B28_centos7.8_x86_64.tar.gz)到主安装节点(10.168.10.70) /home/gbase/ 下

6、解压安装包
$ cd /home/gbase
$ tar xvf GBase8cV5_S3.0.0B28_centos7.8_x86_64.tar.gz
解压成功新增四个文件

GBase8cV5_S3.0.0B28_CentOS_x86_64_om.sha256
GBase8cV5_S3.0.0B28_CentOS_x86_64_om.tar.gz
GBase8cV5_S3.0.0B28_CentOS_x86_64_pgpool.tar.gz
GBase8cV5_S3.0.0B28_CentOS_x86_64.sha256
GBase8cV5_S3.0.0B28_CentOS_x86_64.tar.bz2

再次解压
$ tar xvf GBase8cV5_S3.0.0B28_CentOS_x86_64_om.tar.gz

7、开始安装
(1) 编辑集群部署文件 gbase8c.yml:
[10.168.10.70]$ vi /home/gbase/gbase8c.yml
修改如下——

gha_server:- gha_server1:host: 10.168.10.70port: 20001
dcs:- host: 10.168.10.70port: 2379- host: 10.168.10.71port: 2379- host: 10.168.10.72port: 2379
gtm:- gtm1:host: 10.168.10.70role: primaryport: 6666agent_port: 8001work_dir: /home/gbase/data/gtm/gtm1coordinator:- cn1:host: 10.168.10.70role: primaryport: 5432agent_port: 8003work_dir: /home/gbase/data/coord/cn1
datanode:- dn1:- dn1_1:host: 10.168.10.71role: primaryport: 15432agent_port: 8005work_dir: /home/gbase/data/dn1/dn1_1- dn2:- dn2_1:host: 10.168.10.72role: primaryport: 20010agent_port: 8007work_dir: /home/gbase/data/dn2/dn2_1
env:# cluster_type allowed values: multiple-nodes, single-inst, default is multiple-nodescluster_type: multiple-nodespkg_path: /home/gbase # 安装包所在目录prefix: /home/gbase/gbase8c # 暂时没用version: V5_S3.0.0B28user: gbaseport: 22
constant:virtual_ip: 100.0.1.254/24virtual_nic: ens224
#   encryption_type: aes
#   encryption_passwd: fce06e206932e9e930f96c63b28cf951

(2) 执行安装脚本:
[10.168.10.70]$ /home/gbase/script/gha_ctl install

A. 数据库名称缺省 gbase8c,如果需要更名可以使用 -c 参数;
B. 配置文件路径缺省为 /home/gbase,如果需要更改可以使用 -p 参数。

执行时间 3+ 分钟,安装结束后,脚本会提示

{"ret":0,"msg":"Success"
}

集群安装成功!

(3) 节点状态检查
执行
[10.168.10.70]$ /home/gbase/script/gha_ctl monitor -l http://10.168.10.70:2379
结果如下,说明集群安装正常,数据服务启动中

{"cluster": "gbase8c","version": "V5_S3.0.0B28","server": [{"name": "gha_server1","host": "10.168.10.70","port": "20001","state": "running","isLeader": true}],"gtm": [{"name": "gtm1","host": "10.168.10.70","port": "6666","workDir": "/home/gbase/data/gtm/gtm1","agentPort": "8001","state": "running","role": "primary"}],"coordinator": [{"name": "cn1","host": "10.168.10.70","port": "5432","workDir": "/home/gbase/data/coord/cn1","agentPort": "8003","state": "running","role": "primary","central": true}],"datanode": {"dn1": [{"name": "dn1_1","host": "10.168.10.71","port": "15432","workDir": "/home/gbase/data/dn1/dn1_1","agentPort": "8005","state": "running","role": "primary"}],"dn2": [{"name": "dn2_1","host": "10.168.10.72","port": "20010","workDir": "/home/gbase/data/dn2/dn2_1","agentPort": "8007","state": "running","role": "primary"}]},"dcs": {"clusterState": "healthy","members": [{"url": "http://10.168.10.71:2379","id": "47d645d70d059264","name": "node_1","isLeader": false,"state": "healthy"},{"url": "http://10.168.10.70:2379","id": "742a6fd575a41be4","name": "node_0","isLeader": true,"state": "healthy"},{"url": "http://10.168.10.72:2379","id": "9e108bbe22487cc7","name": "node_2","isLeader": false,"state": "healthy"}]}
}

四、数据库启停

停止数据库服务
[10.168.10.70]$ /home/gbase/script/gha_ctl stop all -l http://10.168.10.70:2379
启动数据库服务
[10.168.10.70]$ /home/gbase/script/gha_ctl start all -l http://10.168.10.70:2379

五、卸载

在主节点(10.168.10.70)执行
$ /home/gbase/script/gha_ctl uninstall -l http://10.168.10.70:2379
可以完成集群的卸载。

六、连接和 SQL 测试

在主节点(10.168.10.70)执行
$ gsql -d postgres -p 5432
出现 postgres=# 操作符说明客户端工具 gsql 成功连接 8c 数据库
postgres=# create database testdb;
CREATE DATABASE
postgres=# create table student(ID int, Name varchar(10));
CREATE TABLE
postgres=# insert into student values(1, 'Mike'),(2,'John');
INSERT 0 2
postgres=# select * from student;
id | name
----±-----
1 | Mike
2 | John
(2 rows)

GBase 8c V5 集群版安装示例相关推荐

  1. 1.rabbitmq 集群版安装及使用nginx进行四层负载均衡设置

    1.安装erlang 需要注意erlang的版本是否满足rabbitmq的需求 这里用到的版本是:Erlang 19.0.4   RabbitMQ 3.6.15 wget http://www.rab ...

  2. ElasticSearch -- ES 7.x 集群版安装部署

    向导 1. ElasticSearch 1.下载 2.配置 3.查看启动状态 4.注册宕机.开机自启 5.如果磁盘是SSD,建议修改IO调度算法 6.SSD磁盘,关闭numa绑核.hugepage 2 ...

  3. GBase 8c V5 单机版安装示例

    GBase 8c V5 单机版安装示例 一.前言 二.准备 三.安装 四.数据库启停 五.卸载 六.连接和 SQL 测试 一.前言 GBase 8c 是 GBASE公司(天津南大通用数据技术股份有限公 ...

  4. hadoop namenode启动不了_集群版hadoop安装,写给大忙人看的

    导语 如果之前的单机版hadoop环境安装满足不了你,集群版hadoop一定合你胃口,轻松入手. 目录 集群规划 前置条件 配置免密登录 3.1 生成密匙 3.2 免密登录 3.3 验证免密登录 集群 ...

  5. Linux上安装集群版Redis

    [前言] 之前自己在Windows中玩过一段时间Redis(感兴趣的朋友可以看下-Redis系列博客),这次在项目中也有幸能负责起Redis,也由于前两天服务器硬盘损坏导致开发的Redis服务器重新装 ...

  6. 【doris】V1.2.2安装部署单机版or集群版

    FE 主要负责元数据管理.集群管理.用户请求的接入和查询计划的解析等工作. BE 主要负责数据存储.查询计划的执行等工作. 注:如下介绍单机版,集群版的部署方法与单机版一致,需将be安装包复制到其他节 ...

  7. GBase 8c V5 主备式部署实操

    GBase 8c V5 主备式部署实操 一.前言 二.环境准备 三.集群安装 四.数据库启停 五.卸载 六.连接和 SQL 测试 一.前言 GBase 8c 是 GBASE公司(天津南大通用数据技术股 ...

  8. mysql galera 安装_MySQL Galera 集群的安装过程

    MySQL Galera 集群的安装过程 MySQL Galera集群版的mysql是经过codeship打了wsrep补丁的,不是普通的mysql版本.可以从github下载. 环境:redhat ...

  9. JStorm2.1.1集群的安装和使用

    为什么80%的码农都做不了架构师?>>>    JStorm2.1.1集群的安装和使用 Storm是一个免费开源.分布式.高容错的实时计算系统,而JStorm是阿里巴巴开源的基于St ...

最新文章

  1. PAT甲级题目翻译+答案 AcWing(数学)
  2. Android Binder 分析——数据传递者(Parcel)
  3. 解决IntelliJ创建Maven项目一直显Loading archetype list
  4. HTML阅读打开点击不了,如何让网页文章中的代码可以点击运行
  5. iis7.5 php7.0,Win2008R2 IIS7.5 PHP7.3 配置ImageMagick及PHP-Imagick扩展
  6. urb传输的代码分析【转】
  7. TightVNC进行远程控制
  8. hash算法总结收集
  9. 职业规划计算机专业1500字,【计算机职业生涯规划书2000字】_计算机专业职业生涯规划书2000字...
  10. 模拟信号的数字处理方法
  11. CoreOS部署及应用
  12. pdf不预览直接打印(笔记记录)
  13. w10打开网络计算机退出,Win10网络发现已关闭怎么办?|Win10启用网络发现方法
  14. 汇率计算器 by React
  15. php怎么定义字符串变量的值,php字符串变量怎么替换
  16. Tableau 桑基图
  17. 【C语言】字符数组初始化方法
  18. 码云(gitee)的使用
  19. Java中hashcode和equals详解
  20. 收藏很久的资源整合网站,一个网站一个世界

热门文章

  1. html鼠标滚轮不滚动页面,Windows10系统鼠标滚轮无法滚动页面如何解决
  2. 〖产品思维训练白宝书 - 核心竞争力篇⑧〗- 产品经理核心竞争力解读之规划能力
  3. 斐波那契数列前20项
  4. Vuex中的Getter的使用
  5. vuex概念之Getter用法详解
  6. mysql多对一数据统计
  7. JAVA开发中高级知识储备
  8. 【xml】异常:不应有 xml xmlns=''。
  9. shotcut视频编辑器
  10. Android学习笔记(Android Studio)3-3(ProgressBar ProgressDialog)(加载进度条、转圈圈)UI组件之弹出组件