GBase 8a V8.6.2的docker版安装使用
Tags: DockerGBaseGBase 8a南大通用安装配置
简介
GBase 8a MPP Cluster 数据库(简称8a集群)是南大通用公司自主研发、国内领先的大规模分布式并行处理数据库集群,在金融、电信、政务、国防、企事业等领域已经得到大规模应用。8a集群现已成为数据仓库和决策支持系统的有力支撑,近90%的南大通用产品用户都表示该产品性能优越、功能全面。其良好的市场反馈,使越来越多的用户有深入学习的需求。
gbase 8a是一个MySQL兼容的数据库管理系统,其底层的数据库引擎和MySQL相同,因此可以使用MySQL客户端登陆gbase 8a。这也意味着,gbase 8a支持MySQL的大多数命令和功能,如创建表、插入数据、更新数据等,同时也支持MySQL的连接协议,因此可以使用大部分MySQL客户端连接工具来连接和管理gbase 8a数据库。
gbase 8a可以使用MySQL客户端登陆的原因:
- gbase 8a是基于MySQL开发的,保留了MySQL的大部分功能和语法,所以可以兼容MySQL客户端。
- gbase 8a提供了一个工具gbase命令行,可以连接集群中的某个节点,执行SQL语句和文件,这个工具就是MySQL客户端的一个变种。
- gbase 8a也提供了一个自带的命令行工具gccli,可以连接整个集群,执行SQL语句和文件,这个工具比gbase命令行更强大。
下载
GBase 8a 数据库安装包、企业管理器和手册下载:https://pan.baidu.com/s/1cI7tIdyCojMku2yjhrWDlw
docker安装使用
1 2 3 4 5 6 7 8 9 | docker run -itd --name gbase8a --hostname=gbase8a --privileged=true -p5258:5258 shihd/gbase8a:1.0 -- 命令行登陆 gbase -uroot -proot -h172.71.0.29 -P5258 gbase -ugbase -pgbase20110531 -h172.71.0.29 -P5258 gccli -ugbase -pgbase20110531 -h172.71.0.29 -P5258 -- 若是MySQL客户端,则使用5.7版本,否则会报错:ERROR 1043 (08S01): Bad handshake mysql -uroot -plhr -h172.71.0.29 -P5258 |
会报错:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | [root@lhrdb ~]# docker run -it --name gbase8a --hostname=gbase8a --privileged=true -p5258:5258 shihd/gbase8a:1.0 Starting GBase. ERROR! Manager of pid-file quit without updating file. Error starting GBase 8a Server: 230304 3:18:02 [Note] ================================== 230304 3:18:02 [ERROR] /home/gbase/GBase/server/bin/gbased: Gbase general error: Memory manager is unable to allocate specified amount of memory 230304 3:18:02 [ERROR] Plugin 'EXPRESS' init function returned error. 230304 3:18:02 [ERROR] Plugin 'EXPRESS' registration as a STORAGE ENGINE failed. 230304 3:18:02 [ERROR] Unknown/unsupported table type: express 230304 3:18:02 [ERROR] Aborting 230304 3:18:02 [Note] /home/gbase/GBase/server/bin/gbased: Shutdown complete ERROR 2002 (HY000): Can't connect to local GBase server through socket '/tmp/gbase_8a_5258.sock' (2) 230304 3:18:02 [Note] ================================== 230304 3:18:02 [ERROR] /home/gbase/GBase/server/bin/gbased: Gbase general error: Memory manager is unable to allocate specified amount of memory 230304 3:18:02 [ERROR] Plugin 'EXPRESS' init function returned error. 230304 3:18:02 [ERROR] Plugin 'EXPRESS' registration as a STORAGE ENGINE failed. 230304 3:18:02 [ERROR] Unknown/unsupported table type: express 230304 3:18:02 [ERROR] Aborting 230304 3:18:02 [Note] /home/gbase/GBase/server/bin/gbased: Shutdown complete |
GBase 8a数据库集群在启动时,会从操作系统分配足够的物理内存,默认值是物理内存的62.5%,连续的。如不足,则报这个错误。一般是因为有其它程序使用了内存,特别是一些java程序。
这个错误提示表明gbase数据库没有足够的内存来分配,修改修改参数降低gbase数据库的启动内存参数,如gbase_heap_data、gbase_heap_temp、gbase_heap_large等,使其适应系统可用的内存。
解决:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | docker exec -it gbase8a bash cd /home/gbase/GBase/config -- 取消如下的注释 vi gbase_8a_gbase8a.cnf gbase_heap_data=512M gbase_heap_temp=256M gbase_heap_large=256M gbase_buffer_insert=256M cd /home/gbase sh start.sh [gbase@gbase8a ~]$ more start.sh #!/bin/bash source ~/.bashrc gbase.server start sleep 3 gbase -uroot -e "SET PASSWORD FOR root = PASSWORD('root')" echo `lsof -i:5258` tail -f /home/gbase/GBase/log/gbase8a/system.log |
- gbase_heap_data:用于存储数据的堆内存大小
- gbase_heap_temp:用于存储临时表和排序结果的堆内存大小
- gbase_heap_large:用于执行大型查询时分配额外内存的堆内存大小
- gbase_buffer_insert:用于缓冲插入操作的缓冲区大小
GBase Data Studio连接
GBase8a数据库信息
- DB: gbase
- User: root
- Password: root
- Port: 5258
密码用户等
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | create USER lhr@'%' IDENTIFIED BY 'lhr'; grant all on *.* to lhr@'%' with grant option; ALTER USER lhr@'%' IDENTIFIED BY 'lhr'; ALTER USER root@'%' IDENTIFIED BY 'lhr'; ALTER USER gbase@'%' IDENTIFIED BY 'lhr'; create USER lhr@'127.0.0.1' IDENTIFIED BY 'lhr'; create USER root@'127.0.0.1' IDENTIFIED BY 'lhr'; create USER gbase@'127.0.0.1' IDENTIFIED BY 'lhr'; create USER lhr@'localhost' IDENTIFIED BY 'lhr'; create USER root@'localhost' IDENTIFIED BY 'lhr'; create USER gbase@'localhost' IDENTIFIED BY 'lhr'; grant all on *.* to root@'localhost' with grant option; grant all on *.* to lhr@'localhost' with grant option; grant all on *.* to gbase@'localhost' with grant option; grant all on *.* to root@'127.0.0.1' with grant option; grant all on *.* to lhr@'127.0.0.1' with grant option; grant all on *.* to gbase@'127.0.0.1' with grant option; flush privileges; select * from gbase.user; |
参考
https://www.modb.pro/db/240832
https://blog.csdn.net/wiserhowe/article/details/118608321