docker上的couchbase配置 [英] couchbase configuration on docker

查看:52
本文介绍了docker上的couchbase配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是Docker的新手,我想在沙发床中进行一些初始配置,如下所示:

Hello I am very new on Docker and I want to make some initial configuration in the couchbase like that:

创建存储桶

设置管理员密码

我想使这两个过程自动化.因为:当我第一次在docker上运行ouchbase-db(docker-compose up -d couchbase db)时,我要进入localhost:8091并设置管理员密码.如果我在第一次运行时没有执行此操作,那么我将无法正确运行Couchbase.

I want to automate these two process. Because: When I first run couchbase-db on docker (docker-compose up -d couchbase db) I am going localhost:8091 and I am setting admin password. If I didnt do this when first running, I could not run couchbase properly.

有哪些方法可以做到这一点?是否有用于执行此操作的图像?我可以更改Docker文件进行初始配置吗?

What are ways to do this? Is there any images for doing this? Can I change Docker file for initial configuration?

谢谢.

推荐答案

我一直在搜寻自己并且打中了金币,我想在这里分享一下以供记录.

I have been searching myself and have struck gold, I'd like to share it here for the record.

确实有OP想要做的事情的映像:创建容器时预配置服务器.

There is indeed an image for what the OP seeks to do: pre-configure server when the container is created.

如果需要,此方法在运行此Shell脚本的自定义映像中使用Couchbase API来设置服务器和任何工作程序节点.这是设置凭据的示例:

This method uses the Couchbase API in a custom image that runs this shell script to setup the server and any worker nodes, if needed. Here's an example to set credentials:

curl -v http://127.0.0.1:8091/settings/web -d port=8091 -d username=Administrator -d password=password

https://github.com/arun-gupta/docker-images/blob/master/couchbase/configure-node.sh

这是在docker-compose中使用映像的方法 https://github.com/arun-gupta/docker-images/树/主/couchbase

Here's how to use the image with docker-compose https://github.com/arun-gupta/docker-images/tree/master/couchbase

拉出映像后,修改configure-node.sh以适合您的需求.然后以单人模式或群体模式运行.

After the image is pulled, modify the configure-node.sh to fit your needs. Then run in single or in swarm mode.

来源: https://blog.couchbase.com/couchbase-using-docker-compose/ https://docs.couchbase.com/server/4.0/rest-api/rest-bucket-create.html

这篇关于docker上的couchbase配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