-
Notifications
You must be signed in to change notification settings - Fork 609
[couchbase] Add Integration Package with XDCR Data Stream #4073
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab7aeb0
Add couchbase intergration with XDCR data stream
kush-elastic f116ce6
Add changelog entry
kush-elastic 63bcbb0
update readme
kush-elastic 8914575
nits
kush-elastic 1352dc9
Merge branch 'main' of https://github.com/kush-elastic/integrations i…
kush-elastic b0d5f30
Merge branch 'main' of https://github.com/kush-elastic/integrations i…
kush-elastic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| staticConfigFile=/opt/couchbase/etc/couchbase/static_config | ||
| restPortValue=8091 | ||
|
|
||
| # see https://developer.couchbase.com/documentation/server/current/install/install-ports.html | ||
| function overridePort() { | ||
| portName=$1 | ||
| portNameUpper=$(echo $portName | awk '{print toupper($0)}') | ||
| portValue=${!portNameUpper} | ||
|
|
||
| # only override port if value available AND not already contained in static_config | ||
| if [ "$portValue" != "" ]; then | ||
| if grep -Fq "{${portName}," ${staticConfigFile} | ||
| then | ||
| echo "Don't override port ${portName} because already available in $staticConfigFile" | ||
| else | ||
| echo "Override port '$portName' with value '$portValue'" | ||
| echo "{$portName, $portValue}." >> ${staticConfigFile} | ||
|
|
||
| if [ ${portName} == "rest_port" ]; then | ||
| restPortValue=${portValue} | ||
| fi | ||
| fi | ||
| fi | ||
| } | ||
|
|
||
| overridePort "rest_port" | ||
| overridePort "mccouch_port" | ||
| overridePort "memcached_port" | ||
| overridePort "query_port" | ||
| overridePort "ssl_query_port" | ||
| overridePort "fts_http_port" | ||
| overridePort "moxi_port" | ||
| overridePort "ssl_rest_port" | ||
| overridePort "ssl_capi_port" | ||
| overridePort "ssl_proxy_downstream_port" | ||
| overridePort "ssl_proxy_upstream_port" | ||
|
|
||
|
|
||
| [[ "$1" == "couchbase-server" ]] && { | ||
|
|
||
| if [ "$(whoami)" = "couchbase" ]; then | ||
| # Ensure that /opt/couchbase/var is owned by user 'couchbase' and | ||
| # is writable | ||
| if [ ! -w /opt/couchbase/var -o \ | ||
| $(find /opt/couchbase/var -maxdepth 0 -printf '%u') != "couchbase" ]; then | ||
| echo "/opt/couchbase/var is not owned and writable by UID 1000" | ||
| echo "Aborting as Couchbase Server will likely not run" | ||
| exit 1 | ||
| fi | ||
| fi | ||
| echo "Starting Couchbase Server -- Web UI available at http://<ip>:$restPortValue" | ||
| echo "and logs available in /opt/couchbase/var/lib/couchbase/logs" | ||
| sh -c /setup.sh & | ||
| exec runsvdir -P /etc/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' | ||
| } | ||
|
|
||
| exec "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # wait for the couchbase-server starts | ||
| until curl -f http://Administrator:password@localhost:8091/pools/default | ||
| do | ||
| sleep 5s | ||
| done | ||
|
|
||
| # add "beer-sample" bucket from sampleBuckets | ||
| curl -v -u Administrator:password -X POST http://127.0.0.1:8091/sampleBuckets/install -d '["beer-sample"]' | ||
|
|
||
| # using couchbase-cli run xdcr-setup for the cluster | ||
| couchbase-cli xdcr-setup -c 127.0.0.1 -u Administrator -p password --create --xdcr-cluster-name cluster --xdcr-hostname 127.0.0.1 --xdcr-username Administrator --xdcr-password password | ||
|
|
||
| # wait till the xdcr-setup creates cluster | ||
| until curl -f http://Administrator:password@localhost:8091/pools/default/buckets/beer-sample/stats | ||
| do | ||
| sleep 5s | ||
| done | ||
|
|
||
| # perform replication from "beer-sample" to "travel-sample" | ||
| curl -v -X POST -u Administrator:password http://127.0.0.1:8091/controller/createReplication -d fromBucket=beer-sample -d toCluster=cluster -d toBucket=travel-sample -d replicationType=continuous -d enableCompression=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,4 @@ | ||
| variants: | ||
| v7.1.0: | ||
| COUCHBASE_VERSION: 7.1.0 | ||
| v7.0.2: | ||
| COUCHBASE_VERSION: 7.0.2 | ||
| v6.6.0: | ||
| COUCHBASE_VERSION: 6.6.0 | ||
| default: v7.1.0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.