作者:大数据模型
本文旨在基于理论和实践快速认识opengauss,基于openGauss 2.01 搭建1主+1备+1级联备测试环境,一共有三个机器构成。

认识篇

2.0.1版新增特性:

  • 支持延迟备库
  • 相对主机,备机可以延迟一段指定的时间后再回放XLOG记录
  • 备机支持逻辑复制
  • 支持备机逻辑解码,可以减少主机的压力
  • 扩容工具功能增强
  • 优化了扩容工具,支持不停服在线扩容备机或级联备
  • 灰度升级
  • 优化升级工具,增加灰度升级能力,支持业务在线升级。目前仅支持从1.1.0版本到2.0.0版本进行灰度升级
  • 备机IO写放大优化
  • 优化备机IO,平滑备机检查点刷盘的IO量,解决备机IO量大影响查询性能问
  • WDR诊断报告增加数据库运行指标
  • 新增“Effective CPU”、“WalWrite NoWait”、“Soft Parse”、“Non-Parse” CPU四个数据库运行指标
  • Data Studio客户端工具特性
  • 增加pldebugger调试功能
  • 增加pldebugger调试功能的回滚,在使用Data Studio调试前增加选项来保证调试函数在修改完数据后回退支持xml和serial类型,表中增加列,列的类型支持xml和serial(big|normal|small)类型支持在Data Studio中创建和展示外表对象支持列存表的partial_cluster_key约束全局临时表支持DDL的展示和导出创建分区表支持LOCAL和GLOBAL标记增加MOT表的展示

2.1.0版新增特性:

  • openGauss 2.1.0于2021年9月30日发布,是openGauss的一个Preview版本,该版本生命周期仅为半年。该版本的新增功能如下:
  • 存储过程兼容性增强
  • SQL引擎能力增强
  • 支持Ustore存储引擎
  • 支持段页式存储
  • 基于Paxos分布式一致性协议的高可用
  • AI4DB和DB4AI竞争力持续构筑
  • 日志框架及错误码整改
  • JDBC客户端负载均衡及读写分离
  • 支持cmake脚本编译
  • 列存表支持主键唯一键约束
  • 支持jsonb数据类型
  • 支持unique sql自动淘汰
  • UCE故障感知
  • 支持GB18030字符集
  • 备机catch优化
  • 客户端工具gsql支持readline命令自动补齐
  • 动态数据脱敏• 支持国密算法
  • 防篡改账本数据库
  • 内置角色和权限管理机制
  • 透明加密
  • 全密态数据库增强
  • 支持dblink
  • 支持Ubuntu系统
  • 支持Hash索引
  • upsert支持子查询
  • min/max函数支持ip地址类型
  • 增加array_remove/array_replace/first/last函数
  • Data Studio客户端工具适配内核特性

https://opengauss.org/zh/download.html

openGauss是什么

摘自百度,openGauss是一款开源关系型数据库管理系统 ,采用木兰宽松许可证v2发行 。openGauss内核源自PostgreSQL,深度融合华为在数据库领域多年的经验,结合企业级场景需求,持续构建竞争力特性。同时openGauss也是一个开源、免费的数据库平台,鼓励社区贡献、合作。2019年9月19日在华为全联接大会上,华为宣布将开源其数据库产品,开源后命名为openGauss 。2020 年 6 月30日openGauss 数据库源代码正式开放。目前openGauss版本规划按照6个月一个小版本,1年一个大版本的节奏,版本生命周期暂定3年。

众所周知,华为少数不多数字化转型成功的企业,数据库作为其中其中的利器,华为研究数据库技术及产品,可以追溯到2001年。为了 支持电信产品和诸多内部运营管理系统,华为根据业务场景研发了GMDB内存库、GaussDB 100 OLTP数据库、GaussDB 200 OLAP数据库,GaussDB云数据库、多模数据库,统称GaussDB。 openGauss与GaussDB同样的内核,但是架构上不同,openGauss表现为单体式数据库,而GaussDB更多表现分布式数据库,采用数据分片管理。自2020年6月30日开源,openGauss走入千百个人开发者的视线,与大量的中小企业和上市企业结盟连线,而且长期保持在排行傍前5名。

为什么选择openGauss

理由一,事实说话,用客户的选择说话。见2020年数据库市场排名,SQL Server和Oracle排第一、第二,阿里第七、华为第十。

理由二,就像为什么买苹果,因为乔布斯。为什么选择Gauss,因为华为,华为是质量的代名词,也是中国人的骄傲。
理由三,openGauss开源免费可用,如果遇上性能问题或者需要商业技术支持,可以轻轻松松接入云GaussDB。

