amd64/couchbase本镜像为 Couchbase 官方镜像 的 amd64 架构专用版本。Couchbase Server 是一个分布式架构的 NoSQL 文档数据库,具备内存优先架构、地理分布式部署和工作负载隔离等特性,能够在保持亚毫秒级延迟和 99.999% 可用性的同时,支持大规模关键业务应用。通过兼容 SQL 的查询语言(N1QL),可轻松实现从关系型数据库向 Couchbase Server 的迁移。
Couchbase Server 适用于以下场景:
| 标签 | Dockerfile 链接 |
|---|---|
7.6.7, enterprise, enterprise-7.6.7, latest | 链接 |
7.6.6, enterprise-7.6.6 | 链接 |
7.6.5, enterprise-7.6.5 | 链接 |
7.6.4, enterprise-7.6.4 | 链接 |
7.6.3, enterprise-7.6.3 | 链接 |
7.6.2, enterprise-7.6.2 | 链接 |
community, community-7.6.2 | 链接 |
7.6.1, enterprise-7.6.1 | 链接 |
community-7.6.1 | 链接 |
7.6.0, enterprise-7.6.0 | 链接 |
community-7.6.0 | 链接 |
7.2.7, enterprise-7.2.7 | 链接 |
7.2.6, enterprise-7.2.6 | 链接 |
7.2.5, enterprise-7.2.5 | 链接 |
7.2.4, enterprise-7.2.4 | 链接 |
community-7.2.4 | 链接 |
7.2.3, enterprise-7.2.3 | 链接 |
7.2.2, enterprise-7.2.2 | 链接 |
community-7.2.2 | 链接 |
7.2.0, enterprise-7.2.0 | 链接 |
community-7.2.0 | 链接 |
bashdocker run -d --name db \ -p 8091-8097:8091-8097 \ -p 9123:9123 \ -p ***:*** \ -p ***:*** \ -p ***:*** \ -p ***-***:***-*** \ couchbase
端口说明:Couchbase Server 根据使用场景需要暴露多个端口,详细端口用途可参考 官方文档。
访问主机的 http://localhost:8091,通过设置向导完成集群配置:
N1QL 是 Couchbase 的 SQL 兼容查询语言,可通过 Web 控制台或命令行执行:
http://localhost:8091 并登录sqlSELECT name FROM `beer-sample` WHERE brewery_id="mishawaka_brewing";
bashdocker exec -it db cbq --user Administrator cbq> SELECT name FROM `beer-sample` WHERE brewery_id="mishawaka_brewing";
Couchbase 提供多语言 SDK(C、Go、Java、.NET、Node.js、PHP、Python 等),应用程序可通过 http://localhost:8091/pools 连接到容器化集群。
示例 Java SDK 连接代码:
javaCluster cluster = Cluster.connect("localhost", "Administrator", "password"); Bucket bucket = cluster.bucket("beer-sample"); Collection collection = bucket.defaultCollection();
yamlversion: '3.8' services: couchbase: image: couchbase:latest container_name: couchbase-node1 ports: - "8091:8091" - "8092:8092" - "8093:8093" - "8094:8094" - "8095:8095" - "8096:8096" - "8097:8097" - "9123:9123" - "***:***" - "***:***" - "***:***" - "***:***" - "***:***" - "***:***" - "***:***" - "***:***" - "***:***" - "***:***" volumes: - couchbase_data:/opt/couchbase/var ulimits: nofile: soft: 40960 hard: 40960 core: soft: *** hard: *** memlock: soft: *** hard: *** restart: unless-stopped volumes: couchbase_data:
详细系统要求参考 官方文档。
Couchbase 容器的持久化数据默认存储在 /opt/couchbase/var,建议通过 -v 参数映射到主机目录:
bashmkdir -p ~/couchbase/data docker run -d --name db \ -v ~/couchbase/data:/opt/couchbase/var \ -p 8091-8097:8091-8097 \ -p 9123:9123 \ -p ***:*** \ -p ***:*** \ -p ***:*** \ -p ***-***:***-*** \ couchbase
SELinux 环境注意事项:
bashmkdir ~/couchbase/data && chcon -Rt svirt_sandbox_file_t ~/couchbase/data
Couchbase 生产环境需要调整 ulimit 设置以确保性能和稳定性:
bashdocker run -d --name db \ --ulimit nofile=40960:40960 \ --ulimit core=***:*** \ --ulimit memlock=***:*** \ -p 8091-8097:8091-8097 \ -p 9123:9123 \ -p ***:*** \ -p ***:*** \ -p ***:*** \ -p ***-***:***-*** \ couchbase
生产环境建议使用 --net=host 模式避免网络性能损耗和 NAT 问题:
bashdocker run -d --name db --net=host couchbase
所有容器运行在同一物理机,适用于开发和测试环境,但存在资源竞争和单点故障风险:
┌──────────────────────────────────────────────────────────┐ │ 主机 OS (Linux) │ │ │ │ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │ │ │ 容器 OS │ │ 容器 OS │ │ 容器 OS │ │ │ │ (Ubuntu) │ │ (Ubuntu) │ │ (Ubuntu) │ │ │ │ ┌───────────┐ │ │ ┌───────────┐ │ │ ┌───────────┐ │ │ │ │ │ Couchbase │ │ │ │ Couchbase │ │ │ │ Couchbase │ │ │ │ │ │ Server │ │ │ │ Server │ │ │ │ Server │ │ │ │ │ └───────────┘ │ │ └───────────┘ │ │ └───────────





manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务