Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization with environment variables #66

Closed
wants to merge 5 commits into from

Conversation

cha87de
Copy link

@cha87de cha87de commented Jun 8, 2017

When using Couchbase to develop a cloud-native application, I was pretty much annoyed when I realized that the official Couchbase Docker image is not configurable during startup - a feature offered by other popular database systems (e.g. MySQL).

For that purpose I quickly developed an entrypoint which uses environment variables (e.g. from docker compose files) to bootstrap a ready to use Couchbase instance. At least I will work with that.
Later I realized issue #59 and #27 which asked exactly about that. And here comes my solution.

If no environment variables are specified, nothing more will happen than with the current entrypoint. If the following environment variables are specified, the started node will create or join a cluster, with the defined admin credentials, and will create buckets during start up.

Environment Variables:

  • CLUSTER=localhost
  • USER=admin
  • PASS=secret
  • PORT=8091
  • RAMSIZEMB=2048
  • RAMSIZEINDEXMB=512
  • RAMSIZEFTSMB=512
  • AUTOREBALANCE=true
  • BUCKETS=bucket1 bucket2 bucketn
  • BUCKETSIZES=512 1024 512

CLUSTER can be the local or a remote Couchbase instance. If it's remote, the new instance will join this remote cluster. If AUTOREBALANCE is set to true, a rebalance will be started directly after the join of the new node. BUCKETS and BUCKETSIZES are listing bucket names and their sizes, which will be created at start up time.

I have tested the new entrypoint with community version 4.5.1 several times. If the Couchbase team is interested, please further investigate some tests. (Maybe move my pull request to a branch...)

@tleyden
Copy link
Contributor

tleyden commented Jun 8, 2017

@cha87de this looks really useful! The self-contained approach looks great, compared to cbbootstrap which requires an external service for cluster nodes to discover each other.

I'll work w/ @ceejatec to review, and if you don't hear back from us soon please don't hesitate to follow up.

Thanks again for your contribution!

@cha87de
Copy link
Author

cha87de commented Jun 23, 2017

Any news? :-)

@tleyden
Copy link
Contributor

tleyden commented Jun 24, 2017

@cha87de not yet! stay tuned.. and thanks for checking in.

@cha87de cha87de mentioned this pull request Sep 27, 2017
@cha87de
Copy link
Author

cha87de commented Nov 21, 2017

Since issue #82 makes it impossible to run Couchbase as a real cloud database, this initialization approach makes no sense in a productive environment. Unfortunately.

@cha87de cha87de closed this Nov 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants