eygle.com   eygle.com
eygle.com eygle
eygle.com  
 

« Oracle 12c 新特性:RAC 中 split brain 的节点权重驱逐法-墨天轮 | Blog首页 | 循序渐进 openGauss : pg_relation_filepath 获取表文件的具体位置-墨天轮 »

循序渐进 openGauss : 通过 openGauss 的 Docker 环境快速入门-墨天轮
modb.pro

墨天轮原文链接:https://www.modb.pro/db/27572

通过 云和恩墨 发布的 Docker 镜像,可以快速的运行一个 openGauss 环境,支持我们的学习测试。

通过 云和恩墨 发布的 Docker 镜像,可以快速的运行一个 openGauss 环境,支持我们的学习测试。

墨天轮上的朋友们已经整理了很多内容,可以参考:
opengauss docker安装 : https://www.modb.pro/db/27152
opengauss docker从环境搭建到运行: https://www.modb.pro/doc/4656

以下是云和恩墨的测试环境,同学们已经建立了大量的测试环境:

[root@ecs-514e-0004 ~]# docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                    NAMES
029868a4ecf6        enmotech/opengauss:latest   "docker-entrypoint.s..."   43 hours ago        Up 43 hours         0.0.0.0:8888->5432/tcp   eygle
7bf91f34b43e        enmotech/opengauss:latest   "docker-entrypoint.s..."   44 hours ago        Up 44 hours         0.0.0.0:5555->5432/tcp   opengauss5
06271f6f2002        enmotech/opengauss:latest   "docker-entrypoint.s..."   44 hours ago        Up 44 hours         0.0.0.0:4444->5432/tcp   opengauss4
d27c6d3501cf        enmotech/opengauss:latest   "docker-entrypoint.s..."   44 hours ago        Up 44 hours         0.0.0.0:3333->5432/tcp   opengauss3
c788a9e2fc86        enmotech/opengauss:latest   "docker-entrypoint.s..."   44 hours ago        Up 44 hours         0.0.0.0:2222->5432/tcp   opengauss2
2164d118eb70        enmotech/opengauss:latest   "docker-entrypoint.s..."   44 hours ago        Up 44 hours         0.0.0.0:1111->5432/tcp   opengauss1

连接到容器中的数据库:

[root@ecs-514e-0004 ~]# docker exec -it 029868a4ecf6 sh
sh-5.0# id
uid=0(root) gid=0(root) groups=0(root)
sh-5.0# su - omm
Last login: Sun Jul 12 10:04:02 CST 2020 on pts/0

Welcome to 4.19.90-2003.4.0.0036.oe1.aarch64


[omm@029868a4ecf6 ~]$ gsql
gsql ((openGauss 1.0.0 build 38a9312a) compiled at 2020-05-27 14:57:08 commit 472 last mr 549 )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

omm=# \du
                                         List of roles
 Role name |                               Attributes                               | Member of 
-----------+------------------------------------------------------------------------+-----------
 gaussdb   |                                                                        | {}
 omm       | Sysadmin, Create role, Create DB, Replication, Administer audit, UseFT | {}

创建一个新的用户,我们可以看到 openGauss 对于密码安全的要求:

omm=# create user enmotech with password 'enmotech';
ERROR:  Password must contain at least three kinds of characters.
omm=# 
omm=# create user enmotech with password 'Enm0t3ch';    
NOTICE:  The encrypted password contains MD5 ciphertext, which is not secure.
CREATE ROLE

创建独立的数据库,给用户授权:

omm=# create database enmotech owner enmotech;
CREATE DATABASE
omm=# GRANT ALL PRIVILEGES ON DATABASE enmotech to enmotech;
GRANT
omm=# ALTER ROLE enmotech CREATEDB;
ALTER ROLE
omm=# GRANT ALL PRIVILEGES TO enmotech;
ALTER ROLE
omm=# \q

使用新的数据库用户连接:

[omm@029868a4ecf6 ~]$ gsql -U enmotech -d enmotech
Password for user enmotech: 
gsql ((openGauss 1.0.0 build 38a9312a) compiled at 2020-05-27 14:57:08 commit 472 last mr 549 )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

enmotech=> \du
                                         List of roles
 Role name |                               Attributes                               | Member of 
-----------+------------------------------------------------------------------------+-----------
 enmotech  | Sysadmin,Create DB                                                     | {}
 gaussdb   |                                                                        | {}
 omm       | Sysadmin, Create role, Create DB, Replication, Administer audit, UseFT | {}

enmotech=> 

在容器外连接:

[root@ecs-514e-0004 ~]# gsql -d enmotech -U enmotech -W'Enm0t3ch' -h 192.168.1.94 -p 8888
gsql ((openGauss 1.0 build ec0e781b) compiled at 2020-04-27 17:25:57 commit 2144 last mr 131 )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.

enmotech=> \du
                                         List of roles
 Role name |                               Attributes                               | Member of 
-----------+------------------------------------------------------------------------+-----------
 enmotech  | Sysadmin,Create DB                                                    | {}
 gaussdb   |                                                                        | {}
 omm       | Sysadmin, Create role, Create DB, Replication, Administer audit, UseFT | {}

体验 openGauss 之旅就可以开始了。


历史上的今天...
    >> 2018-07-12文章:
    >> 2017-07-12文章:
    >> 2011-07-12文章:
    >> 2010-07-12文章:
    >> 2008-07-12文章:
           一只熟睡的咪
    >> 2007-07-12文章:
    >> 2006-07-12文章:

By enmotech on 2020-07-12 12:24 | Comments (0) | modb.pro | 3402 |


CopyRight © 2004~2020 云和恩墨,成就未来!, All rights reserved.
数据恢复·紧急救援·性能优化 云和恩墨 24x7 热线电话:400-600-8755 业务咨询:010-59007017-7040 or 7037 业务合作: marketing@enmotech.com