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

Dynamically get host IP #9

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
12 changes: 7 additions & 5 deletions couchbase/configure-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@ set -m

sleep 15

INTERNAL_IP=$(hostname -i)

# Setup index and memory quota
curl -v -X POST http://127.0.0.1:8091/pools/default -d memoryQuota=300 -d indexMemoryQuota=300
curl -v -X POST http://$INTERNAL_IP:8091/pools/default -d memoryQuota=300 -d indexMemoryQuota=300

# Setup services
curl -v http://127.0.0.1:8091/node/controller/setupServices -d services=kv%2Cn1ql%2Cindex
curl -v http://$INTERNAL_IP:8091/node/controller/setupServices -d services=kv%2Cn1ql%2Cindex

# Setup credentials
curl -v http://127.0.0.1:8091/settings/web -d port=8091 -d username=Administrator -d password=password
curl -v http://$INTERNAL_IP:8091/settings/web -d port=8091 -d username=Administrator -d password=password

# Setup Memory Optimized Indexes
curl -i -u Administrator:password -X POST http://127.0.0.1:8091/settings/indexes -d 'storageMode=memory_optimized'
curl -i -u Administrator:password -X POST http://$INTERNAL_IP:8091/settings/indexes -d 'storageMode=memory_optimized'

# Load travel-sample bucket
curl -v -u Administrator:password -X POST http://127.0.0.1:8091/sampleBuckets/install -d '["travel-sample"]'
#curl -v -u Administrator:password -X POST http://$INTERNAL_IP:8091/sampleBuckets/install -d '["travel-sample"]'

echo "Type: $TYPE, Master: $COUCHBASE_MASTER"

Expand Down
2 changes: 1 addition & 1 deletion couchbase/master-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ spec:
ports:
- port: 8091
selector:
app: couchbase-master-pod
app: couchbase-master-pod
1 change: 0 additions & 1 deletion couchbase/readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ This directory shows how to build a custom Couchbase Docker image that:
. Setups memory for Index and Data
. Configures the Couchbase server with Index, Data, and Query service
. Sets up username and password credentials
. Loads the `travel-sample` bucket

== Build the Image

Expand Down
4 changes: 2 additions & 2 deletions couchbase/worker-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
- name: COUCHBASE_MASTER
value: SERVICE_IP_OF_MASTER
- name: AUTO_REBALANCE
value: true
value: 'true'
ports:
- containerPort: 8091
----
Expand All @@ -34,4 +34,4 @@ spec:
ports:
- port: 8091
selector:
app: couchbase-worker-pod
app: couchbase-worker-pod