实践篇

**操作系统版本:**CentOS7

硬件配置: 8c/64G/100GB

节点信息:

[主节点] 192.168.30.22 prod

[备节点] 192.168.30.21 stb1

[级联备] 192.168.30.20 casstb

[root@hybriddb03 opengauss]# cd /opt/software/opengauss/
[root@hybriddb03 opengauss]# wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/2.1.0/x86/openGauss-2.1.0-CentOS-64bit-all.tar.gz
[root@hybriddb03 opengauss]# cd /opt/software/opengauss/
[root@hybriddb03 opengauss]# tar zxvf openGauss-2.1.0-CentOS-64bit-all.tar.gz
目录下再解压openGauss-2.1.0-CentOS-64bit-om.tar.gz

[root@hybriddb03 opengauss]#tar zxvf openGauss-2.1.0-CentOS-64bit-om.tar.gz

建立一个配置文件 cluster_config.xml

在opengauss的目录下建一个文件cluster_config.xml,包含以下内容

<?xml version="1.0" encoding="UTF-8"?>
<ROOT> <CLUSTER>
<PARAM name="clusterName" value="opgscluster" />
<PARAM name="nodeNames" value="hybriddb03,hybriddb02,hybriddb01" />
<PARAM name="gaussdbAppPath" value="/data/opengauss/app" />
<PARAM name="gaussdbLogPath" value="/data/opengauss/log" />
<PARAM name="tmpMppdbPath" value="/data/opengauss/tmp"/>
<PARAM name="gaussdbToolPath" value="/data/opengauss/om" />
<PARAM name="corePath" value="/data/opengauss/corefile"/>
<PARAM name="backIp1s" value="192.168.30.22,192.168.30.21,192.168.30.20"/>
</CLUSTER>
&lt;DEVICELIST&gt;&lt;DEVICE sn=&quot;prod&quot;&gt;&lt;PARAM name=&quot;name&quot; value=&quot;hybriddb03&quot;/&gt;&lt;PARAM name=&quot;azName&quot; value=&quot;AZ1&quot;/&gt;&lt;PARAM name=&quot;azPriority&quot; value=&quot;1&quot;/&gt;&lt;PARAM name=&quot;backIp1&quot; value=&quot;192.168.30.22&quot;/&gt;&lt;PARAM name=&quot;sshIp1&quot; value=&quot;192.168.30.22&quot;/&gt;&lt;!--dn--&gt;&lt;PARAM name=&quot;dataNum&quot; value=&quot;1&quot;/&gt;&lt;PARAM name=&quot;dataPortBase&quot; value=&quot;36000&quot;/&gt;&lt;PARAM name=&quot;dataNode1&quot; value=&quot;/data/opengauss/cluster/db1,hybriddb02,/data/opengauss/cluster/db1,

hybriddb01,/data/opengauss/cluster/db1"/>
<PARAM name="dataNode1_syncNum" value="0"/>
</DEVICE>
<DEVICE sn="stb1">
<PARAM name="name" value="hybriddb02"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<PARAM name="backIp1" value="192.168.30.21"/>
<PARAM name="sshIp1" value="192.168.30.21"/>
</DEVICE>
<DEVICE sn="casstb">
<PARAM name="name" value="hybriddb01"/>
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<PARAM name="backIp1" value="192.168.30.20"/>
<PARAM name="sshIp1" value="192.168.30.20"/>
<PARAM name="cascadeRole" value="on"/>
</DEVICE>
</DEVICELIST>
</ROOT>

以root身份执行cluster_config.xml

[root@hybriddb03 opengauss]# ./script/gs_preinstall -U omm -G dbgrp -X ./cluster_config.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)? no
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.
Warning: Installation environment contains some warning messages.
Please get more details by “/soft/script/gs_checkos -i A -h minion1,minion2,minion3 --detail”.
Set and check OS parameter completed.
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.

[root@hybriddb03 opengauss]# ./script/gs_checkos -i A -h hybriddb03,hybriddb02,hybriddb01 --detail
Checking items:
A1. [ OS version status ] : Normal
[hybriddb02]
centos_7.6_64bit
[hybriddb01]
centos_7.6.2003_64bit
[hybriddb03]
centos_7.6_64bit
A2. [ Kernel version status ] : Warning
[hybriddb01]
3.10.0-1127.el7.x86_64
[hybriddb03]
3.10.0-1160.el7.x86_64
A3. [ Unicode status ] : Normal
The values of all unicode are same. The value is “LANG=en_US.UTF-8”.
A4. [ Time zone status ] : Normal
The informations about all timezones are same. The value is “+0800”.
A5. [ Swap memory status ] : Normal
The value about swap memory is correct.
A6. [ System control parameters status ] : Warning
[hybriddb03]
Warning reason: variable ‘net.ipv4.tcp_retries1’ RealValue ‘3’ ExpectedValue ‘5’.
Warning reason: variable ‘net.ipv4.tcp_syn_retries’ RealValue ‘6’ ExpectedValue ‘5’.
Check_SysCtl_Parameter warning.
A7. [ File system configuration status ] : Normal
Both soft nofile and hard nofile are correct.
A8. [ Disk configuration status ] : Normal
The value about XFS mount parameters is correct.
A9. [ Pre-read block size status ] : Normal
The value about Logical block size is correct.
A10.[ IO scheduler status ] : Normal
The value of IO scheduler is correct.
A11.[ Network card configuration status ] : Warning
[hybriddb02]BondMode Null
Warning reason: network ‘enp96s0f0’ ‘mtu’ RealValue ‘1500’ ExpectedValue ‘8192’
[hybriddb03]
BondMode Null
Warning reason: network ‘eno1’ ‘mtu’ RealValue ‘1500’ ExpectedValue ‘8192’
[hybriddb01]
BondMode Null
Warning reason: network ‘eno1’ ‘mtu’ RealValue ‘1500’ ExpectedValue ‘8192’
A12.[ Time consistency status ] : Warning
[hybriddb01]
The NTPD not detected on machine and local time is “2021-11-29 15:25:46”.
[hybriddb02]
The NTPD not detected on machine and local time is “2021-11-29 15:25:46”.
[hybriddb03]
The NTPD not detected on machine and local time is “2021-11-29 15:25:46”.
A13.[ Firewall service status ] : Normal
The firewall service is stopped.
A14.[ THP service status ] : Normal
The THP service is stopped.
Total numbers:14. Abnormal numbers:0. Warning numbers:4.

warning级别的信息可以忽略不管。

实施安装


[omm@hybriddb03 opengauss]$ ./script/gs_install -X ./cluster_config.xml
Parsing the configuration file.
Check preinstall on every node.
Successfully checked preinstall on every node.
Creating the backup directory.
Successfully created the backup directory.
begin deploy…
Installing the cluster.
begin prepare Install Cluster…
Checking the installation environment on all nodes.
begin install Cluster…
Installing applications on all nodes.
Successfully installed APP.
begin init Instance…
encrypt cipher and rand files for database.
Please enter password for database:
Please repeat for database:
begin to create CA cert files
The sslcert will be generated in /data/opengauss/app/share/sslcert/om
Cluster installation is completed.
Configuring.
Deleting instances from all nodes.
Successfully deleted instances from all nodes.
Checking node configuration on all nodes.
Initializing instances on all nodes.
Updating instance configuration on all nodes.
Check consistence of memCheck and coresCheck on database nodes.
Successful check consistence of memCheck and coresCheck on all nodes.
Configuring pg_hba on all nodes.
Configuration is completed.
[SUCCESS] hybriddb03:
Using omm:dbgrp to install database.
Using installation program path : /data/opengauss/app_compiled

检查数据库信息


[omm@hybriddb03 ~]$ gsql -d postgres -p 26000 -r

[omm@hybriddb03 opengauss]$ gs_om -t status --detail

开通网络访问权限


vi /data/opengauss/cluster/db1/pg_hba.conf
加入

host all all 0.0.0.0/0 md5

vim /hadoop1/opgs/hadoop1/db1/postgresql.conf

password_encryption_type = 2
改成
password_encryption_type = 0

创建用户


CREATE ROLE manager IDENTIFIED BY ‘Gmcc1234!@#$’;

ALTER ROLE manager SYSADMIN;

ALTER ROLE manager MONADMIN;

ALTER ROLE manager LOGIN;

