首页 » PostgreSQL/GaussDB » openGauss 2.0/3.1/5.0 企业版单机最简安装小测

openGauss 2.0/3.1/5.0 企业版单机最简安装小测

对于我这从事10余年的oracle dba从未像今年这样感觉到压力, 国产开源数据库铺天盖地的宣传,我依旧建议不要满目随大流式换库,因为数据库迁移经验对于不同的业务场景并非可以完全复制,昨天想装个openGauss小测一下,发现2.0新鲜发布, OpenGauss社区可以下载安装介质,openGauss内核源自PostgreSQL 9.2,是一款开源关系型数据库管理系统,采用木兰宽松许可证v2发行。

以下环境不构成安装建议,只是在我的ORACLE 数据库虚拟主机(1 cpu 4G memory OEL 7.7)小试,

下载是的是Centos x86_64 openGauss_2.0.0 企业版,介质不到100MB。

[root@oel7db1 opengauss]# mkdir -p /opensource/opengauss/

[root@oel7db1 opengauss]# ls -l
total 99008
-rw-r--r-- 1 root root 101382908 Mar 31 22:52 openGauss-2.0.0-CentOS-64bit-all.tar.gz

[root@oel7db1 opengauss]# tar -zxvf openGauss-2.0.0-CentOS-64bit-all.tar.gz
openGauss-2.0.0-CentOS-64bit-om.tar.gz
openGauss-2.0.0-CentOS-64bit.tar.bz2
openGauss-2.0.0-CentOS-64bit-om.sha256
openGauss-2.0.0-CentOS-64bit.sha256
upgrade_sql.tar.gz
upgrade_sql.sha256

[root@oel7db1 opengauss]# useradd og
[root@oel7db1 opengauss]# groupadd dbgrp
[root@oel7db1 ~]# usermod -G dbgrp og

[root@oel7db1 opensource]# chown -R og:dbgrp ./opengauss/

[root@oel7db1 opensource]# chmod 755 -R

[root@oel7db1 opensource]# id og
uid=54323(og) gid=54333(og) groups=54333(og),54334(dbgrp)

[og@oel7db1 opengauss]$ tar -jxvf openGauss-2.0.0-CentOS-64bit.tar.bz2

[og@oel7db1 opengauss]$ ./bin/gsql
./bin/gsql: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

[og@oel7db1 opengauss]$ export LD_LIBRARY_PATH=/opensource/opengauss/lib
[og@oel7db1 opengauss]$ ./bin/gsql
failed to connect Unknown:5432.

[og@oel7db1 opengauss]$ mkdir data

[og@oel7db1 bin]$ ./gs_initdb -D /opensource/opengauss/data
gs_initdb: Postgres-XC node name is mandatory
Try "gs_initdb --help" for more information.

[og@oel7db1 bin]$ ./gs_initdb -D /opensource/opengauss/data --nodename oel7db1
The files belonging to this database system will be owned by user "og".
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".

fixing permissions on existing directory /opensource/opengauss/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /opensource/opengauss/data/base/1 ... The core dump path is an invalid directory
2021-04-01 06:00:16.059 [unknown] [unknown] localhost 140335574480640 0 [BACKEND] WARNING: macAddr is 2048/656493114, sysidentifier is 134227745/1245329785, randomNum is 1093810553
ok
initializing pg_authid ... The core dump path is an invalid directory
ok
setting password ... The core dump path is an invalid directory
ok
initializing dependencies ... The core dump path is an invalid directory
ok
loading PL/pgSQL server-side language ... The core dump path is an invalid directory
ok
creating system views ... The core dump path is an invalid directory
ok
creating performance views ... The core dump path is an invalid directory
ok
loading system objects' descriptions ... The core dump path is an invalid directory
ok
creating collations ... The core dump path is an invalid directory
ok
creating conversions ... The core dump path is an invalid directory
ok
creating dictionaries ... The core dump path is an invalid directory
ok
setting privileges on built-in objects ... The core dump path is an invalid directory
ok
initialize global configure for bucketmap length ... The core dump path is an invalid directory
ok
creating information schema ... The core dump path is an invalid directory
The core dump path is an invalid directory
ok
loading foreign-data wrapper for distfs access ... The core dump path is an invalid directory
ok
loading foreign-data wrapper for hdfs access ... The core dump path is an invalid directory
ok
loading foreign-data wrapper for log access ... The core dump path is an invalid directory
ok
loading hstore extension ... The core dump path is an invalid directory
ok
loading foreign-data wrapper for MOT access ... The core dump path is an invalid directory
ok
loading security plugin ... The core dump path is an invalid directory
ok
update system tables ... The core dump path is an invalid directory
ok
vacuuming database template1 ... The core dump path is an invalid directory
ok
copying template1 to template0 ... The core dump path is an invalid directory
ok
copying template1 to postgres ... The core dump path is an invalid directory
ok
freezing database template0 ... The core dump path is an invalid directory
ok
freezing database template1 ... The core dump path is an invalid directory
ok
freezing database postgres ... The core dump path is an invalid directory
ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run gs_initdb.

