Hello,
I´m trying to run a local couchbase through docker-compose.yml file, the docker-compose file have two couchbase configuration scripts (couchbase/server,couchbase/sync-gateway), the container lunch a couchbase on port 8091, but I have some problems in couchbase/server when I run it in command line.
docker-compose.yml
version: "3.7"
services:
couchbase-server:
image: couchbase/server
ports:
- 8091:8091
- 8092:8092
- 8093:8093
- 11210:11210
entrypoint:
- /bin/bash
- -c
- "echo 'Launching couchbase' &&
/usr/sbin/runsvdir-start &
(
ok=1; \
while [ $$ok != 0 ]; do \
sleep 5; \
echo 'Couchbase is starting (rest api not available)'; \
curl --connect-timeout 1 -s http://127.0.0.1:${COUCHBASE_PORT} > /dev/null; \
ok=$$?; \
done
) &&
(
echo 'Configuring Couchbase' &&
echo 'Creating cluster' &&
couchbase-cli cluster-init -c 127.0.0.1:${COUCHBASE_PORT} --cluster-username=${COUCHBASE_RBAC_USERNAME} --cluster-password=${COUCHBASE_RBAC_PASSWORD} --cluster-ramsize=512 --cluster-index-ramsize=512 --cluster-fts-ramsize=256 --services=data,index,query,fts &&
echo 'Creating '${COUCHBASE_BUCKET_NAME}' bucket' &&
couchbase-cli bucket-create -c 127.0.0.1:${COUCHBASE_PORT} -u ${COUCHBASE_RBAC_USERNAME} -p ${COUCHBASE_RBAC_PASSWORD} --bucket=${COUCHBASE_BUCKET_NAME} --bucket-type=couchbase --bucket-ramsize=300 &&
echo 'Creating a user to give the gateway an access to the bucket' &&
couchbase-cli user-manage -c 127.0.0.1 -u ${COUCHBASE_RBAC_USERNAME} -p ${COUCHBASE_RBAC_PASSWORD} --set --rbac-username ${COUCHBASE_SECURITY_USERNAME} --rbac-password ${COUCHBASE_SECURITY_PASSWORD} --roles admin --auth-domain local
) &&
echo 'Initialization done' &&
tail -f /opt/couchbase/var/lib/couchbase/logs/error.log"
couchbase-gateway:
image: couchbase/sync-gateway
ports:
- 4984:4984
- 4985:4985
entrypoint:
- /bin/bash
- -c
- "echo 'Sleep 5s at launch time' &&
sleep 5 &&
echo 'Creating configuration file' &&
COUCHBASE=$$(ping couchbase-couchbase -c 1 | grep -m 1 -E -o '[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+\\.[[:digit:]]+') &&
echo '
{
\"adminInterface\": \"0.0.0.0:${COUCHBASE_GATEWAY_PORT}\",
\"log\": [
\"[*]\"
],
\"verbose\": true,
\"databases\": {
\"app\": {
\"server\": \"http://'$$COUCHBASE':${COUCHBASE_PORT}\",
\"bucket\": \"${COUCHBASE_BUCKET_NAME}\",
\"username\": \"${COUCHBASE_SECURITY_USERNAME}\",
\"password\": \"${COUCHBASE_SECURITY_PASSWORD}\",
\"enable_shared_bucket_access\": true,
\"import_docs\": \"continuous\",
\"users\": {
\"admin\": {\"password\": \"adminadmin\", \"admin_channels\": [\"*\"]},
\"test\": {\"password\": \"test\", \"admin_channels\": [\"CHANNEL_test\"]}
},
\"sync\": `
function(doc, oldDoc) {
if (doc.tag !== undefined) {
channel(\"CHANNEL_\" + doc.tag);
}
}
`
}
}
}
' > /home/sync_gateway/sync_gateway.json &&
echo 'Sleep 10s before starting Sync Gateway' &&
sleep 10 &&
echo 'Starting Sync Gateway' &&
/opt/couchbase-sync-gateway/bin/sync_gateway /home/sync_gateway/sync_gateway.json &
tail -f /dev/null"
links:
- couchbase-server
One of them, if the next
stats_reader:log_bad_responses:238]Some nodes didn't respond: ['ns_1@cb.local']
is it because I need to call node-init?
The other error that I have is:
[ns_server:error,2020-05-14T17:00:49.243Z,ns_1@cb.local:query_stats_collector<0.498.0>:rest_utils:get_json:62]Request to (n1ql) /admin/stats failed: {error,
couchbase-server_1 | {econnrefused,
couchbase-server_1 | [{lhttpc_client,send_request,1,
couchbase-server_1 | [{file,
couchbase-server_1 | “/home/couchbase/jenkins/workspace/couchbase-server-unix/couchdb/src/lhttpc/lhttpc_client.erl”},
couchbase-server_1 | {line,220}]},