当前位置:网站首页>Hundred days to complete the open source task of the domestic database opengauss -- openguass minimalist version 3.0.0 installation tutorial
Hundred days to complete the open source task of the domestic database opengauss -- openguass minimalist version 3.0.0 installation tutorial
2022-07-05 13:00:00 【Running Wang Mumu sir】
o p e n g a u s s Need to be want clothing service device End , Ann loading stay L i n u x in \textcolor{green}{opengauss Server side is required , Installed in the Linux in } opengauss Need to be want clothing service device End , Ann loading stay Linux in
Qi dynamic clothing service device End , most after only can stay w i n customer Household End in send use \textcolor{green}{ Start the server side , In the end win Use... In the client } Qi dynamic clothing service device End , most after only can stay win customer Household End in send use
Ben writing from yes Ann loading clothing service device To customer Household End send use Of too cheng With And Out present Of ask topic \textcolor{green}{ This article starts with the process from installing the server to using the client and the problems that arise } Ben writing from yes Ann loading clothing service device To customer Household End send use Of too cheng With And Out present Of ask topic
Welcome to pay attention and praise ️ Collect messages
openGuass Minimalist Edition 3.0.0 Installation tutorial
Environmental Science
- Linux Centos7.6
- python 3.6.X
The official introduction
Minimalist Edition 2.0.0
Minimalist Edition 3.0.0
Minimalist for small memory machines , Set some important memory parameters lower during deployment . The minimalist version of the installed database character set will be the original default SQL_ACSII The character set is changed to en_US.UTF-8. This will show you how to set .
We installed the minimalist version 3.0.0, The above connection can be used as a reference , I will detail the steps , as well as Problems in the middle Write in this article
Install minimalist 3.0.0
Environment configuration
python
there python The best environment is 3.6.X, In the previous article, I mentioned how to install python-3.6.1
For details, click Linux Install in python3.6.X
Here is another kind 3.6.8 Installation method of :
yum install -y libaio-devel flex bison ncurses-devel glibc.devel patch lsb_release openssl* python3
If you have previously switched to the default version , There is no need to carry out , But I'll still write this down
Back up old files , And will python3 Make a soft connection
cd /usr/bin
mv python python.bak
ln -s python3 /usr/bin/python
View version :
Set character set
[[email protected]st ~]# cat >> /etc/profile <<EOF
> export LANG=en_US.UTF-8
> EOF
How to view
[[email protected] ~]# cat /etc/profile
If you only want to view the character set, there is another command
[[email protected] ~]# echo $LANG
Ensure success , Also execute the following commands , It can ensure that the configuration takes effect
[[email protected] ~]# source /etc/profile
Switch off switched memory
[[email protected] ~]# swapoff -a
close swap The purpose of exchanging memory is to ensure the access performance of the database , Avoid eliminating the buffer memory of the database to the disk . If the server memory is small , Memory overload , May open swap Swap memory to ensure normal operation .
yum Source
centos The default source of is foreign , Later, when we want to install the database, we will often use yum
, So we replace it with Huawei
. If it is not replaced, it will appear No package gs_ctl available. Error: Nothing to do
, The solution to the problem is in the problem
Also mentioned in
# In turn, run
# Create official backup source files
[[email protected] ~]# mkdir /etc/yum.repos.d/bak
# Move it
[[email protected] ~]# mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/
# Download Huawei source
[[email protected] ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
# Clear the original cache and generate a new cache
[[email protected] ~]# yum clean all
[[email protected] ~]# yum makecache
If wget
Out of commission , You need to install it through the following code yum install wget -y
.
After configuration , We need to install the dependent packages
[[email protected] ~]# yum install libaio-devel flex bison ncurses-devel glibc-devel patch redhat-lsb-core readline-devel -y
Turn off firewall
# View firewall status , If it is dead That is closed , If not, you need to continue to execute the following code
[[email protected] ~]# systemctl status firewalld
# Turn off firewall
[[email protected] ~]# systemctl disable firewalld.service
[[email protected] ~]# systemctl stop firewalld.service
close selinux
[[email protected] ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
# Check the status
[[email protected] ~]# cat /etc/selinux/config
Create normal users and directories , And authorize
Because our database cannot be used root
user , So you need to create an ordinary user omm
# Create user group
[[email protected] bin]# groupadd dbgrp
# Create user omm
[[email protected] bin]# useradd -g dbgrp -d /home/omm -m -s /bin/bash omm
[[email protected] bin]# echo "omm" | passwd --stdin omm
# Create installation directory
[[email protected] bin]# mkdir -p /opt/software/openGauss
# to grant authorization
[[email protected] bin]# chmod 755 -R /opt/software
[[email protected] bin]# chown -R omm:dbgrp /opt/software/openGauss
official 2.0.0 Script provided
groupadd -g 1001 dbgrp
useradd -u 2001 -g dbgrp omm
mkdir -p /opt/software/openGauss
chown -R omm:dbgrp /opt
What if I forget my password ? Here is a way to change your password
- root Under the user
root Under the user , You can modify any non root user , And you don't need to enter your old password .# Input passwd user name [[email protected] ~]# passwd omm # Enter the new password directly , Enter the confirmation password again
- Not root Under the user
First you have to log in to your old account# Log in to the designated account omm [[email protected] ~]# su - omm
# Direct input passwd [[email protected] ~]$ passwd # Then you need to enter the current password of the user in turn , New password , Confirm the password
Confirm time zone
Execute the following command to check whether the time and time zone of each database node are consistent .
[[email protected] ~]# date
If not, you need to modify the time zone directly
[[email protected] ~]# rm -fr /etc/localtime
[[email protected] ~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[[email protected] ~]# ll /etc/localtime
close RemoveIPC
On each database node , close RemoveIPC.CentOS The operating system is off by default , You can skip this step . If it is another version , It needs to be modified .
modify /etc/systemd/logind.conf In the document “RemoveIPC” The value is “no”.
vi /etc/systemd/logind.conf
modify “RemoveIPC” The value is “no”.
RemoveIPC=no
modify /usr/lib/systemd/system/systemd-logind.service In the document “RemoveIPC” The value is “no”.
vi /usr/lib/systemd/system/systemd-logind.service
modify “RemoveIPC” The value is “no”.
RemoveIPC=no
Reload configuration parameters .
systemctl daemon-reload systemctl restart systemd-logind
Unzip and install the stand-alone with one click openGauss
## Decompression software
## Be sure to arrive first omm Under the user
[[email protected] ~]# su - omm
[[email protected] ~]$ cd /opt/software/openGauss/
[[email protected] openGauss]$ tar -jxf openGauss-3.0.0-CentOS-64bit.tar.bz2 -C /opt/software/openGauss/
## One click Script Installation
[[email protected] openGauss]$ cd /opt/software/openGauss/simpleInstall/
## Remember the port number here 26000
[[email protected] simpleInstall]$ sh install.sh -w [email protected] -p 26000
If appear -bash: bzip2: command not found
This is because bz2 This is a compressed file , Yours LInux There is no decompression in the system , So you need to download it first .yum install -y bzip2
If an error is reported “the maximum number of SEMMNI is not correct, the current SEMMNI is xxx. Please check it.”.
There needs to be root Users with permissions execute commands sysctl -w kernel.sem="250 85000 250 330"
.
At this point, it is basically completed
- Advantages of minimalist version :openGauss The minimalist version eliminates user configuration XML Operation of file , No configuration 1 Lord +1 Configuration operation of the standby , Simple installation and configuration , Suitable for college students or personal function test scenarios
Start database
Must be in omm Under the user , If in root Next, the following problems will appear
[[email protected] ~]# gs_ctl start -D $GAUSSHOME/data/single_node -Z single_node
-bash: gs_ctl: command not found
Switch to omm
user
[[email protected] ~]# su - omm
Last login: Fri Jul 1 15:14:53 CST 2022 on pts/2
-bash: ulimit: open files: cannot modify limit: Operation not permitted
Start database
[[email protected] ~]$ gs_ctl start -D $GAUSSHOME/data/single_node -Z single_node
See if it starts
[[email protected] ~]$ ps -ef |grep gauss
omm 48933 1 68 11:03 ? 00:00:12 /opt/software/openGauss/bin/gaussdb -D /opt/software/openGauss/data/single_node
omm 49230 48526 0 11:03 pts/0 00:00:00 grep --color=auto gauss
Connect to database , Create a new user
The database user is created for the client ( for example :DataStudio) Connect through the Internet openGauss The server .openGauss Not allowed omm user (openGauss The default administrator user ) To connect to the database remotely .
- Using the server's gsql Connect to database
When the database installation is completed, the name will be generatedpostgres
The database of , We can use it for the first time .# there 26000 It's the port number you remember before , Of course, it can also be found in other ways . [[email protected] ~]$ gsql -d postgres -p 26000
# View port number [[email protected] ~]$ cat /opt/software/openGauss/data/single_node/postgresql.conf |grep port
- Create a new database and grant permissions
## Log in using the default database
[[email protected] ~]$ gsql -d postgres -p 26000 -W '[email protected]' -r
gsql ((openGauss 3.0.0 build 02c14696) compiled at 2022-04-01 18:12:34 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
## create new database test
openGauss=# CREATE DATABASE test ENCODING 'UTF-8' template = template0;
CREATE DATABASE
## Create new users hxl And the password
openGauss=# create user hxl password '[email protected]';
CREATE ROLE
## modify the database test Belongs to hxl
openGauss=# alter database test owner to hxl;
ALTER DATABASE
## Assign permissions to users
openGauss=# GRANT ALL PRIVILEGES TO hxl;
ALTER ROLE
openGauss=#
Use the user to connect to the database
# gsql -d Database name -p 36000 -U user name -W password -r
[[email protected] ~]$ gsql -d test -p 26000 -U hxl -W [email protected] -r
Modify the configuration
In fact, it is available on the server side , But our goal is to give users , Users can not use against the black box . So in order to use the client, that is Data Studio Tool use .
modify
/opt/software/openGauss/data/single_node/pg_hba.conf
[[email protected] ~]$ vi /opt/software/openGauss/data/single_node/pg_hba.conf
Add
host all all 0.0.0.0/0 sha256
Image below 192.168.75.101 IP If you don't know the address , It can be found belowproblem
Findmodify
/opt/software/openGauss/data/single_node/postgresql.conf
modifylisten_addresses
[[email protected] ~]$ vi /opt/software/openGauss/data/single_node/postgresql.conf ``` ```bash # Set the listening address to * Or the specified client ip Address listen_addresses = '*' # If you don't want to write * , Then you can use the following methods # listen_addresses = 'local,192.168.75.101'
Just restart the database
[[email protected] ~]$ gs_ctl restart -D $GAUSSHOME/data/single_node -Z single_node
Connect Data Studio
Download... On the official website Data Studio tool kit , You can use it directly .
- Look at the picture below , I will take one of them as an illustration
- name : Write it yourself
- Host number : stay Linux The host number found in the operating system , I'm here for 192.168.XX.XX
- Port number : I wrote it myself when installing the database , You can also query on the server
- database : The name of the database created
- user name : It is also the user name when creating the database for example :hxl
- password : The password for the user name for example :[email protected]
- Whether to start SSL: There is no need for .
Click OK to enter the page and it will prove successful .
What happened
- perform install.sh Script installation openGauss The following error occurred
On systemwide basis, the maximum number of SEMMNI is not correct. the current SEMMNI value is: 128. Please check it.
solve : stay/etc/sysctl.conf
Add a statement to kernel.sem = 250 32000 100 999, And then executesysctl -p
- Tips :No package gs_ctl available. Error: Nothing to do
solve : This is because yum There is a problem with the source , Modify it to solve .
Used this time yum The source is Huaweihttps://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
. Configuration is involved in the previous steps yum Source , Just reconfigure it . - yum Installation error :Loaded plugins: fastestmirror
fastestmirror
yes yum An acceleration plug-in for , It means it can't be used , We can disable it
Run the following statement , Modify the configuration file
The insidevi /etc/yum/pluginconf.d/fastestmirror.conf
enabled = 1
It is amended as followsenabled = 0
It means to disable this plug-in
The inside plugins Set tovi /etc/yum.conf
plugins=0
It means not using plug-ins
Clear cache and rebuild yum Source
At this point, the problem is solvedyum clean all yum clean dbcache yum makecache
- Check the operating system's IP Address
ipconfig
Or... In the figure belowip addr
this piece writing Chapter Just set grid stay this in 了 , Such as fruit Yes ask topic , along with when huan To meet private chat \textcolor{green}{ This article is frozen here , If there are questions , You are welcome to chat privately at any time } this piece writing Chapter Just set grid stay this in 了 , Such as fruit Yes ask topic , along with when huan To meet private chat
边栏推荐
猜你喜欢
Get to know linkerd project for the first time
Taobao flag insertion remarks | logistics delivery interface
2021-12-22 transaction record
《2022年中国银行业RPA供应商实力矩阵分析》研究报告正式启动
Distance measuring sensor chip 4530a used in home intelligent lighting
百日完成国产数据库opengausss的开源任务--openGuass极简版3.0.0安装教程
你的下一台电脑何必是电脑,探索不一样的远程操作
RHCSA1
stirring! 2022 open atom global open source summit registration is hot!
Simply take stock reading notes (2/8)
随机推荐
SAP ui5 objectpagelayout control usage sharing
What is the difference between Bi software in the domestic market
自然语言处理系列(一)入门概述
Comprehensive upgrade of Taobao short video photosynthetic platform
Oppo Xiaobu launched Obert, a large pre training model, and promoted to the top of kgclue
函数传递参数小案例
【Nacos云原生】阅读源码第一步,本地启动Nacos
2021.12.16-2021.12.20 empty four hand transaction records
CF:A. The Third Three Number Problem【关于我是位运算垃圾这个事情】
激动人心!2022开放原子全球开源峰会报名火热开启!
Overflow toolbar control in SAP ui5 view
MySQL 巨坑:update 更新慎用影响行数做判断!!!
Discussion on error messages and API versions of SAP ui5 getsaplogonlanguage is not a function
Run, open circuit
Insmod prompt invalid module format
潘多拉 IOT 开发板学习(HAL 库)—— 实验7 窗口看门狗实验(学习笔记)
A deep long article on the simplification and acceleration of join operation
开发者,云原生数据库是未来吗?
Simply take stock reading notes (1/8)
Association modeling method in SAP segw transaction code