Success. You can now start the database server of single node using:

./gaussdb -D /opensource/opengauss/data --single_node
or
./gs_ctl start -D /opensource/opengauss/data -Z single_node -l logfile

[og@oel7db1 ~]$ gaussdb -D /opensource/opengauss/data --single_node
0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.

0 LOG: [Alarm Module]Host Name: oel7db1

0 LOG: [Alarm Module]Host IP: 192.168.56.19

0 LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!

0 LOG: [Alarm Module]ERROR: environment variable $GAUSSHOME is not set!

0 LOG: [Alarm Module]ERROR: environment variable $GAUSSHOME is not set!

0 WARNING: not found GAUSSHOME enviroment variable.
0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
0 WARNING: failed to parse feature control file: gaussdb.version.
0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version.
0 LOG: Failed to initialze environment for codegen.
The core dump path is an invalid directory
2021-04-02 02:22:12.954 [unknown] [unknown] localhost 139843069662976 0 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
gaussdb.state does not exist, and skipt setting since it is optional.2021-04-02 02:22:12.954 [unknown] [unknown] localhost 139843069662976 0 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.

2021-04-02 02:22:12.955 [unknown] [unknown] localhost 139843069662976 0 0 [BACKEND] LOG: [Alarm Module]Host Name: oel7db1

2021-04-02 02:22:12.955 [unknown] [unknown] localhost 139843069662976 0 0 [BACKEND] LOG: [Alarm Module]Host IP: 192.168.56.19

2021-04-02 02:22:12.955 [unknown] [unknown] localhost 139843069662976 0 0 [BACKEND] LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!

2021-04-02 02:22:12.955 [unknown] [unknown] localhost 139843069662976 0 0 [BACKEND] LOG: [Alarm Module]ERROR: environment variable $GAUSSHOME is not set!

2021-04-02 02:22:12.955 [unknown] [unknown] localhost 139843069662976 0 0 [BACKEND] LOG: [Alarm Module]ERROR: environment variable $GAUSSHOME is not set!

2021-04-02 02:22:12.955 [unknown] [unknown] localhost 139843069662976 0 0 [BACKEND] LOG: Transparent encryption disabled.

Get environment of GAUSSHOME failed.
2021-04-02 02:22:12.973 [unknown] [unknown] localhost 139843069662976 0 0 [BACKEND] FATAL: Get environment of GAUSSHOME failed.

[og@oel7db1 ~]$ export GAUSSHOME=/opensource/opengauss
[og@oel7db1 ~]$ gaussdb -D /opensource/opengauss/data --single_node
0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.

0 LOG: [Alarm Module]Host Name: oel7db1

0 LOG: [Alarm Module]Host IP: 192.168.56.19

0 LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!

0 LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 52

0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
0 WARNING: failed to parse feature control file: gaussdb.version.
0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version.
0 LOG: Failed to initialze environment for codegen.
The core dump path is an invalid directory
2021-04-02 02:22:55.296 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: when starting as multi_standby mode, we couldn't support data replicaton.
gaussdb.state does not exist, and skipt setting since it is optional.2021-04-02 02:22:55.296 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.

2021-04-02 02:22:55.296 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: [Alarm Module]Host Name: oel7db1

2021-04-02 02:22:55.296 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: [Alarm Module]Host IP: 192.168.56.19

2021-04-02 02:22:55.296 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: [Alarm Module]Get ENV GS_CLUSTER_NAME failed!

2021-04-02 02:22:55.296 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 52

2021-04-02 02:22:55.296 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: Transparent encryption disabled.

