https://www.openeuler.org/zh/download 选一个下载
安装
按提示安装,安装服务器的时候注意选择安装服务器
如果需要可以选上openGauss数据库
,为了体验我这里选上了。
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
修改文件 /etc/selinux/config
SELINUX=disabled
修改后执行setenforce 0
临时关闭,或者一会儿找时间重启一下服务。
修改/etc/pam.d/su
文件,注释掉下边两行。
#auth sufficient pam_wheel.so trust use_uid
#auth required pam_wheel.so use_uid
如果你刚才安装操作系统的时候选择了安装openGauss数据库,这里直接拿来用就可以了。
这里配置文件实际就是postgres的,甚至连名字都没有改。
/var/lib/opengauss/data/postgresql.conf
listen_addresses = '*'
local_bind_address = '0.0.0.0'
password_encryption_type = 0
/var/lib/opengauss/data/pg_hba.conf
文件host all all 0.0.0.0/0 md5
systemctl restart opengauss.service
[root@localhost ~]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:7655 0.0.0.0:* LISTEN 2224/gaussdb
tcp 0 0 0.0.0.0:7654 0.0.0.0:* LISTEN 2224/gaussdb
tcp6 0 0 :::7655 :::* LISTEN 2224/gaussdb
tcp6 0 0 :::7654 :::* LISTEN 2224/gaussdb
opengauss
用户 su - opengauss
gsql
sql用postgres的sql命令即可。
ALTER ROLE openGauss PASSWORD 'liubei@161';
CREATE USER liubei WITH PASSWORD 'liubei@161';
ALTER USER liubei sysadmin;
openGauss
本地登录的命令gsql -d postgres -W 'liubei@161'
liubei
用户本地登录的命令gsql -d postgres -U liubei -W 'liubei@161'
程序禁止root用户安装
[liubei@localhost openGauss-5.0.0]$ ll
总用量 40
drwxr-x--- 2 liubei liubei 4096 3月 29 03:46 bin
drwx------ 3 liubei liubei 4096 6月 20 19:07 data
drwxr-x--- 3 liubei liubei 4096 3月 29 03:46 etc
drwxr-x--- 3 liubei liubei 4096 3月 29 03:46 include
drwxr-x--- 4 liubei liubei 4096 3月 29 03:46 jre
drwxr-x--- 5 liubei liubei 4096 3月 29 03:46 lib
drwx------ 2 liubei liubei 4096 6月 20 19:07 logs
drwxr-x--- 5 liubei liubei 4096 3月 29 03:46 share
drwxr-x--- 2 liubei liubei 4096 6月 20 19:08 simpleInstall
-rw-r----- 1 liubei liubei 32 3月 29 03:46 version.cfg
simpleInstall
目录[liubei@localhost openGauss-5.0.0]$ cd simpleInstall
[liubei@localhost simpleInstall]$ ll
总用量 64
-rw-r----- 1 liubei liubei 10827 3月 29 03:46 finance.sql
-rw-r----- 1 liubei liubei 13009 3月 29 03:46 install.sh
-rw-r--r-- 1 liubei liubei 4489 6月 20 19:08 load.log
-rw-r----- 1 liubei liubei 5056 3月 29 03:46 README.md
-rw-r----- 1 liubei liubei 19713 3月 29 03:46 school.sql
[liubei@localhost simpleInstall]$
[liubei@localhost simpleInstall]$ sh install.sh -w liubei@161
输出如下:
[step 1]: check parameter
[step 2]: check install env and os setting
[step 3]: change_gausshome_owner
[step 4]: set environment variables
[step 6]: init datanode
The files belonging to this database system will be owned by user "liubei".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
creating directory /home/liubei/openGauss-5.0.0/data/single_node ... ok
creating subdirectories ... in ordinary occasionok
creating configuration files ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1024MB
Begin init undo subsystem meta.
[INIT UNDO] Init undo subsystem meta successfully.
creating template1 database in /home/liubei/openGauss-5.0.0/data/single_node/base/1 ... The core dump path is an invalid directory
2023-06-20 19:07:42.215 [unknown] [unknown] localhost 140505899286464 0[0:0#0] [BACKEND] WARNING: macAddr is 21076/3325712, sysidentifier is 1381236786/3205528920, randomNum is 1041071448
ok
initializing pg_authid ... ok
setting password ... ok
initializing dependencies ... ok
loading PL/pgSQL server-side language ... ok
creating system views ... ok
creating performance views ... ok
loading system objects' descriptions ... ok
creating collations ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
initialize global configure for bucketmap length ... ok
creating information schema ... ok
loading foreign-data wrapper for distfs access ... ok
loading foreign-data wrapper for log access ... ok
loading hstore extension ... ok
loading foreign-data wrapper for MOT access ... ok
loading security plugin ... ok
update system tables ... ok
creating snapshots catalog ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
freezing database template0 ... ok
freezing database template1 ... ok
freezing database postgres ... ok
......
Success. You can now start the database server of single node using:
gaussdb -D /home/liubei/openGauss-5.0.0/data/single_node --single_node
or
gs_ctl start -D /home/liubei/openGauss-5.0.0/data/single_node -Z single_node -l logfile
[step 7]: start datanode
[2023-06-20 19:07:56.190][15116][][gs_ctl]: gs_ctl started,datadir is /home/liubei/openGauss-5.0.0/data/single_node
[2023-06-20 19:07:56.217][15116][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
......
从上边输出我们可以知道启动/停止命令,以后切换到
liubei
用户执行:gs_ctl start|stop|restart -D $GAUSSHOME/data/single_node -Z single_node
按2.1 系统自带库
操作即可。
按2.1 系统自带库
操作即可。