OpenGaussDB2.0.1

1. GaussDB version

GaussDB version:
GaussDB 100: currently not released, company partners need to submit an application to Huawei (GaussDB 100 will be officially named GaussDB T in 2020) GaussDB 200: currently available for official
download (GaussDB 200 will be officially released in 2020 Named GaussDB A)
GaussDB 300: The research and development of GaussDB has stopped at present, and the main focus will be 100 and 200 in the future.

Differences between GaussDB versions:
GaussDB T (OLTP): formerly GaussDB 100, which focuses on OLTP online transaction processing. It is used to store/query the data of activities in business applications to support daily business activities. Benchmark Oracle and other relational databases. It has been used in China Merchants Bank (Handheld Life).

GaussDB A (OLAP): formerly known as GaussDB 200, it mainly focuses on OLAP online analysis and processing, and is used to store historical data to support complex analysis operations, focusing on decision support. Comparing with Teradata and other distributed databases, it is currently applied online in ICBC.

2. Introduction to OpenGaussDB

GaussDB is a cloud-native database (not open source). The GaussDB database was released globally by Huawei in Beijing on May 15, 2019. It is known as the world's first AI-Native database.
OpenGaussDB was launched on September 19, 2019. At the Huawei CONNECT conference, Huawei announced that it would open source its GaussDB database. The open source product was named openGauss, which is also the origin of the beginning of "open" in openGauss.
But openGauss was finally officially open sourced on June 30, 2020.

To put it simply:
opengauss is the open source version of GaussDB T, which can be downloaded and used for free;
opengauss supports stand-alone and one master and multiple backup deployment methods, but does not support distributed cluster deployment.

Official website address:
https://www.opengauss.org/zh/

3. Single node installation

3.1 Environment configuration

  1. Turn off the firewall, se
[root@localhost ~]# systemctl disable --now firewalld
[root@localhost ~]# sed -i '7s/enforcing/disabled/g' /etc/selinux/config
[root@localhost ~]# setenforce 0
  1. set character set
[root@localhost ~]# vim /etc/profile
export LANG=en_US.UTF-8
[root@localhost ~]# source /etc/profile
[root@localhost ~]# echo $LANG
en_US.UTF-8

3. Turn off swap to improve performance

[root@localhost ~]# swapoff –a

3.2 Installation

1. Download the installation package

[root@localhost ~]# cd /usr/src/
[root@localhost src]# wget https://opengauss.obs.cn-south-1.myhuaweicloud.com/2.0.1/x86/openGauss-2.0.1-CentOS-64bit.tar.bz2
  1. create user, directory
[root@localhost src]# groupadd gauss
[root@localhost src]# useradd gauss -g gauss
[root@localhost src]# mkdir /gauss
[root@localhost src]# chown -R gauss:gauss /gauss/
  1. decompress
[root@localhost src]# tar xf openGauss-2.0.1-CentOS-64bit.tar.bz2 -C /gauss/
  1. Modify kernel parameters
[root@localhost src]# echo "kernel.sem=250 32000 100 1280" >> /etc/sysctl.conf
[root@localhost src]# sysctl -p
kernel.sem = 250 32000 100 1280

5. Install

[root@localhost src]# su gauss
[gauss@localhost src]$ cd /gauss/simpleInstall/
[gauss@localhost simpleInstall]$ sh install.sh -w pengyudong@123
  1. status query
[gauss@localhost simpleInstall]$ ps -ef | grep gaussdb
gauss      1953      1 77 11:46 pts/0    00:00:45 /gauss/bin/gaussdb -D /gauss/data/single_node
gauss      2028   1728  0 11:47 pts/0    00:00:00 grep --color=auto gaussdb
  1. Start and stop
停止
[gauss@localhost simpleInstall]$ gs_ctl -D /gauss/data/single_node/ stop

启动
[gauss@localhost simpleInstall]$ gs_ctl -D /gauss/data/single_node/ start	

进入数据库
[gauss@localhost simpleInstall]$ gsql -d postgres -p 5432

\l 列出所有数据库
\c mdb 切换到mdb数据库
\d 列出当前数据库下的表
select user; 显示当前用户

4. Remote connection settings

If you want to connect with the database tool DBeaver, etc., you can connect by changing the authentication of the database to MD5
Note: The serial number before each line of the configuration file below is the line number

[gauss@localhost ~]$ cd /gauss/data/single_node/
[gauss@localhost single_node]$ vim pg_hba.conf
91 host    all             all             0.0.0.0/0               md5

允许所有网段连接
[gauss@localhost single_node]$ vim postgresql.conf
59 listen_addresses = '*'  
99 password_encryption_type = 0
//修改配置文件之后需要重启
[gauss@localhost single_node]$ gs_ctl -D /gauss/data/single_node/ restart
//以postgres用户登录数据库
[gauss@localhost ~]$ gsql -d postgres -p 5432
//创建用户test设置密码为test@123
postgres=# CREATE USER test IDENTIFIED BY 'test@123';
//查看密码是否MD5保存了,否则无法使用DBeaver连接
postgres=# select rolname,rolpassword from pg_authid;	
test    | md5277ce23f876f1e288850168e58d257bb
(2 rows)
//用户授予数据库管理员权限,默认用户没有创建数据库表权限,需要修改其权限
postgres=# ALTER ROLE test SYSADMIN;
//创建数据库test
postgres=# CREATE DATABASE test ENCODING 'UTF--8';  
//使用新用户登录
[gauss@localhost ~]$ gsql -U test -d test;
Password for user test: test@123

Use DBeaver remote tool connection test:
host: 192.168.5.57
database: test
username: test
password: test@123
insert image description here

Guess you like

Origin blog.csdn.net/qq_49530779/article/details/131250206