2021-04-02 02:22:55.352 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: loaded library "security_plugin"
2021-04-02 02:22:55.352 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2021-04-02 02:22:55.361 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] WARNING: No explicit IP is configured for listen_addresses GUC.
2021-04-02 02:22:55.361 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2021-04-02 02:22:55.362 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: reserved memory for backend threads is: 220 MB
2021-04-02 02:22:55.362 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: reserved memory for WAL buffers is: 128 MB
2021-04-02 02:22:55.362 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: Set max backend reserve memory is: 348 MB, max dynamic memory is: 11097 MB
2021-04-02 02:22:55.362 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: shared memory 330 Mbytes, memory context 11445 Mbytes, max process memory 12288 Mbytes
2021-04-02 02:22:55.436 [unknown] [unknown] localhost 139737197262592 0 0 [CACHE] LOG: set data cache size(402653184)
2021-04-02 02:22:55.462 [unknown] [unknown] localhost 139737197262592 0 0 [CACHE] LOG: set metadata cache size(134217728)
2021-04-02 02:22:55.596 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: gaussdb: fsync file "/opensource/opengauss/data/gaussdb.state.temp" success
2021-04-02 02:22:55.596 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: create gaussdb state file success: db state(STARTING_STATE), server mode(Normal)
2021-04-02 02:22:55.597 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: max_safe_fds = 978, usable_fds = 1000, already_open = 12
The core dump path is an invalid directory
2021-04-02 02:22:55.601 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: user configure file is not found, it will be created.
2021-04-02 02:22:55.630 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: the configure file /opensource/opengauss/etc/gscgroup_og.cfg doesn't exist or the size of configure file has changed. Please create it by root user!
2021-04-02 02:22:55.630 [unknown] [unknown] localhost 139737197262592 0 0 [BACKEND] LOG: Failed to parse cgroup config file.

[og@oel7db1 ~]$ gsql
gsql: FATAL: database "og" does not exist
[og@oel7db1 ~]$ gsql -d postgres
gsql ((openGauss 2.0.0 build 78689da9) compiled at 2021-03-31 21:04:03 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

postgres=# select version();
ERROR: Please use "ALTER ROLE user_name PASSWORD 'password';" to set the password of user og before other operation!
postgres=#

postgres=# alter role og password 'anbob';
ERROR: Password must contain at least 8 characters.
postgres=# alter role og password 'anbob.com';
ERROR: Password must contain at least three kinds of characters.
postgres=# alter role og password 'anbob.com1';
ALTER ROLE

postgres=# select version();
version
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 9.2.4 (openGauss 2.0.0 build 78689da9) compiled at 2021-03-31 21:04:03 commit 0 last mr on x86_64-unknown-linux-gnu, compiled by g++ (GCC) 7.3.0, 64-bit
(1 row)

— 接下来就可以测试小功能了 —

postgres=# select * from dual;
ERROR:  relation "dual" does not exist on oel7db1
LINE 1: select * from dual;
                      ^
postgres=# select sysdate
postgres-# ;
       sysdate
---------------------
 2021-04-02 03:57:16


postgres=# CREATE TABLE t_part_list
  ( oid       NUMBER(6)
  , cust_id       NUMBER
  ,cust_name varchar2(100)
  ,order_time date
)  PARTITION BY list (oid)
(
partition p1 values(301,311),
partition p2 values(302,313)
);
postgres-#  
 CREATE TABLE
postgres-# \d t_part_list
               Table "public.t_part_list"
   Column   |              Type              | Modifiers
------------+--------------------------------+-----------
 oid        | numeric(6,0)                   |
 cust_id    | numeric                        |
 cust_name  | character varying(100)         |
 order_time | timestamp(0) without time zone |
List partition by(oid)
Number of partition: 2 (View pg_partition to check each partition range.)


postgres=# CREATE table anbob_com_copyright_anbob_com_copyright_anbob_com_copyright_anbob_com_copyright_t(id int, col_name_col_name_col_name_col_name_col_name_col_name_col_name_col_name_col_name_largecolumn varchar2(5000));
NOTICE:  identifier "anbob_com_copyright_anbob_com_copyright_anbob_com_copyright_anbob_com_copyright_t" will be truncated to "anbob_com_copyright_anbob_com_copyright_anbob_com_copyright_anb"
NOTICE:  identifier "col_name_col_name_col_name_col_name_col_name_col_name_col_name_col_name_col_name_largecolumn" will be truncated to "col_name_col_name_col_name_col_name_col_name_col_name_col_name_"
CREATE TABLE

postgres-#
postgres-# select * from anbob_com_copyright_anbob_com_copyright_anbob_com_copyright_anb;
ERROR:  syntax error at or near "
        ^
postgres=# select * from anbob_com_copyright_anbob_com_copyright_anbob_com_copyright_anb;
 id | col_name_col_name_col_name_col_name_col_name_col_name_col_name_
----+-----------------------------------------------------------------
(0 rows)

吐槽:
openGauss版本更新这种功能上的丢失,或不向前兼容,让人很不放心, 1.0时时有compress加密, 但1.1 又丢弃了;1.N时测试是兼容oracle最常用的dual, 2.0 居然又没了….

 

— update 20230508 —

在opengauss 3.1 或 5.0版本中依旧可以使用这种方法 安装单实例版

 

打赏

对不起,这篇文章暂时关闭评论。