logo
GBase 8s
安装配置
文章

Docker 搭建 GBase 8s数据库服务

GBase社区管理员
发表于2020-06-16 20:48:004516次浏览5个评论

1,Docker服务已经创建 2,足够的空间(GBase 8s For Docker最少需要2G的空间及1G以上的内存)

具体步骤

1,查找GBase 8s 镜像版本

[root@localhost ~]# docker search gbase8s
NAME                DESCRIPTION             STARS               OFFICIAL            AUTOMATED
liaosnet/gbase8s    GBase8sV8.7_2.0.1a2_2   1                                       

2,拉取GBase 8s镜像

[root@localhost ~]# docker pull liaosnet/gbase8s:2.0.1a2_2
2.0.1a2_2: Pulling from liaosnet/gbase8s
9b4ebb48de8d: Pull complete 
feabbffc73e8: Pull complete 
b361dbaead54: Pull complete 
c84f88b6f6bf: Pull complete 
Digest: sha256:5e84d1b00de967a033facb115d4c3630fcd931b2fb68820eb4662fb52d8f1153
Status: Downloaded newer image for liaosnet/gbase8s:2.0.1a2_2
docker.io/liaosnet/gbase8s:2.0.1a2_2

拉取时间可能会有些长,记得配置使用国内镜像。

3,查看本地镜像

[root@localhost ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
liaosnet/gbase8s    2.0.1a2_2           d8f4c547d6ae        10 days ago         986MB

上面可以看到我们已经安装了最新版本2.0.1a2_2版本的GBase 8s镜像。

4,运行容器

[root@localhost ~]# docker run -itd -p 19088:9088 liaosnet/gbase8s:2.0.1a2_2

参数说明:

-p 19088:9088:映射容器服务的 9088端口到宿主机的 19088端口,外部主机可以直接通过 宿主机ip:19088访问到 GBase 8s的服务。

5,安装成功

通过docker ps 命令查看安装是否成功

[root@localhost ~]# docker ps
CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS              PORTS                     NAMES
194b078358cc        liaosnet/gbase8s:2.0.1a2_2   "/bin/sh -c 'su - gb…"   5 seconds ago       Up 3 seconds        0.0.0.0:19088->9088/tcp   strange_poincare

进入容器,查看数据库状态

[root@localhost ~]# docker exec -it 194b078358cc bash
[root@194b078358cc /]# su - gbasedbt
[gbasedbt@194b078358cc ~]$ onstat -g ntt

GBase Database Server Version 12.10.FC4G1AEE -- On-Line -- Up 00:05:12 -- 640264 Kbytes

global network information:
  #netscb connects         read        write    q-free  q-limits  q-exceed alloc/max
   2/   2        0            0            0    0/   0  240/  10    0/   0    0/  -1

Individual thread network information (times):
          netscb thread name    sid     open     read    write address                  
        4dce6b70 soctcplst        3 05:49:33                   0.0.0.0|9088|soctcp      
        4d4e2b70 soctcppoll       2 05:49:33 
        
[gbasedbt@194b078358cc ~]$ onstat -d

GBase Database Server Version 12.10.FC4G1AEE -- On-Line -- Up 00:06:40 -- 640264 Kbytes

Dbspaces
address          number   flags      fchunk   nchunks  pgsize   flags    owner    name
47149028         1        0x40001    1        1        2048     N  BA    gbasedbt rootdbs
58834d98         2        0x40001    2        1        2048     N  BA    gbasedbt datadbs01
 2 active, 2047 maximum

Chunks
address          chunk/dbs     offset     size       free       bpages     flags pathname
47149258         1      1      0          128000     43039                 PO-B-D /opt/gbase/data/rootchk
589c1028         2      2      0          16000      14041                 PO-BED /opt/gbase/data/datachk01
 2 active, 32766 maximum

NOTE: The values in the "size" and "free" columns for DBspace chunks are
      displayed in terms of "pgsize" of the DBspace to which they belong.


Expanded chunk capacity mode: always

评论

登录后才可以发表评论
GBase用户13166发表于 2 年前
请问进到里面之后怎么用
张淳发表于 1 年前
@GBase用户13166:我只是为了测试一下数据库
第一步临时创建了数据库:
docker --rm -it -name gbase8s --network host 镜像名称 /bin/sh -c "su - gbasedbt -c oninit && /bin/bash"
第二步改用户密码:
passwd gbasedbt
第三步在GBaseDataStudio中建立连接:
端口 9088
实例名 gbase01
数据库/模式 sysmaster
用户名 gbasedbt
GBase用户9424发表于 2 年前
帐号密码都没有你们怎么用的
张淳发表于 1 年前
@GBase用户9424:我是在容器中root下改密码:
passwd gbasedbt
GBase用户18172发表于 1 年前
容器启动的gbase8s如何配置使得数据在重启容器,容器宿主机后可以持久化不丢失