
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
本镜像用于通过Docker Swarm以完全分布式模式搭建Apache HBase集群,提供稳定的分布式列式存储服务。使用前需先部署ZooKeeper集群和HDFS集群作为依赖组件,适用于需要分布式HBase环境的开发、测试及生产场景。
部署ZooKeeper集群
参考https://github.com/newnius/scripts/tree/master/zookeeper%E9%83%A8%E7%BD%B2ZooKeeper%E9%9B%86%E7%BE%A4%EF%BC%8C%E5%81%87%E8%AE%BE%E8%8A%82%E7%82%B9%E5%90%8D%E7%A7%B0%E4%B8%BA%60zookeeper-node1%60%E3%80%81%60zookeeper-node2%60%E3%80%81%60zookeeper-node3%60%E3%80%82
部署HDFS集群
参考https://github.com/newnius/scripts/tree/master/hadoop%E9%83%A8%E7%BD%B2HDFS%E9%9B%86%E7%BE%A4%EF%BC%8C%E5%81%87%E8%AE%BE%E8%8A%82%E7%82%B9%E5%90%8D%E7%A7%B0%E4%B8%BA%60hadoop-master%60%E3%80%81%60hadoop-slave1%60%E3%80%81%60hadoop-slave2%60%E3%80%81%60hadoop-slave3%60%E3%80%82
创建HBase Master节点
bashdocker service create \ --name hbase-master \ --hostname hbase-master \ --network swarm-net \ --endpoint-mode dnsrr \ newnius/hbase:1.2.6
创建HBase Slave节点
bashdocker service create \ --name hbase-slave1 \ --hostname hbase-slave1 \ --network swarm-net \ --endpoint-mode dnsrr \ newnius/hbase:1.2.6
bashdocker service create \ --name hbase-slave2 \ --hostname hbase-slave2 \ --network swarm-net \ --endpoint-mode dnsrr \ newnius/hbase:1.2.6
bashdocker service create \ --name hbase-slave3 \ --hostname hbase-slave3 \ --network swarm-net \ --endpoint-mode dnsrr \ newnius/hbase:1.2.6
进入hbase-master容器执行初始化命令:
bash# 在hbase-master容器内执行 bin/start-hbase.sh
通过浏览器访问HBase集群管理界面:http://hbase-master:16010(需配合https://hub.docker.com/r/newnius/docker-proxy/%E4%BD%BF%E7%94%A8%EF%BC%89%E3%80%82
启动Thrift服务
在hbase-master容器内启动Thrift服务:
bash# 在hbase-master容器内执行 bin/hbase-daemon.sh start thrift
创建端口转发服务
bashdocker service create \ --name hbase-forwarder \ --network swarm-net \ --replicas 1 \ --detach=true \ --env REMOTE_HOST=hbase-master \ --env REMOTE_PORT=9090 \ --env LOCAL_PORT=9090 \ --publish mode=host,published=9090,target=9090 \ newnius/port-forward
Python客户端示例
pythonimport happybase def get_tables_name(host,port): conn = happybase.Connection(host=host,port=port,protocol='compact',transport='framed') return conn.tables()
注意:默认情况下,
hbase.regionserver.thrift.framed和hbase.regionserver.thrift.compact已设置为true以确保安全性。
将自定义配置文件挂载到/config/hbase目录,启动脚本会自动替换默认配置:
bashdocker service create \ --name hbase-master \ --hostname hbase-master \ --network swarm-net \ --replicas 1 \ --detach=true \ --endpoint-mode dnsrr \ --mount type=bind,source=/etc/localtime,target=/etc/localtime,readonly \ --mount type=bind,source=/data/hbase/config,target=/config/hbase \ --mount type=bind,source=/data/hbase/logs/master,target=/usr/local/hbase/logs \ newnius/hbase:1.2.6
完整脚本可参考https://github.com/newnius/scripts/tree/master/hbase%E3%80%82
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。




来自真实用户的反馈,见证轩辕镜像的优质服务