【参赛作品20】从零开始,快速认识实践使用openGauss相关推荐

  1. 【参赛作品66】快速搭建一套openGauss主备高可用集群

    作者:Sally openGauss是一款开源关系型数据库管理系统,采用木兰宽松许可证v2发行.openGauss内核早期源自PostgreSQL,深度融合华为在数据库领域多年的经验,结合企业级场景需 ...

  2. 在x86_64架构+VMware16.2.3 Pro+openEuler20.3-LTS上快速部署(一键安装)openGauss 3.1.1企业版数据库指导手册

    在x86_64架构+VMware16.2.3 Pro+openEuler20.3-LTS上快速部署(一键安装)openGauss 3.1.1企业版数据库指导手册 以下所用命令的使用参考openGaus ...

  3. python coding style guide 的快速落地实践——业内python 编码风格就pep8和谷歌可以认作标准...

    python coding style guide 的快速落地实践 机器和人各有所长,如coding style检查这种可自动化的工作理应交给机器去完成,故发此文帮助你在几分钟内实现coding st ...

  4. Qt Creator Qt快速最佳实践

    Qt Creator Qt快速最佳实践 Qt快速最佳实践 命名约定 规划用户界面 经济地使用组件 Qt快速最佳实践 以下准则描述了使用Qt Creator创建可在预期平台上完美运行的UI和场景的最有效 ...

  5. P4语言编程快速开始 实践二

    参考:P4语言编程快速开始 上一篇系列博客:P4语言编程快速开始 实践二 Demo 2 本Demo所做的修改及实现的功能: 为simple_router添加一个计数器(counter),该计数器附加( ...

  6. Docker快速入门实践-纯干货文章

    Docker快速入门实践-老男孩高级架构师课程内容,如果细看还能发现讲解视频呦!小伙伴们赶紧猛戳吧! 老男孩高级架构师内部学员实践文档分享! Docker快速入门实践-纯干货文章 老男孩教育2016启 ...

  7. 树莓派从零开始快速入门系列汇总

    树莓派从零开始快速入门系列汇总 树莓派从零开始快速入门第0讲--环境安装 树莓派从零开始快速入门第1讲--命令行 树莓派从零开始快速入门第2讲--更换国内源 树莓派从零开始快速入门第3讲--文件编辑 ...

  8. python coding style guide 的快速落地实践

    python coding style guide 的快速落地实践 机器和人各有所长,如coding style检查这种可自动化的工作理应交给机器去完成,故发此文帮助你在几分钟内实现coding st ...

  9. 树莓派从零开始快速入门第8讲——单总线(以DS18B20为例)

    树莓派从零开始快速入门第8讲--单总线(以DS18B20为例) 目录 树莓派从零开始快速入门第8讲--单总线(以DS18B20为例) 一.前言 二.硬件连接 三.使能1-write接口 四.通讯测试 ...

最新文章

  1. 中科罗伯特工业机器人_「聚焦中日韩产业博览会」丈夫看机器人,妻子忙采购...
  2. Web程序员的Mysql进阶序二之sql多条数据插入、多条数据更新、多表同时查询
  3. 使用AWS Lambda,S3和AWS CloudFront进行动态内容缓存
  4. cocos2d-lua3.7组件篇(三)-http通信demo
  5. CentOS6.9快速安装配置svn
  6. 酒吧声场测试软件,做到以下几点 酒吧音响效果出奇的好
  7. C语言:编写一个程序,输入用户的姓名和电话号码,按姓名的词典顺序排序后,输出用户的姓和电话号码;
  8. Sentaurus入门(3):sde
  9. 2022年G2电站锅炉司炉试题及在线模拟考试
  10. 自己对着知乎注册页面也模仿出了一个!!
  11. 男人必看十大电影 VS 女人必看十大电影
  12. 【人工翻译线代教材】Introduction to Linear Algebra BY Gilbert Strang【MIT】【线代】【翻译】
  13. 图像特征提取(颜色,纹理,形状)
  14. 真无线蓝牙耳机选购小技巧!2020五款优秀低延迟蓝牙耳机推荐
  15. 微信开发者工具官方版
  16. 数学中奇妙的“金蝉脱壳”(转)
  17. TIA博途SCL入门学习(三)创建SCL程序及更改FB块接口的视图样式
  18. 安卓AsyncHttpClient使用时出现的java.net.SocketTimeoutException: Read timed out报错解决方法之一
  19. three.js glb 多个_与林肯冒险家相比 奔驰GLB差的不仅是个四驱而已|冒险家|奔驰-石家庄新闻网...
  20. 2022电大国家开放大学网上形考任务-建设项目管理非免费(非答案)

热门文章

  1. Python之Request模块学习
  2. 高速AD/DA转换器常用资料
  3. LTE入门篇-6:MIMO多天线技术
  4. 《毛毛虫组》【Alpha】Scrum meeting 4
  5. workbench应力应变曲线_利用ansys Workbench仿真塑性材料拉伸力学试验 | 坐倚北风
  6. C++虚函数virtual
  7. unix高级编程-fork之后父子进程共享文件
  8. 常用python爬虫框架
  9. 大白话 六问数据中台!你想知道的都在这了!
  10. 南蛮图腾 (洛谷 P1498)