docker快速部署Greenplum

步骤很简单,首先确保已经安装docker

启动容器

docker run -itd --name greenplum-standalone -p 5432:5432 projectairws/greenplum:latest

运行命令后如果本地镜像不存在,会先拉取镜像。然后以后台可交互模式启动,我们这里将容器命名为 greenplum-standalone,并将默认端口号暴漏到宿主机。

你可以增加 -v 来持久化数据(文章jeeinn)

-v /path/to/data:/gpdata

查看是否运行正常

docker ps

进入容器

docker exec -it greenplum-standalone /bin/bash

切换用户并查看集群状态

# 切换用户
su - gpadmin

# 查看集群状态
gpstate -s

psql交互

# 进入 psql 交互 shell
psql

select version();

远程连接

默认的账户密码

  • 账户:gpadmin
  • 密码:gpadmin
  • 端口:5432

注意,在部署机上使用最新稳定版 docker (docker-ce 的版本为 26.1.2)启动 projectairws/greenplum 容器时报错,但在测试机 docker-ce (docker-ce 24.0.5)完全没有问题,于是参照官方文档卸载降级后可用。

++ cat /root/orig_hostname
+ echo '127.0.0.1 b88584d15052'
+ /usr/sbin/sshd -D
+ chmod u+s /bin/ping
+ su - gpadmin
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
Could not load host key: /etc/ssh/ssh_host_ed25519_key
...
20240513:11:42:42:000034 gpstart:b622e91d8321:gpadmin-[WARNING]:-postmaster.pid file exists on Master, checking if recovery startup required
...
20240513:11:42:42:000034 gpstart:b622e91d8321:gpadmin-[CRITICAL]:-gpstart failed. (Reason='FATAL:  no pg_hba.conf entry for host "::1", user "gpadmin", database "template1", SSL off
') exiting...
psql: FATAL:  System was started in master-only utility mode - only utility mode connections are allowed
Last login: Mon Apr 15 14:00:38 UTC 2024

在 docker hub 找了一圈暂没有找到 projectairws/greenplum 这个容器项目反馈的地方

参考文章:Greenplum快速部署安裝教學 – 偉康科技洞察室 (webcomm.com.tw)

Author: thinkwei

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注