Docker 搭建 GBase 8s数据库服务
前置条件
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
已有 2 条评论