├── test ├── testdata │ ├── empty_cert.pem │ ├── empty_key.pem │ ├── invalid_key_p8.der │ ├── valid_key_p8.der │ ├── valid_cert_and_key.p12 │ ├── valid_certs_and_key.p12 │ ├── invalid_cert_and_key.p12 │ ├── valid_ed25519_key.pem │ ├── valid_ecdsa_key.pem │ ├── valid_cert.pem │ ├── invalid_cert.pem │ ├── valid_rsa_key.pem │ ├── valid_key.pem │ ├── invalid_key.pem │ ├── valid_key_p8.pem │ └── invalid_key_p8.pem ├── mock_binary_server.py ├── test_topology_bar.py └── test_cbrecovery.py ├── .pylintrc ├── cb_version.cmake.py ├── docs ├── antora.yml ├── modules │ └── cli │ │ └── pages │ │ ├── _partials │ │ ├── nav-cbrecovery.adoc │ │ ├── nav-cbtransfer.adoc │ │ ├── nav-cblogredaction.adoc │ │ ├── nav-cbworkloadgen.adoc │ │ └── cbcli │ │ │ ├── part-common-options-no-creds.adoc │ │ │ ├── part-footer.adoc │ │ │ ├── part-common-cluster.adoc │ │ │ ├── part-host-formats.adoc │ │ │ ├── part-common-extras.adoc │ │ │ ├── part-common-history-retention.adoc │ │ │ ├── part-certificate-authentication.adoc │ │ │ ├── part-common-env.adoc │ │ │ ├── part-common-options.adoc │ │ │ └── nav.adoc │ │ └── cbcli │ │ ├── couchbase-cli-backup-service.adoc │ │ ├── couchbase-cli-rebalance-stop.adoc │ │ ├── couchbase-cli-user-change-password.adoc │ │ ├── couchbase-cli-rebalance-status.adoc │ │ ├── couchbase-cli-collect-logs-stop.adoc │ │ ├── couchbase-cli-server-info.adoc │ │ ├── couchbase-cli-node-reset.adoc │ │ ├── couchbase-cli-server-list.adoc │ │ ├── couchbase-cli-bucket-delete.adoc │ │ ├── couchbase-cli-host-list.adoc │ │ ├── couchbase-cli-bucket-flush.adoc │ │ ├── couchbase-cli-setting-analytics.adoc │ │ ├── couchbase-cli-admin-manage.adoc │ │ ├── couchbase-cli-bucket-list.adoc │ │ ├── cblogredaction.adoc │ │ ├── couchbase-cli-backup-service-settings.adoc │ │ ├── couchbase-cli-enable-developer-preview.adoc │ │ ├── couchbase-cli-reset-cipher-suites.adoc │ │ ├── couchbase-cli-collect-logs-status.adoc │ │ ├── couchbase-cli-node-to-node-encryption.adoc │ │ ├── couchbase-cli-setting-enterprise-analytics.adoc │ │ ├── couchbase-cli-enterprise-analytics-link-setup.adoc │ │ ├── couchbase-cli-setting-notification.adoc │ │ ├── couchbase-cli-setting-password-policy.adoc │ │ ├── couchbase-cli-bucket-compact.adoc │ │ ├── couchbase-cli-backup-service-nodes-threads-map.adoc │ │ ├── couchbase-cli-ip-family.adoc │ │ ├── couchbase-cli-reset-admin-password.adoc │ │ ├── couchbase-cli-group-manage.adoc │ │ ├── couchbase-cli-setting-saslauthd.adoc │ │ ├── couchbase-cli-master-password.adoc │ │ ├── couchbase-cli-failover.adoc │ │ ├── couchbase-cli-recovery.adoc │ │ ├── couchbase-cli-setting-index.adoc │ │ ├── couchbase-cli-setting-master-password.adoc │ │ ├── couchbase-cli-setting-alternate-address.adoc │ │ ├── couchbase-cli-setting-autoreprovision.adoc │ │ ├── couchbase-cli-setting-xdcr.adoc │ │ ├── couchbase-cli-cluster-edit.adoc │ │ ├── couchbase-cli-node-init.adoc │ │ ├── couchbase-cli-server-readd.adoc │ │ ├── couchbase-cli-setting-rebalance.adoc │ │ ├── couchbase-cli-server-eshell.adoc │ │ ├── couchbase-cli-server-add.adoc │ │ ├── couchbase-cli-xdcr-setup.adoc │ │ └── couchbase-cli-setting-cluster.adoc ├── asciidoctor-ext.rb ├── design │ ├── cli-ssl.md │ ├── cbworkloadgen.md │ ├── cli-sherlock-func-spec.md │ ├── cli-2.5-func-spec.md │ └── cli-3.0-func-spec.md └── CMakeLists.txt ├── mypy.ini ├── cb_util.py ├── Makefile ├── couchbase-cli ├── Pipfile ├── .gitignore ├── .githooks ├── pre-push └── pre-commit ├── cbtransfer ├── pump_bfd2.py ├── CMakeLists.txt └── jenkins ├── .aspell.en.pws └── adoc-lint.sh /test/testdata/empty_cert.pem: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/testdata/empty_key.pem: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.pylintrc: -------------------------------------------------------------------------------- 1 | [FORMAT] 2 | max-line-length = 120 3 | -------------------------------------------------------------------------------- /cb_version.cmake.py: -------------------------------------------------------------------------------- 1 | VERSION = "${_cli_version}" 2 | -------------------------------------------------------------------------------- /docs/antora.yml: -------------------------------------------------------------------------------- 1 | name: server 2 | version: '8.0' 3 | -------------------------------------------------------------------------------- /mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | ignore_missing_imports = True 3 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/nav-cbrecovery.adoc: -------------------------------------------------------------------------------- 1 | * xref:cli:cbrecovery.adoc[cbrecovery] 2 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/nav-cbtransfer.adoc: -------------------------------------------------------------------------------- 1 | * xref:cli:cbtransfer.adoc[cbtransfer] 2 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/nav-cblogredaction.adoc: -------------------------------------------------------------------------------- 1 | * xref:cli:cblogredaction.adoc[cblogredaction] 2 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/nav-cbworkloadgen.adoc: -------------------------------------------------------------------------------- 1 | * xref:cli:cbworkloadgen.adoc[cbworkloadgen] 2 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/part-common-options-no-creds.adoc: -------------------------------------------------------------------------------- 1 | include::part-common-cluster.adoc[] 2 | -------------------------------------------------------------------------------- /test/testdata/invalid_key_p8.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/couchbase/couchbase-cli/HEAD/test/testdata/invalid_key_p8.der -------------------------------------------------------------------------------- /test/testdata/valid_key_p8.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/couchbase/couchbase-cli/HEAD/test/testdata/valid_key_p8.der -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/part-footer.adoc: -------------------------------------------------------------------------------- 1 | == COUCHBASE-CLI 2 | 3 | Part of the man:couchbase-cli[1] suite 4 | -------------------------------------------------------------------------------- /test/testdata/valid_cert_and_key.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/couchbase/couchbase-cli/HEAD/test/testdata/valid_cert_and_key.p12 -------------------------------------------------------------------------------- /test/testdata/valid_certs_and_key.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/couchbase/couchbase-cli/HEAD/test/testdata/valid_certs_and_key.p12 -------------------------------------------------------------------------------- /test/testdata/invalid_cert_and_key.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/couchbase/couchbase-cli/HEAD/test/testdata/invalid_cert_and_key.p12 -------------------------------------------------------------------------------- /test/testdata/valid_ed25519_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MC4CAQAwBQYDK2VwBCIEIN7N0x4oMDWnmwzFVZSAQqidQIMWl5km0hLD0cm4tXSW 3 | -----END PRIVATE KEY----- 4 | -------------------------------------------------------------------------------- /cb_util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | 4 | def tag_user_data(value): 5 | '''Adds tags to user data so that it can be redacted later''' 6 | return f'{str(value)}' 7 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/part-common-cluster.adoc: -------------------------------------------------------------------------------- 1 | -c:: 2 | --cluster:: 3 | Specifies the hostname of a node in the cluster. See the HOST FORMATS 4 | section for more information on specifying a hostname. 5 | -------------------------------------------------------------------------------- /test/testdata/valid_ecdsa_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MIHcAgEBBEIBtFgWT96fL8rSkzdx1ixTIEMxQfC6GjnmciFqmkNSGPixpsE6oIDm 3 | q/JjMoTtOa/N006z+bkOskSs6zgzOmYxejygBwYFK4EEACOhgYkDgYYABAEQdVfu 4 | foDGnWuAayX9haTCBnAzU2oqicjDSi0TBIDDX/phCvcXQstB1DRnddBwSrzzgB+S 5 | mpFv5x/dLp3Mwdf2LgDW8fVKENZIHqWrE7McvRXUfoK0VeO6Gnf9e7nyzG7n28Z9 6 | ItiA4csNh3ofRLizplIW03rxprAHpq0VKVy+MIdaMg== 7 | -----END EC PRIVATE KEY----- 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PIPENV=pipenv --bare 2 | 3 | TESTS= 4 | 5 | install: 6 | @$(PIPENV) install --dev 7 | 8 | shell: install 9 | @$(PIPENV) shell 10 | 11 | documentation: install 12 | @$(PIPENV) run python3 docs/generate.py 13 | 14 | test: install 15 | @$(PIPENV) run python3 -m unittest discover --verbose --start-directory ./test --catch --failfast -k=$(TESTS) 16 | 17 | clean: 18 | @$(PIPENV) --rm 19 | 20 | .PHONY: clean install shell documentation test 21 | -------------------------------------------------------------------------------- /couchbase-cli: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | couchbase-cli - command-line cluster administration tool 6 | """ 7 | 8 | import sys 9 | 10 | import cbmgr 11 | 12 | 13 | def main(): 14 | try: 15 | cli = cbmgr.CouchbaseCLI() 16 | args = cli.parse(sys.argv) 17 | cli.execute(args) 18 | except KeyboardInterrupt: 19 | sys.exit(1) 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | name = "pypi" 3 | url = "https://pypi.org/simple" 4 | verify_ssl = true 5 | 6 | [packages] 7 | cryptography = "==41.0.1" 8 | pem = "==23.1.0" 9 | pycryptodome = "==3.18.0" 10 | pyopenssl = "==23.2.0" 11 | python-snappy = "==0.6.0" 12 | requests = "==2.31.0" 13 | requests-toolbelt = "==0.9.1" 14 | 15 | [dev-packages] 16 | autopep8 = "==1.5.7" 17 | jedi = "==0.18.0" 18 | mypy = "==1.3.0" 19 | pylint = "==2.10.2" 20 | rope = "==0.19.0" 21 | types-pyopenssl = "==20.0.5" 22 | types-requests = "==2.25.6" 23 | isort = "==5.9.3" 24 | 25 | [requires] 26 | python_version = "3.9" 27 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/part-host-formats.adoc: -------------------------------------------------------------------------------- 1 | == HOST FORMATS 2 | 3 | When specifying a host for the couchbase-cli command the following formats are expected: 4 | 5 | * `couchbase://` or `couchbases://` 6 | * `\http://:` or `\https://:` 7 | * `:` 8 | 9 | It is recommended to use the couchbase:// or couchbases:// format 10 | for standard installations. The other formats allow an option to take a port 11 | number which is needed for non-default installations where the admin port has 12 | been set up on a port other that 8091 (or 18091 for https). 13 | -------------------------------------------------------------------------------- /docs/asciidoctor-ext.rb: -------------------------------------------------------------------------------- 1 | Asciidoctor::Extensions.register do 2 | inline_macro :man do 3 | name_positional_attributes 'volnum' 4 | process do |parent, target, attrs| 5 | manname = target 6 | suffix = (volnum = attrs['volnum']) ? %[(#{volnum})] : '' 7 | if (doc = parent.document).basebackend? 'html' 8 | create_anchor parent, %(#{manname}#{suffix}), type: :link, target: %(#{manname}#{doc.outfilesuffix}) 9 | elsif doc.backend == 'manpage' 10 | doc.sub_quotes %(**#{manname}**#{suffix}) 11 | else 12 | %(#{manname}#{suffix}) 13 | end 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *~ 3 | *.pyc 4 | *.tar.gz 5 | tmp 6 | .idea 7 | /Makefile.in 8 | /aclocal.m4 9 | /autom4te.cache 10 | /config.cache 11 | /config.log 12 | /config.status 13 | /config/install-sh 14 | /config/missing 15 | /configure 16 | /m4/version.m4 17 | /membase 18 | /python_wrapper 19 | /wrapper/couchbase-cli 20 | /wrapper/cbbackup 21 | /wrapper/cbrecovery 22 | /wrapper/cbrestore 23 | /wrapper/cbtransfer 24 | /wrapper/membase 25 | /wrapper/cbworkloadgen 26 | /CMakeFiles/ 27 | /CTestTestfile.cmake 28 | /cmake_install.cmake 29 | /docs/html/ 30 | /man/ 31 | test/*.pem 32 | 33 | # gerrit git hooks 34 | .githooks/commit-msg 35 | 36 | # generated documentation 37 | docs/generated 38 | -------------------------------------------------------------------------------- /docs/design/cli-ssl.md: -------------------------------------------------------------------------------- 1 | New option added 2 | ---------------- 3 | 4 | **OPTIONS:** 5 | 6 | -u USERNAME, --user=USERNAME admin username of the cluster 7 | -p PASSWORD, --password=PASSWORD admin password of the cluster 8 | -o KIND, --output=KIND KIND is json or standard 9 | -d, --debug 10 | -s, --ssl uses SSL for communication with secure servers 11 | 12 | Example 13 | ------- 14 | 15 | Set data path and hostname for an unprovisioned cluster: 16 | 17 | couchbse-cli node-init -c 192.168.0.1:8091 \\ 18 | --node-init-data-path=/tmp/data \\ 19 | --node-init-index-path=/tmp/index \\ 20 | --node-init-hostname=myhostname \\ 21 | -u Administrator -p password \\ 22 | --ssl 23 | -------------------------------------------------------------------------------- /.githooks/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # ensure that we have the required dependencies installed 4 | for dep in aspell pylint; do 5 | if ! type -t $dep > /dev/null; then 6 | echo "Error: '$dep' is not installed" 1>&2 7 | exit 1 8 | fi 9 | done 10 | 11 | # run the adoc spell checker over all the available AsciiDoc files, this should reduce wasted time when there's trivial 12 | # spelling mistakes. 13 | ./jenkins/adoc-lint.sh 14 | 15 | # run multiple linters over the codebase before allowing allowing a push (these are the same linters that the build bot 16 | # runs), therefore, this should mean less wasted time spent fixing mistakes picked up when it's least convenient to fix 17 | # them. 18 | pylint --errors-only --disable=import-error cblogredaction cbrecovery cbtransfer cbworkloadgen couchbase-cli pump*.py 19 | pylint --errors-only --disable=import-error,unused-import --disable C,R cbmgr.py cluster_manager.py 20 | -------------------------------------------------------------------------------- /cbtransfer: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*-python-*- 3 | 4 | """ 5 | Data transfer tool for Couchbase. 6 | """ 7 | 8 | import os 9 | import platform 10 | import sys 11 | 12 | try: 13 | import pump_sfd 14 | except ImportError: 15 | if platform.system() == "Windows": 16 | p = "PATH" 17 | else: 18 | p = "LD_LIBRARY_PATH" 19 | for x in sys.argv: 20 | if x.startswith("couchstore-files://"): 21 | sys.exit("error: could not import couchstore module" 22 | "; directly accessing local couchstore-files:// will not work" 23 | "; please check your PYTHONPATH and %s environment variables" % (p)) 24 | 25 | import pump_transfer 26 | 27 | if __name__ == '__main__': 28 | if platform.system() == 'Windows': 29 | mydir = os.path.dirname(sys.argv[0]) 30 | bin_dir = os.path.join(mydir, '..') 31 | path = [mydir, bin_dir, os.environ['PATH']] 32 | os.environ['PATH'] = ';'.join(path) 33 | pump_transfer.exit_handler(pump_transfer.Transfer().main(sys.argv)) 34 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/part-common-extras.adoc: -------------------------------------------------------------------------------- 1 | -s:: 2 | --ssl:: 3 | (Deprecated) Specifies that the connection should use SSL verification. If 4 | this flag is used then SSL will be used but the cluster certificate will not 5 | be verified by the Certificate Authority. This flag is deprecated and not 6 | recommended. If you wish to use SSL encryption it is recommended that you 7 | specify the cluster host name using either _couchbases://_ or _https://_. 8 | Each of these connection schemes will ensure that the connection is 9 | encrypted with SSL. You may then use either --no-ssl-verify or --cacert in 10 | order to customize how your SSL connection is set up. 11 | 12 | --no-ssl-verify:: 13 | Specifies that SSL verification should be used but that verifying that the 14 | cluster certificate is valid should be skipped. Use of this flag is not 15 | recommended for production environments because it does not protect the user 16 | from a man-in-the-middle attack. 17 | 18 | --cacert:: 19 | Specifies that the SSL connection should use the cacert provided when 20 | connecting to the cluster. This argument takes the path the certificate 21 | file as its value. This is the most secure way to connect to your cluster. 22 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-backup-service.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-backup-service(1) 2 | ifndef::doctype-manpage[:doctitle: backup-service] 3 | 4 | ifdef::doctype-manpage[] 5 | == NAME 6 | 7 | couchbase-cli-backup-service - 8 | endif::[] 9 | Manages the Couchbase backup service 10 | 11 | == SYNOPSIS 12 | 13 | [verse] 14 | _couchbase-cli backup-service_ [--cluster ] [--username ] [--password ] 15 | [--client-cert ] [--client-cert-password ] [--client-key ] 16 | [--client-key-password ] 17 | 18 | == DESCRIPTION 19 | 20 | Manage the backup service 21 | 22 | == OPTIONS 23 | 24 | include::{partialsdir}/cbcli/part-common-options.adoc[] 25 | 26 | == SUBCOMMANDS 27 | 28 | man:couchbase-cli-backup-service-settings[1]:: 29 | Manage backup service configuration. 30 | 31 | man:couchbase-cli-backup-service-repository[1]:: 32 | Manage backup repositories. 33 | 34 | man:couchbase-cli-backup-service-plan[1]:: 35 | Manage backup plans. 36 | 37 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 38 | 39 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 40 | 41 | == ENVIRONMENT AND CONFIGURATION VARIABLES 42 | 43 | include::{partialsdir}/cbcli/part-common-env.adoc[] 44 | 45 | include::{partialsdir}/cbcli/part-footer.adoc[] 46 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-rebalance-stop.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-rebalance-stop(1) 2 | :description: Stops the current rebalance task 3 | ifndef::doctype-manpage[:doctitle: rebalance-stop] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-rebalance-stop - 9 | endif::[] 10 | Stops the current rebalance task 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli rebalance-stop_ [--cluster ] [--username ] [--password ] [--client-cert ] 16 | [--client-cert-password ] [--client-key ] [--client-key-password ] 17 | 18 | == DESCRIPTION 19 | 20 | Stops the currently running rebalance. 21 | 22 | == OPTIONS 23 | 24 | include::{partialsdir}/cbcli/part-common-options.adoc[] 25 | 26 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 27 | 28 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 29 | 30 | == EXAMPLES 31 | 32 | To stop the currently running rebalance, run the following command. 33 | 34 | $ couchbase-cli rebalance-stop -c 192.168.1.5 --username Administrator \ 35 | --password password 36 | 37 | == ENVIRONMENT AND CONFIGURATION VARIABLES 38 | 39 | include::{partialsdir}/cbcli/part-common-env.adoc[] 40 | 41 | == SEE ALSO 42 | 43 | man:couchbase-cli-rebalance[1], 44 | man:couchbase-cli-rebalance-status[1] 45 | 46 | include::{partialsdir}/cbcli/part-footer.adoc[] 47 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-user-change-password.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-user-change-password(1) 2 | :description: Change user password 3 | ifndef::doctype-manpage[:doctitle: user-change-password] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-user-change-password - 9 | endif::[] 10 | Change user password 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli-user-change-password_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--new-password ] 18 | 19 | == DESCRIPTION 20 | 21 | Changes the password of the current user. 22 | 23 | == OPTIONS 24 | 25 | include::{partialsdir}/cbcli/part-common-options.adoc[] 26 | 27 | --new-password :: 28 | The new password. 29 | 30 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 31 | 32 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 33 | 34 | == EXAMPLES 35 | 36 | To change the user password run the following command. 37 | ---- 38 | $ couchbase-cli user-change-password -c 192.168.1.5 -u readOnly \ 39 | -p password --new-password newpassword 40 | ---- 41 | 42 | == ENVIRONMENT AND CONFIGURATION VARIABLES 43 | 44 | include::{partialsdir}/cbcli/part-common-env.adoc[] 45 | 46 | == SEE ALSO 47 | 48 | man:couchbase-cli[1] 49 | 50 | include::{partialsdir}/cbcli/part-footer.adoc[] 51 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-rebalance-status.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-rebalance-status(1) 2 | :description: Show the current rebalance status 3 | ifndef::doctype-manpage[:doctitle: rebalance-status] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-rebalance-status - 9 | endif::[] 10 | Show the current rebalance status 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli rebalance-status_ [--cluster ] [--username ] [--password ] [--client-cert ] 16 | [--client-cert-password ] [--client-key ] [--client-key-password ] 17 | 18 | == DESCRIPTION 19 | 20 | Gets rebalance status information for the cluster. Currently the status either 21 | reports "running" or "not running". 22 | 23 | == OPTIONS 24 | 25 | include::{partialsdir}/cbcli/part-common-options.adoc[] 26 | 27 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 28 | 29 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 30 | 31 | == EXAMPLES 32 | 33 | To get the current rebalance status run the following command. 34 | 35 | $ couchbase-cli rebalance-status -c 192.168.1.5 --username Administrator \ 36 | --password password 37 | 38 | == ENVIRONMENT AND CONFIGURATION VARIABLES 39 | 40 | include::{partialsdir}/cbcli/part-common-env.adoc[] 41 | 42 | == SEE ALSO 43 | 44 | man:couchbase-cli-rebalance[1], 45 | man:couchbase-cli-rebalance-stop[1] 46 | 47 | include::{partialsdir}/cbcli/part-footer.adoc[] 48 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-collect-logs-stop.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-collect-logs-stop(1) 2 | :description: Stop the current log collection task 3 | ifndef::doctype-manpage[:doctitle: collect-logs-stop] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-collect-logs-stop - 9 | endif::[] 10 | Stop the current log collection task 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli collect-logs-stop_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] 18 | 19 | == DESCRIPTION 20 | 21 | This command cancels the currently running log collection task. 22 | 23 | == OPTIONS 24 | 25 | include::{partialsdir}/cbcli/part-common-options.adoc[] 26 | 27 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 28 | 29 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 30 | 31 | == EXAMPLES 32 | 33 | To stop the currently running log collection task run the following command 34 | below. 35 | 36 | $ couchbase-cli collect-logs-stop -c 192.168.1.5 --username Administrator \ 37 | --password password 38 | 39 | == ENVIRONMENT AND CONFIGURATION VARIABLES 40 | 41 | include::{partialsdir}/cbcli/part-common-env.adoc[] 42 | 43 | == SEE ALSO 44 | 45 | man:couchbase-cli-collect-logs-start[1], 46 | man:couchbase-cli-collect-logs-status[1] 47 | 48 | include::{partialsdir}/cbcli/part-footer.adoc[] 49 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/part-common-history-retention.adoc: -------------------------------------------------------------------------------- 1 | --history-retention-bytes :: 2 | Specifies how many bytes of document history the bucket should aim to retain 3 | on disk. This option is valid for Couchbase buckets with Magma storage backend 4 | only. By default, history retention in bytes is set to 0, which means that no 5 | history is retained and all stale data is removed during compaction. 6 | 7 | --history-retention-seconds :: 8 | Specifies how many seconds of document history the bucket should aim to retain 9 | on disk. This option is valid for Couchbase buckets with Magma storage backend 10 | only. By default, history retention in seconds is set to 0, which means that 11 | no history is retained and all stale data is removed during compaction. 12 | 13 | --enable-history-retention-by-default <0|1>:: 14 | Specifies whether or not the document history retention should be enabled by 15 | default for new collections in this bucket. This option is valid for Couchbase 16 | buckets with Magma storage backend only. To enable the document history 17 | retention for new collections, set this option to "1". To disable the document 18 | history retention for new collections, set this option to "0". By default, the 19 | document history retention for new collections is enabled. To create a 20 | collection with a non-default history retention setting use the *collection-manage* 21 | command with *--enable-history* flag set to either "0" or "1". 22 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-server-info.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-server-info(1) 2 | :description: Displays information and statistics about the Couchbase Server specified. 3 | ifndef::doctype-manpage[:doctitle: server-info] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-server-info - 9 | endif::[] 10 | Displays information and statistics about the Couchbase Server specified. 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli server-info_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] 18 | 19 | == DESCRIPTION 20 | 21 | This command prints information about the Couchbase Server specified. 22 | 23 | == OPTIONS 24 | 25 | include::{partialsdir}/cbcli/part-common-options.adoc[] 26 | 27 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 28 | 29 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 30 | 31 | == EXAMPLES 32 | 33 | To get information about the Couchbase Server on localhost (127.0.0.1) run 34 | the following command: 35 | 36 | $ couchbase-cli server-info -c 127.0.0.1 --username Administrator \ 37 | --password password 38 | 39 | 40 | == ENVIRONMENT AND CONFIGURATION VARIABLES 41 | 42 | include::{partialsdir}/cbcli/part-common-env.adoc[] 43 | 44 | == SEE ALSO 45 | 46 | man:couchbase-cli-host-list[1], 47 | man:couchbase-cli-server-list[1] 48 | 49 | include::{partialsdir}/cbcli/part-footer.adoc[] 50 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-node-reset.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-node-reset(1) 2 | :description: Resets a node 3 | ifndef::doctype-manpage[:doctitle: node-reset] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-node-reset - 9 | endif::[] 10 | Resets a node 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli node-reset_ [--cluster ] [--username ] [--password ] [--client-cert ] 16 | [--client-cert-password ] [--client-key ] [--client-key-password ] [--force] 17 | 18 | == DESCRIPTION 19 | 20 | This command will reset the node, completely wiping all data on it. 21 | This is designed to be used on nodes that have gone through unsafe failover, 22 | allowing them to be readded to the cluster. The command requires full admin 23 | permissions. 24 | 25 | Since all data will be lost, it is strongly recommended to backup the files on 26 | disk before running this command. 27 | 28 | == OPTIONS 29 | 30 | --force:: 31 | Reset the node without asking for confirmation. 32 | 33 | include::{partialsdir}/cbcli/part-common-options.adoc[] 34 | 35 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 36 | 37 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 38 | 39 | == ENVIRONMENT AND CONFIGURATION VARIABLES 40 | 41 | include::{partialsdir}/cbcli/part-common-env.adoc[] 42 | 43 | == SEE ALSO 44 | 45 | man:couchbase-cli-node-init[1], 46 | man:couchbase-cli-cluster-init[1], 47 | man:couchbase-cli-server-add[1] 48 | 49 | include::{partialsdir}/cbcli/part-footer.adoc[] 50 | 51 | -------------------------------------------------------------------------------- /.githooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # ensure that we have the required dependencies installed 4 | for dep in asciidoctor autopep8 isort sponge wget; do 5 | if ! type -t $dep > /dev/null; then 6 | echo "Error: '$dep' is not installed" 1>&2 7 | exit 1 8 | fi 9 | done 10 | 11 | # ensure the 'commit-msg' git hook has been downloaded and is marked as executable (otherwise it will be ignored by Git) 12 | if [[ ! -x .githooks/commit-msg ]]; then 13 | wget -q -P .githooks/ http://review.couchbase.org/tools/hooks/commit-msg 14 | chmod +x .githooks/commit-msg 15 | fi 16 | 17 | # ensure the custom aspell dictionary is sorted correctly 18 | (head -n 1 jenkins/.aspell.en.pws && tail -n +2 jenkins/.aspell.en.pws | LC_COLLATE="C" sort -fs) | sponge jenkins/.aspell.en.pws 19 | 20 | # we are safe to re-add the modified dictionary 21 | git add jenkins/.aspell.en.pws 22 | 23 | # generate and add the Antora nav files 24 | git add $(python3 docs/generate.py --navs --verbose) 25 | 26 | # only modify currently staged Python files 27 | staged_python_files=$(git diff --cached --name-only --diff-filter=d | grep -E '\.*\.py$' || true) 28 | 29 | # we didn't edit any Python files in this commit 30 | if [[ ${staged_python_files} == "" ]]; then 31 | exit 0 32 | fi 33 | 34 | # run autopep8 with the experimental/aggressive rules flags 35 | autopep8 --in-place --max-line-length=120 --experimental -aaa ${staged_python_files} 36 | isort --quiet -l 120 ${staged_python_files} 37 | 38 | # we are safe to re-add any files that were modified 39 | git add ${staged_python_files} 40 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-server-list.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-server-list(1) 2 | :description: Lists all servers in the cluster 3 | ifndef::doctype-manpage[:doctitle: server-list] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-server-list - 9 | endif::[] 10 | Lists all servers in the cluster 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli server-list_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] 18 | 19 | == DESCRIPTION 20 | 21 | Returns a new line separated list of all servers in the cluster. Each server 22 | name will be either a hostname or IP address. If no port number is specified for 23 | the server then the port number is 8091. 24 | 25 | == OPTIONS 26 | 27 | include::{partialsdir}/cbcli/part-common-options.adoc[] 28 | 29 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 30 | 31 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 32 | 33 | == EXAMPLES 34 | 35 | To get a list of servers in the cluster you can run the command below. 36 | 37 | $ couchbase-cli server-list -c 192.168.1.5:8091 --username Administrator \ 38 | --password password 39 | 40 | 192.168.1.5:8091 41 | 192.168.1.6:8091 42 | 192.168.1.7:8091 43 | 44 | == ENVIRONMENT AND CONFIGURATION VARIABLES 45 | 46 | include::{partialsdir}/cbcli/part-common-env.adoc[] 47 | 48 | == SEE ALSO 49 | 50 | man:couchbase-cli-host-list[1], 51 | man:couchbase-cli-server-info[1] 52 | 53 | include::{partialsdir}/cbcli/part-footer.adoc[] 54 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-bucket-delete.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-bucket-delete(1) 2 | :description: Delete a bucket 3 | ifndef::doctype-manpage[:doctitle: bucket-delete] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-bucket-delete - 9 | endif::[] 10 | Delete a bucket 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli bucket-delete_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--bucket ] 18 | 19 | == DESCRIPTION 20 | 21 | Deletes a bucket in the cluster. When the bucket is deleted, all indexes on the 22 | bucket are also deleted. 23 | 24 | == OPTIONS 25 | 26 | include::{partialsdir}/cbcli/part-common-options.adoc[] 27 | 28 | --bucket :: 29 | The name of the bucket to delete. 30 | 31 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 32 | 33 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 34 | 35 | == EXAMPLES 36 | 37 | To delete a bucket named "travel-data", run the command below. 38 | 39 | $ couchbase-cli bucket-delete -c 192.168.1.5 --username Administrator \ 40 | --password password --bucket travel-data 41 | 42 | == ENVIRONMENT AND CONFIGURATION VARIABLES 43 | 44 | include::{partialsdir}/cbcli/part-common-env.adoc[] 45 | 46 | == SEE ALSO 47 | 48 | man:couchbase-cli-bucket-compact[1], 49 | man:couchbase-cli-bucket-create[1], 50 | man:couchbase-cli-bucket-edit[1], 51 | man:couchbase-cli-bucket-flush[1], 52 | man:couchbase-cli-bucket-list[1] 53 | 54 | include::{partialsdir}/cbcli/part-footer.adoc[] 55 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | SET(COUCHBASE_CLI_CMDS cblogredaction;couchbase-cli) 3 | LIST(JOIN COUCHBASE_CLI_CMDS ", " COUCHBASE_CLI_CMDS_PRETTY) 4 | 5 | FIND_PROGRAM(ASCIIDOCTOR "asciidoctor") 6 | 7 | IF(ASCIIDOCTOR) 8 | ADD_CUSTOM_TARGET(COUCHBASE_CLI_DOCS 9 | ALL 10 | DEPENDS local-cbpy 11 | COMMAND ${PYTHON_EXE} generate.py --build-version ${PRODUCT_VERSION} 12 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) 13 | ELSE() 14 | MESSAGE (WARNING "Could not find 'asciidoctor', documentation for ${COUCHBASE_CLI_CMDS_PRETTY} will not be included in the installation package") 15 | ENDIF() 16 | 17 | FOREACH(CMD IN LISTS COUCHBASE_CLI_CMDS) 18 | INSTALL(DIRECTORY generated/doc/${CMD} 19 | DESTINATION share/doc 20 | FILES_MATCHING PATTERN "*.html") 21 | ENDFOREACH() 22 | 23 | if(NOT WIN32) 24 | # 1 Executable programs or shell commands 25 | # 2 System calls (functions provided by the kernel) 26 | # 3 Library calls (functions within program libraries) 27 | # 4 Special files (usually found in /dev) 28 | # 5 File formats and conventions, e.g. /etc/passwd 29 | # 6 Games 30 | # 7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7) 31 | # 8 System administration commands (usually only for root) 32 | # 9 Kernel routines [Non standard] 33 | 34 | FOREACH(SECTION RANGE 1 9) 35 | INSTALL(DIRECTORY generated/man/man${SECTION} 36 | DESTINATION share/man 37 | FILES_MATCHING PATTERN "*.${SECTION}") 38 | ENDFOREACH() 39 | ENDIF() 40 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-host-list.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-host-list(1) 2 | :description: Lists all hosts in the cluster 3 | ifndef::doctype-manpage[:doctitle: host-list] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-host-list - 9 | endif::[] 10 | Lists all hosts in the cluster 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli host-list_ [--cluster ] [--username ] [--password ] [--client-cert ] 16 | [--client-cert-password ] [--client-key ] [--client-key-password ] 17 | 18 | == DESCRIPTION 19 | 20 | Displays a list of hostnames corresponding to each node in the cluster. Each 21 | hostname is printed to stdout on its own line. The hostname may or may not 22 | contain a port number. If the port number is not a part of the hostname, then 23 | the port number is assumed to be 8091. 24 | 25 | == OPTIONS 26 | 27 | include::{partialsdir}/cbcli/part-common-options.adoc[] 28 | 29 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 30 | 31 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 32 | 33 | == EXAMPLES 34 | 35 | To get a list of hostnames for each node in the cluster run the following 36 | command: 37 | 38 | $ couchbase-cli host-list -c 192.168.1.5:8091 --username Administrator \ 39 | --password password 40 | 41 | cb1.mydomain.com:8091 42 | cb2.mydomain.com:8091 43 | cb3.mydomain.com:8091 44 | 45 | == ENVIRONMENT AND CONFIGURATION VARIABLES 46 | 47 | include::{partialsdir}/cbcli/part-common-env.adoc[] 48 | 49 | == SEE ALSO 50 | 51 | man:couchbase-cli-server-info[1], 52 | man:couchbase-cli-server-list[1] 53 | 54 | include::{partialsdir}/cbcli/part-footer.adoc[] 55 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-bucket-flush.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-bucket-flush(1) 2 | :description: Flush a bucket 3 | ifndef::doctype-manpage[:doctitle: bucket-flush] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-bucket-flush - 9 | endif::[] 10 | Flush a bucket 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli bucket-flush_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--bucket ] 18 | 19 | == DESCRIPTION 20 | 21 | Deletes all data from a bucket. The bucket itself is not deleted; and all 22 | its indexes and configuration-details remain unchanged. Applies to 23 | Couchbase and Ephemeral buckets. 24 | 25 | == OPTIONS 26 | 27 | include::{partialsdir}/cbcli/part-common-options.adoc[] 28 | 29 | --bucket :: 30 | The name of the bucket to flush. 31 | 32 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 33 | 34 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 35 | 36 | == EXAMPLES 37 | 38 | To flush a bucket named "travel-data", run the following command. 39 | 40 | $ couchbase-cli bucket-flush -c 192.168.1.5:8091 --username Administrator \ 41 | --password password --bucket travel-data 42 | 43 | == ENVIRONMENT AND CONFIGURATION VARIABLES 44 | 45 | include::{partialsdir}/cbcli/part-common-env.adoc[] 46 | 47 | == SEE ALSO 48 | 49 | man:couchbase-cli-bucket-compact[1], 50 | man:couchbase-cli-bucket-create[1], 51 | man:couchbase-cli-bucket-delete[1], 52 | man:couchbase-cli-bucket-edit[1], 53 | man:couchbase-cli-bucket-list[1] 54 | 55 | include::{partialsdir}/cbcli/part-footer.adoc[] 56 | -------------------------------------------------------------------------------- /pump_bfd2.py: -------------------------------------------------------------------------------- 1 | import pump 2 | import pump_bfd 3 | 4 | 5 | class BFDSinkEx(pump_bfd.BFDSink): 6 | 7 | def __init__(self, opts, spec, source_bucket, source_node, 8 | source_map, sink_map, ctl, cur): 9 | # pylint: disable=bad-super-call 10 | super(pump_bfd.BFDSink, self).__init__(opts, spec, source_bucket, source_node, source_map, 11 | sink_map, ctl, cur) 12 | self.mode = getattr(opts, "mode", "diff") 13 | self.init_worker(pump_bfd.BFDSink.run) 14 | 15 | @staticmethod 16 | def check_spec(source_bucket, source_node, opts, spec, cur): 17 | pump.Sink.check_spec(source_bucket, source_node, opts, spec, cur) 18 | 19 | seqno, dep, faillover_log, snapshot_markers = pump_bfd.BFD.find_seqno(opts, spec, 20 | source_bucket['name'], 21 | source_node['hostname'], 22 | getattr(opts, "mode", "diff")) 23 | if 'seqno' in cur: 24 | cur['seqno'][(source_bucket['name'], source_node['hostname'])] = seqno 25 | else: 26 | cur['seqno'] = {(source_bucket['name'], source_node['hostname']): seqno} 27 | 28 | if 'failoverlog' in cur: 29 | cur['failoverlog'][(source_bucket['name'], source_node['hostname'])] = faillover_log 30 | else: 31 | cur['failoverlog'] = {(source_bucket['name'], source_node['hostname']): faillover_log} 32 | 33 | if 'snapshot' in cur: 34 | cur['snapshot'][(source_bucket['name'], source_node['hostname'])] = snapshot_markers 35 | else: 36 | cur['snapshot'] = {(source_bucket['name'], source_node['hostname']): snapshot_markers} 37 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-analytics.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-analytics(1) 2 | :description: Manage Analytics service settings 3 | ifndef::doctype-manpage[:doctitle: setting-analytics] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-analytics - 9 | endif::[] 10 | Manage Analytics service settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-analytics [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--get] [--set] [--replicas ] 18 | 19 | == DESCRIPTION 20 | 21 | Manage Analytics service settings 22 | 23 | == OPTIONS 24 | 25 | include::{partialsdir}/cbcli/part-common-options.adoc[] 26 | 27 | --get:: 28 | Retrieve current Analytics service settings. 29 | 30 | --set:: 31 | Set Analytics settings. 32 | 33 | --replicas <0,1,2,3>:: 34 | Number of copies of the data the Analytics service will create. This increases the high 35 | availability of the service, allowing more nodes to be offline. Changing this setting will 36 | require a rebalance. 37 | 38 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 39 | 40 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 41 | 42 | == EXAMPLES 43 | 44 | To retrieve the Analytics service settings: 45 | 46 | $ couchbase-cli setting-analytics -c 127.0.01:8091 -u Administrator \ 47 | -p password --get 48 | 49 | To set the number of replicas to 3: 50 | 51 | $ couchbase-cli setting-analytics -c 127.0.01:8091 -u Administrator \ 52 | -p password --set --replicas 3 53 | 54 | == ENVIRONMENT AND CONFIGURATION VARIABLES 55 | 56 | include::{partialsdir}/cbcli/part-common-env.adoc[] 57 | 58 | == SEE ALSO 59 | 60 | man:couchbase-cli[1] 61 | 62 | include::{partialsdir}/cbcli/part-footer.adoc[] 63 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/part-certificate-authentication.adoc: -------------------------------------------------------------------------------- 1 | == CERTIFICATE AUTHENTICATION (MTLS AUTHENTICATION) 2 | 3 | This tool supports authenticating against a Couchbase Cluster by using certificate based authentication (mTLS 4 | authentication). To use certificate based authentication a certificate/key must be supplied, there a currently 5 | multiple ways this may be done. 6 | 7 | === PEM ENCODED CERTIFICATE/KEY 8 | 9 | An unencrypted PEM encoded certificate/key may be supplied by using: 10 | - `--client-cert ` 11 | - `--client-key ` 12 | 13 | The file passed to `--client-cert` must contain the client certificate, and an optional chain required to authenticate 14 | the client certificate. 15 | 16 | The file passed to `--client-key` must contain at most one private key, the key can be in one of the following formats: 17 | - PKCS#1 18 | - PKCS#8 19 | 20 | Currently, only the following key types are supported: 21 | - RSA 22 | - DSA 23 | 24 | === PEM ENCODED CERTIFICATE/PEM OR DER ENCRYPTED PKCS#8 KEY 25 | 26 | An encrypted PKCS#8 formatted key may be provided using: 27 | - `--client-cert ` 28 | - `--client-key ` 29 | - `--client-key-password ` 30 | 31 | The file passed to `--client-cert` must contain the client certificate, and an optional chain required to authenticate 32 | the client certificate. 33 | 34 | Currently, only the following key types are supported: 35 | - RSA 36 | - DSA 37 | 38 | === ENCRYPTED PKCS#12 CERTIFICATE/KEY 39 | 40 | An encrypted PKCS#12 certificate/key may be provided using: 41 | - `--client-cert ` 42 | - `--client-cert-password ` 43 | 44 | The file passed to `--client-cert` must contain the client certificate and exactly one private key. It may also contain 45 | the chain required to authenticate the client certificate. 46 | 47 | Currently, only the following key types are supported: 48 | - RSA 49 | - DSA 50 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | PROJECT(CouchbaseClient) 2 | CMAKE_MINIMUM_REQUIRED(VERSION 3.13) 3 | 4 | IF (BUILD_COLUMNAR) 5 | SET (_cli_version "${COLUMNAR_PRODUCT_VERSION}-enterprise-analytics") 6 | ELSE () 7 | SET (_cli_version "${PRODUCT_VERSION}") 8 | ENDIF () 9 | 10 | # Generate the Version module 11 | CONFIGURE_FILE (cb_version.cmake.py 12 | cb_version.py) 13 | 14 | # Copy couchstore.py from couchstore so we can import it 15 | CONFIGURE_FILE (../couchstore/python/couchstore.py couchstore.py COPYONLY) 16 | 17 | # Set of Python files required for couchbase-cli 18 | SET (cli_files 19 | cb_bin_client.py 20 | cbmgr.py 21 | cluster_manager.py 22 | couchbaseConstants.py 23 | pbar.py 24 | x509_adapter.py 25 | ${CMAKE_CURRENT_BINARY_DIR}/cb_version.py 26 | ${CMAKE_CURRENT_BINARY_DIR}/couchstore.py 27 | ) 28 | # Set of other Python files 29 | SET (py_files 30 | cb_util.py 31 | pump.py 32 | pump_bfd.py 33 | pump_cb.py 34 | pump_csv.py 35 | pump_gen.py 36 | pump_json.py 37 | pump_mc.py 38 | pump_sfd.py 39 | pump_transfer.py 40 | pump_dcp.py 41 | ) 42 | IF (BUILD_ENTERPRISE) 43 | LIST (APPEND py_files pump_bfd2.py) 44 | ENDIF () 45 | 46 | # Install couchbase-cli, including admin_tools package 47 | PyWrapper ( 48 | BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" 49 | ADD_TO_STANDALONE_PACKAGE admin_tools 50 | SCRIPTS 51 | couchbase-cli 52 | EXTRA_SCRIPTS ${cli_files} 53 | ) 54 | # Install remaining Python scripts 55 | PyWrapper ( 56 | BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}" 57 | SCRIPTS 58 | cblogredaction 59 | cbrecovery 60 | cbtransfer 61 | cbworkloadgen 62 | EXTRA_SCRIPTS ${py_files} 63 | ) 64 | 65 | ADD_SUBDIRECTORY(docs) 66 | 67 | ADD_CUSTOM_TARGET (couchbase-cli-clean 68 | COMMAND git clean -dfx 69 | COMMENT "Cleaning couchbase-cli directory" 70 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") 71 | IF (TARGET realclean) 72 | ADD_DEPENDENCIES (realclean couchbase-cli-clean) 73 | ENDIF () 74 | -------------------------------------------------------------------------------- /docs/design/cbworkloadgen.md: -------------------------------------------------------------------------------- 1 | cbworkloadgen 2 | ============= 3 | 4 | We use this tool to generate workload for couchbase server. The tool can generate predefined workload or run in loop mode until it is stopped. 5 | 6 | Run command 7 | ------------ 8 | 9 | cbworkloadgen OPTIONS 10 | 11 | OPTIONS: 12 | 13 | `-n HOST[:PORT]`, --node=HOST[:PORT] Default port is 8091 14 | 15 | `-u USERNAME`, --user=USERNAME REST username of the cluster. 16 | 17 | `-p PASSWORD`, --password=PASSWORD REST password of the cluster. 18 | 19 | `-b BUCKETNAME`, --bucket=BUCKETNAME Specific bucket name. Default is default bucket. Data can be inserted to a different bucket other than default. 20 | 21 | `-i ITEMS`, --item=ITEMS Number of items to be inserted. 22 | 23 | `-r RATIO`, --ratio=RATIO set/get operation ratio, which is a value between 0 and 1. Default .95 means 95% are set operations. 24 | 25 | `-s SIZE`, --size=SIZE minimum value size. Default is 10 bytes. 26 | 27 | `-j`, --json Insert json format data. Default is false 28 | 29 | `-l`, --loop Loop forever until it is interrupted by users 30 | 31 | `-t THREADS`, --threads=THREADS Number of concurrent workers to generate loads. Default is 1. 32 | 33 | `--prefix` prefix to use for memcached keys for json doc ids. Default is 'pymc' 34 | 35 | `-v`, --verbose Verbose logging; more -v's provide more verbosity 36 | 37 | `-h` --help Show this help message and exit 38 | 39 | Example 40 | ------- 41 | 42 | 43 | Upload 10000 json documents to localhost and to default bucket 44 | 45 | ./cbworkloadgen -n localhost -i 10000 -j 46 | 47 | 48 | Generate continuous workload to node 10.3.121.192 with 75% set and 25% get operations 49 | 50 | ./cbworkloadgen -n 10.3.121.192:8091 -r .75 -l 51 | 52 | Errors 53 | ------ 54 | 55 | These are kinds of error cases to consider ... 56 | 57 | * If inserted to bucket other than default, REST username and password are needed 58 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/part-common-env.adoc: -------------------------------------------------------------------------------- 1 | CB_REST_USERNAME:: 2 | Specifies the username to use when executing the command. This environment 3 | variable allows you to specify a default argument for the -u/--username 4 | argument on the command line. 5 | 6 | CB_REST_PASSWORD:: 7 | Specifies the password of the user executing the command. This environment 8 | variable allows you to specify a default argument for the -p/--password 9 | argument on the command line. It also allows the user to ensure that their 10 | password are not cached in their command line history. 11 | 12 | CB_REST_AUTH_TOKEN:: 13 | Specifies the JWT to authenticate with. This environment variable allows you 14 | to specify a default argument for the --auth-token argument on the command 15 | line. It also allows the user to ensure that their tokens are not cached 16 | in their command line history. 17 | 18 | CB_CLIENT_CERT:: 19 | The path to a client certificate used to authenticate when connecting to a 20 | cluster. May be supplied with `CB_CLIENT_KEY` as an alternative to the 21 | `CB_USERNAME` and `CB_PASSWORD` variables. See the CERTIFICATE AUTHENTICATION 22 | section for more information. 23 | 24 | CB_CLIENT_CERT_PASSWORD:: 25 | The password for the certificate provided to the `CB_CLIENT_CERT` variable, 26 | when using this variable, the certificate/key pair is expected to be in the 27 | PKCS#12 format. See the CERTIFICATE AUTHENTICATION section for more 28 | information. 29 | 30 | CB_CLIENT_KEY:: 31 | The path to the client private key whose public key is contained in the 32 | certificate provided to the `CB_CLIENT_CERT` variable. May be supplied with 33 | `CB_CLIENT_CERT` as an alternative to the `CB_USERNAME` and `CB_PASSWORD` 34 | variables. See the CERTIFICATE AUTHENTICATION section for more information. 35 | 36 | CB_CLIENT_KEY_PASSWORD:: 37 | The password for the key provided to the `CB_CLIENT_KEY` variable, when using 38 | this variable, the key is expected to be in the PKCS#8 format. See the 39 | CERTIFICATE AUTHENTICATION section for more information. 40 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-admin-manage.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-lock-admin(1) 2 | :description: Manages the built-in Couchbase Server administrator 3 | ifndef::doctype-manpage[:doctitle: admin-manage] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-admin-manage - 9 | endif::[] 10 | Manages the built-in Couchbase Server administrator 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli admin-manage_ [--ip ] [--port ] --lock | --unlock 16 | 17 | == DESCRIPTION 18 | 19 | This command is used to manage the built-in Couchbase Server Administrator user. 20 | There is only one built-in Administrator account, which is managed separately 21 | from the internal and external Administrator users. External and internal 22 | Administrator accounts can be managed using the 23 | man:couchbase-cli-user-manage[1] command. 24 | 25 | The `admin-manage` command must be run locally on a node that is part of the 26 | cluster (i.e. must connect to the host the command is run on). This is required, 27 | as `admin-manage` relies on a local authentication token, which is used to 28 | authenticate with the server and perform actions such as locking the user. As a 29 | result, the command does not require credentials to be passed. 30 | 31 | == OPTIONS 32 | --port:: 33 | Specify the REST API port of the locally running Couchbase Server. If no 34 | port is specified the default port 8091 is used. 35 | 36 | --ip:: 37 | Specify the IP address of the locally running Couchbase Server. If no 38 | ip is specified the default ip localhost is used. 39 | 40 | --lock:: 41 | Locks the built-in administrator user. 42 | 43 | --unlock:: 44 | Unlocks the built-in administrator user. 45 | 46 | == EXAMPLES 47 | 48 | To lock the built-in administrator, run the following command: 49 | ---- 50 | $ couchbase-cli admin-manage --lock 51 | ---- 52 | 53 | To unlock the built-in administrator, run the following command: 54 | ---- 55 | $ couchbase-cli admin-manage --unlock 56 | ---- 57 | 58 | == SEE ALSO 59 | 60 | man:couchbase-cli-user-manage[1] 61 | 62 | include::{partialsdir}/cbcli/part-footer.adoc[] 63 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-bucket-list.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-bucket-list(1) 2 | :description: List all buckets 3 | ifndef::doctype-manpage[:doctitle: bucket-list] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-bucket-list - 9 | endif::[] 10 | List all buckets 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli bucket-list_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] 18 | 19 | == DESCRIPTION 20 | 21 | Lists all buckets in the cluster. For each bucket, the following are printed 22 | to stdout: `bucketType`, `numReplicas`, `ramQuota`, `ramUsed`. If the bucket 23 | is encrypted then `encryptionAtRestStatus` is also printed. 24 | 25 | == OPTIONS 26 | 27 | include::{partialsdir}/cbcli/part-common-options.adoc[] 28 | 29 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 30 | 31 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 32 | 33 | == EXAMPLES 34 | 35 | To list all buckets in the cluster, run the following command. 36 | ---- 37 | $ couchbase-cli bucket-list -c 192.168.1.5:8091 --username Administrator \ 38 | --password password 39 | 40 | travel-data 41 | bucketType: membase 42 | numReplicas: 1 43 | ramQuota: 104857600 44 | ramUsed: 45302840 45 | vBuckets: 1024 46 | encryptionAtRestStatus: partiallyEncrypted 47 | airline-data 48 | bucketType: ephemeral 49 | numReplicas: 1 50 | ramQuota: 268435456 51 | ramUsed: 1134432 52 | vBuckets: 1024 53 | ---- 54 | == DISCUSSION 55 | 56 | In the output, RAM figures are in bytes. The "membase" bucketType signifies a 57 | Couchbase bucket. 58 | 59 | == ENVIRONMENT AND CONFIGURATION VARIABLES 60 | 61 | include::{partialsdir}/cbcli/part-common-env.adoc[] 62 | 63 | == SEE ALSO 64 | 65 | man:couchbase-cli-bucket-compact[1], 66 | man:couchbase-cli-bucket-create[1], 67 | man:couchbase-cli-bucket-delete[1], 68 | man:couchbase-cli-bucket-edit[1], 69 | man:couchbase-cli-bucket-flush[1] 70 | 71 | include::{partialsdir}/cbcli/part-footer.adoc[] 72 | -------------------------------------------------------------------------------- /test/testdata/valid_cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFqzCCA5OgAwIBAgIUaMvwdNshHNg91S9Ug1wqmnChHHswDQYJKoZIhvcNAQEL 3 | BQAwZDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFDASBgNVBAcM 4 | C1NhbnRhIENsYXJhMRIwEAYDVQQKDAlDb3VjaGJhc2UxFjAUBgNVBAMMDWNvdWNo 5 | YmFzZS5jb20wIBcNMjEwOTE0MDg0OTAyWhgPMzAyMTA5MjIwODQ5MDJaMGQxCzAJ 6 | BgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRQwEgYDVQQHDAtTYW50YSBD 7 | bGFyYTESMBAGA1UECgwJQ291Y2hiYXNlMRYwFAYDVQQDDA1jb3VjaGJhc2UuY29t 8 | MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuQNFXwHJcvrgFzpE1WTE 9 | Ot3hMLDEYHQDIXYBbcLHrdBW6yGdkRKxNS5Ymancw67yOFs/8yfTJv/Oxmnek5LC 10 | 1r3/XrNvKsVmt6ZMhGHq61ouf0j8hlEgIUU279hEoux4I6RijH4ZC1HxswtB0UDt 11 | XYUOTfraV6NRISnnKBJMhbu59Mq9pYYu2JXVmwyzmJavi3r03uhv7iQxqjrnkPM3 12 | oLN1X5hn6f7sP3vsvbTq2M+8wzGLnbasFMQaHfxL00EBIiHQmo+tQNZOOTZRbwoF 13 | 0t5d2DcoURsdM+zyXrHDOwKDgTT+yjDdD8GC2pu1xiFlcz4caX6NBez33RrjlpvU 14 | qy4uw0X/Asthx/EWmBTCUgzfC0Z5oCEK4zMAayy6dmKzO3H0ri7V1e4ARV86gcbX 15 | PN7f+t7fOwagSmjxnYloMSXuXMIXsfU0/abeAzYsVspRVF+SQODfAiQgmMqIPFB6 16 | Rn5i5g+SurDghexa/liWu0FMkrFJnnb6ELjpmusOAPughKHaCG1ajpITsQOktpJD 17 | 2EW1zLGPhRfWDvMF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------------------------------------------------- /test/testdata/invalid_cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFqzCCA5OgAwIBAgIUaMvwdNshHNg91S9Ug1wqmnChHHswDQYJKoZIhvcNAQEL 3 | BQAwZDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFDASBgNVBAcM 4 | C1NhbnRhIENsYXJhMRIwEAYDVQQKDAlDb3VjaGJhc2UxFjAUBgNVBAMMDWNvdWNo 5 | YmFzZS5jb20wIBcNMjEwOTE0MDg0OTAyWhgPMzAyMTA5MjIwODQ5MDJaMGQxCzAJ 6 | BgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRQwEgYDVQQHDAtTYW50YSBD 7 | bGFyYTESMBAGA1UECgwJQ291Y2hiYXNlMRYwFAYDVQQDDA1jb3VjaGJhc2UuY29t 8 | MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAuQNFXwHJcvrgFzpE1WTE 9 | Ot3hMLDEYHQDIXYBbcLHrdBW6yGdkRKxNS5Ymancw67yOFs/8yfTJv/Oxmnek5LC 10 | 1r3/XrNvKsVmt6ZMhGHq61ouf0j8hlEgIUU279hEoux4I6RijH4ZC1HxswtB0UDt 11 | XYUOTfraV6NRISnnKBJMhbu59Mq9pYYu2JXVmwyzmJavi3r03uhv7iQxqjrnkPM3 12 | oLN1X5hn6f7sP3vsvbTq2M+8wzGLnbasFMQaHfxL00EBIiHQmo+tQNZOOTZRbwoF 13 | 0t5d2DcoURsdM+zyXrHDOwKDgTT+yjDdD8GC2pu1xiFlcz4caX6NBez33RrjlpvU 14 | qy4uw0X/Asthx/EWmBTCUgzfC0Z5oCEK4zMAayy6dmKzO3H0ri7V1e4ARV86gcbX 15 | PN7f+t7fOwagSmjxnYloMSXuXMIXsfU0/abeAzYsVspRVF+SQODfAiQgmMqIPFB6 16 | Rn5i5g+SurDghexa/liWu0FMkrFJnnb6ELjpmusOAPughKHa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u2wKrMIU 33 | -----END CERTIFICATE----- 34 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/cblogredaction.adoc: -------------------------------------------------------------------------------- 1 | = cblogredaction(1) 2 | :description: Redacts log files 3 | ifndef::doctype-manpage[:doctitle: cblogredaction] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | cblogredaction - 9 | endif::[] 10 | Redacts log files 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _cblogredaction_ [-h] (-s | -g) [-t ] [-o ] [-v] 16 | File [File ...] 17 | 18 | == DESCRIPTION 19 | 20 | A tool to redact log files outside of Couchbase Server such as, SDK and 21 | cbbackupmgr log files. The redacted file will be named redacted-[filename] and 22 | will be placed in the current working directory. 23 | 24 | == OPTIONS 25 | 26 | -h, --help:: 27 | Show the help message. 28 | 29 | -s , --salt :: 30 | Specifies the salt to used to hash the data. If possible the salt should be 31 | the same used by Couchbase Server to allow the logs to be easily cross 32 | referenced. The Couchbase Server salt is at the top of the couchbase.log in 33 | the zip file generated by cbcollect_info. 34 | 35 | -g, --generate-salt:: 36 | Automatically generated the salt used to hash the data. This will make it 37 | harder to cross reference logs, where possible the salt should be specified 38 | using the -s option. 39 | 40 | -t , --threads :: 41 | The number of threads to use to redact the files. This option should only 42 | be used when multiple files are specified as only one thread can work on 43 | one file at a time. 44 | 45 | -o , --output-dir :: 46 | Specifies the directory to place the redacted log in, if this option is not 47 | used the redacted logs will be placed in the current working directory. 48 | 49 | -v, --verbose:: 50 | Increase output verbosity, the more times it is specified the more verbose 51 | the logging will be. 52 | 53 | 54 | == EXAMPLES 55 | 56 | To redact a file called `backup.log` using `ABCDEF` as the salt. 57 | ---- 58 | $ cblogredaction -s ABCDEF backup.log 59 | ---- 60 | To redact two files called `sdk-01.log` and `sdk-02.log` using a generated salt 61 | and two threads. 62 | ---- 63 | $ cblogredaction -g -t 2 sdk-01.log sdk-02.log 64 | ---- 65 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-backup-service-settings.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-backup-service-settings(1) 2 | ifndef::doctype-manpage[:doctitle: backup-service-settings] 3 | 4 | ifdef::doctype-manpage[] 5 | == NAME 6 | 7 | couchbase-cli-backup-service-settings - 8 | endif::[] 9 | Manage the backup service settings 10 | 11 | == SYNOPSIS 12 | 13 | [verse] 14 | _couchbase-cli backup-service [--cluster ] [--username ] 15 | [--password ] [--client-cert ] [--client-cert-password ] 16 | [--client-key ] [--client-key-password ] settings [--get] 17 | [--set] [--history-rotation-period ] [--history-rotation-size ] 18 | 19 | == DESCRIPTION 20 | 21 | Manage the backup service settings 22 | 23 | == OPTIONS 24 | 25 | --get:: 26 | Retrieve current backup service settings. 27 | 28 | --set:: 29 | Set backup service settings. 30 | 31 | --history-rotation-size :: 32 | The history size in mebibytes at which it should be rotated. Valid values are between 5 33 | and 200. 34 | 35 | --history-rotation-period :: 36 | The period in days at which the history should be rotated. Valid values are between 1 37 | and 365. 38 | 39 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 40 | 41 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 42 | 43 | == EXAMPLES 44 | 45 | To retrieve the backup service settings: 46 | ---- 47 | $ couchbase-cli backup-service -c 127.0.0.1:8091 -u Administrator -p password \ 48 | settings --get 49 | -- Backup service configuration -- 50 | History rotation size: 70 MiB 51 | History rotation period: 28 days 52 | ---- 53 | 54 | To set the backup service configuration use the `--set` flag and any of the configuration flags for example: 55 | ---- 56 | $ couchbase-cli backup-service -c 127.0.0.1:8091 -u Administrator -p password \ 57 | settings --set --history-rotation-size 70 --history-rotation-period 365 58 | SUCCESS: Backup service settings set 59 | ---- 60 | 61 | == ENVIRONMENT AND CONFIGURATION VARIABLES 62 | 63 | include::{partialsdir}/cbcli/part-common-env.adoc[] 64 | 65 | == SEE ALSO 66 | 67 | man:couchbase-cli-backup-service[1] 68 | 69 | include::{partialsdir}/cbcli/part-footer.adoc[] 70 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-enable-developer-preview.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-enable-developer-preview(1) 2 | :description: Enable developer preview mode in target cluster 3 | ifndef::doctype-manpage[:doctitle: enable-developer-preview] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-enable-developer-preview - 9 | endif::[] 10 | Enable developer preview mode in target cluster 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli enable-developer-preview_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--enable] [--list] 18 | 19 | == DESCRIPTION 20 | 21 | This command enables developer preview in the target cluster. Once enabled it 22 | can not be disabled and the cluster will not be able to upgrade. Do not use 23 | developer preview mode in production clusters. This command will prompt for 24 | user confirmation. 25 | 26 | == OPTIONS 27 | 28 | include::{partialsdir}/cbcli/part-common-options.adoc[] 29 | 30 | --enable:: 31 | Will set the cluster into developer preview mode after user confirmation 32 | that they want to set the cluster in developer preview mode. 33 | 34 | --list:: 35 | Specifies if the cluster is in developer preview mode. 36 | 37 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 38 | 39 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 40 | 41 | == EXAMPLES 42 | 43 | To enable developer preview mode on: 44 | 45 | $ couchbase-cli enable-developer-preview -c 192.168.1.5:8091 -u Administrator \ 46 | -p password --enable 47 | $ Developer preview cannot be disabled once it is enabled. If you enter 48 | developer preview mode you will not be able to upgrade. 49 | DO NOT USE IN PRODUCTION. 50 | Are you sure [y/n]: y 51 | SUCCESS: Cluster is in developer preview mode 52 | 53 | To check cluster mode: 54 | 55 | $ couchbase-cli enable-developer-preview -c localhost:9000 -u Administrator \ 56 | -p password --list 57 | $ Cluster is in developer preview mode 58 | 59 | == ENVIRONMENT AND CONFIGURATION VARIABLES 60 | 61 | include::{partialsdir}/cbcli/part-common-env.adoc[] 62 | 63 | 64 | include::{partialsdir}/cbcli/part-footer.adoc[] 65 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-reset-cipher-suites.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-reset-cipher-suites(1) 2 | :description: Resets the Couchbase Server cipher suites to the default 3 | ifndef::doctype-manpage[:doctitle: reset-cipher-suites] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-reset-cipher-suites - 9 | endif::[] 10 | Resets the Couchbase Server cipher suites to the default 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli reset-cipher-suites_ [--force] [--port ] 16 | [--config-path ] 17 | 18 | == DESCRIPTION 19 | 20 | This command is used to reset the cipher suites to the default for Couchbase 21 | Server. This command should only be used when the cipher have been configured 22 | in a way that breaks remote access. The cipher suit can be managed using the 23 | man:couchbase-cli-setting-security[1] command. 24 | 25 | The `reset-cipher-suites` command must be run locally on a node that is part 26 | of the cluster (i.e. must connect to the node the command is run on). This is 27 | required, as the cluster and ciphers suits could be configured in a way 28 | that disables remote access. `reset-cipher-suites` uses the local 29 | authentication token as a result the user that execute the command needs to 30 | have read access to the local Couchbase Server configuration files. 31 | 32 | == OPTIONS 33 | 34 | --force:: 35 | It reset the cipher suites without asking for confirmation. 36 | 37 | --port:: 38 | Specify the REST API port of the locally running Couchbase Server. If no 39 | port is specified the default port 8091 is used. 40 | 41 | --config-path:: 42 | Manually specify the path to the Couchbase Server configuration file. This 43 | is only needed if the configuration file is not in the default location, 44 | otherwise it can be found at `var/lib/couchbase` within the Couchbase 45 | Server installation directory. 46 | 47 | Note: on Mac, this path is instead located in the user's home directory, at 48 | `~/Library/Application Support/Couchbase/var/lib/couchbase`. 49 | 50 | == EXAMPLES 51 | 52 | To reset the cipher suites to the default: 53 | 54 | $ couchbase-cli reset-cipher-suites 55 | 56 | 57 | == SEE ALSO 58 | 59 | man:couchbase-cli-setting-security[1] 60 | 61 | include::{partialsdir}/cbcli/part-footer.adoc[] 62 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/part-common-options.adoc: -------------------------------------------------------------------------------- 1 | include::part-common-cluster.adoc[] 2 | 3 | -u:: 4 | --username :: 5 | Specifies the username of the user executing the command. If you do not have 6 | a user account with permission to execute the command then it will fail with 7 | an unauthorized error. 8 | 9 | -p:: 10 | --password :: 11 | Specifies the password of the user executing the command. If you do not have 12 | a user account with permission to execute the command then it will fail with 13 | an unauthorized error. If this argument is specified, but no password is 14 | given then the command will prompt the user for a password through 15 | non-echoed stdin. You may also specify your password by using the 16 | environment variable CB_REST_PASSWORD. 17 | 18 | --auth-token :: 19 | Specifies the JWT to authenticate with. If you do not have a user account 20 | with permission to execute the command then it will fail with an unauthorized 21 | error. You may also specify your token by using the environment variable 22 | CB_REST_AUTH_TOKEN. 23 | 24 | --client-cert :: 25 | The path to a client certificate used to authenticate when connecting to a 26 | cluster. May be supplied with `--client-key` as an alternative to the 27 | `--username` and `--password` flags. See the CERTIFICATE AUTHENTICATION 28 | section for more information. 29 | 30 | --client-cert-password :: 31 | The password for the certificate provided to the `--client-cert` flag, when 32 | using this flag, the certificate/key pair is expected to be in the PKCS#12 33 | format. See the CERTIFICATE AUTHENTICATION section for more information. 34 | 35 | --client-key :: 36 | The path to the client private key whose public key is contained in the 37 | certificate provided to the `--client-cert` flag. May be supplied with 38 | `--client-cert` as an alternative to the `--username` and `--password` 39 | flags. See the CERTIFICATE AUTHENTICATION section for more information. 40 | 41 | --client-key-password :: 42 | The password for the key provided to the `--client-key` flag, when using this 43 | flag, the key is expected to be in the PKCS#8 format. See the CERTIFICATE 44 | AUTHENTICATION section for more information. 45 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-collect-logs-status.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-collect-logs-status(1) 2 | :description: Get log collection status 3 | ifndef::doctype-manpage[:doctitle: collect-logs-status] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-collect-logs-status - 9 | endif::[] 10 | Get log collection status 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli collect-logs-status_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] 18 | 19 | == DESCRIPTION 20 | 21 | This command is used to check the status of the log collection task that is 22 | either currently running or last completed. This command is especially useful 23 | since it lists the exact location of the collected files on each node. Upon a 24 | successful run of this command the output will either be one of the two messages 25 | below. 26 | 27 | No log collection tasks were found 28 | 29 | or 30 | 31 | Status: 32 | Details: 33 | Node: 34 | Status: 35 | path: 36 | 37 | If logs for multiple nodes were collected, then multiple nodes will be listed in 38 | the details section. 39 | 40 | == OPTIONS 41 | 42 | include::{partialsdir}/cbcli/part-common-options.adoc[] 43 | 44 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 45 | 46 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 47 | 48 | == EXAMPLES 49 | 50 | To see the status of a running or completed log collection task run the command 51 | below. 52 | 53 | $ couchbase-cli collect-logs-status -c 192.168.1.5 --username Administrator \ 54 | --password password 55 | 56 | Status: completed 57 | Details: 58 | Node: n_0@192.168.1.5 59 | Status: collected 60 | path: /opt/couchbase/var/lib/couchbase/tmp/collectinfo-2016-09-27T005502-n_0@192.168.1.5.zip 61 | 62 | == ENVIRONMENT AND CONFIGURATION VARIABLES 63 | 64 | include::{partialsdir}/cbcli/part-common-env.adoc[] 65 | 66 | == SEE ALSO 67 | 68 | man:couchbase-cli-collect-logs-start[1], 69 | man:couchbase-cli-collect-logs-stop[1] 70 | 71 | include::{partialsdir}/cbcli/part-footer.adoc[] 72 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-node-to-node-encryption.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-node-to-node-encryption(1) 2 | :description: Changes node-to-node encryption 3 | ifndef::doctype-manpage[:doctitle: node-to-node-encryption] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-node-to-node-encryption - 9 | endif::[] 10 | Changes node-to-node encryption 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli node-to-node-encryption_ [--cluster ] [-username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--get] [--enable] [--disable] 18 | 19 | == DESCRIPTION 20 | 21 | This command allows the enabling and disabling of node-to-node encryption this 22 | means data transferred between nodes in a cluster will be encrypted. The 23 | command will execute a series of instructions in each node in the cluster to 24 | switch them from sending and receiving over a non-encrypted connection to an 25 | encrypted one or vice-versa. 26 | 27 | == OPTIONS 28 | 29 | include::{partialsdir}/cbcli/part-common-options.adoc[] 30 | 31 | --get:: 32 | Display the node-to-node encryption settings 33 | 34 | --enable:: 35 | Will enable node-to-node encryption 36 | 37 | --disable:: 38 | Will disable node-to-node encryption 39 | 40 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 41 | 42 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 43 | 44 | == EXAMPLES 45 | 46 | To enable node-to-node encryption in a cluster with two host 47 | `[cb1.mydomain.com:8091, cb2.mydomain.com:8091]` run the following 48 | commands: 49 | 50 | $ couchbase-cli node-to-node-encryption -c cb1.mydomain.com:8091 --username Administrator \ 51 | --password password --enable 52 | 53 | 54 | To check if node-to-node encryption is on or off run: 55 | 56 | $ couchbase-cli node-to-node-encryption -c cb1.mydomain.com:8091 --username Administrator \ 57 | --password password --get 58 | 59 | To disable node-to-node encryption use the following command: 60 | 61 | $ couchbase-cli node-to-node-encryption -c cb1.mydomain.com:8091 --username Administrator \ 62 | --password password --disable 63 | 64 | 65 | == ENVIRONMENT AND CONFIGURATION VARIABLES 66 | 67 | include::{partialsdir}/cbcli/part-common-env.adoc[] 68 | 69 | == SEE ALSO 70 | 71 | man:couchbase-cli-setting-security[1] 72 | man:couchbase-cli-ssl-manage[1] 73 | man:couchbase-cli-ip-family[1] 74 | 75 | include::{partialsdir}/cbcli/part-footer.adoc[] 76 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-enterprise-analytics.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-enterprise-analytics(1) 2 | :description: Manage Enterprise Analytics service settings 3 | ifndef::doctype-manpage[:doctitle: setting-enterprise-analytics] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-enterprise-analytics - 9 | endif::[] 10 | Manage Enterprise Analytics service settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-enterprise-analytics_ [--cluster ] [--username ] 16 | [--password ] [--client-cert ] [--client-cert-password ] 17 | [--client-key ] [--client-key-password ] [--get] [--set] 18 | [--partitions ] [--scheme ] [--bucket ] 19 | [--prefix ] [--region ] [--endpoint ] 20 | [--anonymous-auth <0|1>] [--path-style-addressing <0|1>] 21 | 22 | == DESCRIPTION 23 | 24 | Manage Enterprise Analytics service settings 25 | 26 | == OPTIONS 27 | 28 | include::{partialsdir}/cbcli/part-common-options.adoc[] 29 | 30 | --get:: 31 | Retrieve current Enterprise Analytics service settings. 32 | 33 | --set:: 34 | Set Enterprise Analytics settings. 35 | 36 | --partitions :: 37 | The number of storage partitions (positive integer, lower than the configured maximum) 38 | 39 | --scheme :: 40 | The BLOB storage scheme (e.g. s3) 41 | 42 | --bucket :: 43 | The BLOB storage bucket 44 | 45 | --prefix :: 46 | The BLOB storage prefix 47 | 48 | --region :: 49 | The BLOB storage region 50 | 51 | --endpoint :: 52 | The BLOB storage endpoint 53 | 54 | --anonymous-auth <0|1>:: 55 | Allow BLOB storage anonymous auth 56 | 57 | --path-style-addressing <0|1>:: 58 | Use BLOB storage path style addressing 59 | 60 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 61 | 62 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 63 | 64 | == EXAMPLES 65 | 66 | To retrieve the Enterprise Analytics service settings: 67 | 68 | $ couchbase-cli setting-enterprise-analytics -c 127.0.01:8091 -u Administrator \ 69 | -p password --get 70 | 71 | To set the BLOB storage scheme to s3: 72 | 73 | $ couchbase-cli setting-enterprise-analytics -c 127.0.01:8091 -u Administrator \ 74 | -p password --set --scheme s3 75 | 76 | == ENVIRONMENT AND CONFIGURATION VARIABLES 77 | 78 | include::{partialsdir}/cbcli/part-common-env.adoc[] 79 | 80 | == SEE ALSO 81 | 82 | man:couchbase-cli[1] 83 | 84 | include::{partialsdir}/cbcli/part-footer.adoc[] 85 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-enterprise-analytics-link-setup.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-enterprise-analytics-link-setup(1) 2 | :description: Manage Enterprise Analytics links 3 | ifndef::doctype-manpage[:doctitle: enterprise-analytics-link-setup] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-enterprise-analytics-link-setup - 9 | endif::[] 10 | Manage Enterprise Analytics links 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli enterprise-analytics-link-setup_ [--cluster ] [--username ] 16 | [--password ] [--client-cert ] [--client-cert-password ] 17 | [--client-key ] [--client-key-password ] [--create] [--delete] 18 | [--edit] [--list] [--name ] [--link-details ] [--link-details-path ] 19 | 20 | == DESCRIPTION 21 | 22 | This command is used to manage links used by the external dataset and remote 23 | cluster capabilities of the Enterprise Analytics Service. 24 | 25 | == OPTIONS 26 | 27 | === Common Link Options 28 | 29 | include::{partialsdir}/cbcli/part-common-options.adoc[] 30 | 31 | --create:: 32 | Creates a new link. 33 | 34 | --delete:: 35 | Deletes a link. 36 | 37 | --edit:: 38 | Edits a link. 39 | 40 | --get:: 41 | Retrieve link details. 42 | 43 | --list:: 44 | List defined links. 45 | 46 | --name :: 47 | The name of the link. 48 | 49 | --link-details :: 50 | The link details as JSON string 51 | 52 | --link-details-path :: 53 | The path to the link details JSON file 54 | 55 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 56 | 57 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 58 | 59 | == EXAMPLES 60 | 61 | To create a new link named "l1", run the following command: 62 | 63 | $ couchbase-cli enterprise-analytics-link-setup -c 192.168.1.5 -u Administrator \ 64 | -p password --create --name l1 --link-details-path 65 | 66 | To delete the new link named "l1", run the following command: 67 | 68 | $ couchbase-cli enterprise-analytics-link-setup -c 192.168.1.5 -u Administrator \ 69 | -p password --delete --name l1 70 | 71 | To list the defined links run the following command: 72 | 73 | $ couchbase-cli enterprise-analytics-link-setup -c 192.168.1.5 -u Administrator \ 74 | -p password --list 75 | 76 | To retrieve the link details for a link named "l1", run the following command: 77 | 78 | $ couchbase-cli enterprise-analytics-link-setup -c 192.168.1.5 -u Administrator \ 79 | -p password --get --name l1 80 | 81 | == ENVIRONMENT AND CONFIGURATION VARIABLES 82 | 83 | include::{partialsdir}/cbcli/part-common-env.adoc[] 84 | 85 | include::{partialsdir}/cbcli/part-footer.adoc[] 86 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-notification.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-notification(1) 2 | :description: Modifies notification settings (EE only) 3 | ifndef::doctype-manpage[:doctitle: setting-notification] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-notification - 9 | endif::[] 10 | Modifies notification settings (EE only) 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-notification_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--enable-notifications ] 18 | 19 | == DESCRIPTION 20 | 21 | Enabling notifications allows the Couchbase Administration Console to notify 22 | users about newer versions of Couchbase Server. This system also collects 23 | information about use and experience with the product every time an 24 | administrator interacts with the administrator user interface. It collects 25 | configuration, usage and performance data, including cluster information 26 | (such as settings and configuration, software version, cluster ID, load 27 | levels, and resource quotas), and browser and network information (such as 28 | IP address, inferred geolocation only at the city level, and browser type). 29 | This does not allow Couchbase to track your specific interactions or usage 30 | of the Couchbase Server. It never accesses or collects any data stored 31 | within Couchbase Server. 32 | 33 | == OPTIONS 34 | 35 | include::{partialsdir}/cbcli/part-common-options.adoc[] 36 | 37 | --enable-notification :: 38 | Specifies whether or not notifications should be enabled. To enable 39 | notifications set this flag to "1". To disable notifications set this flag 40 | to "0". 41 | 42 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 43 | 44 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 45 | 46 | == EXAMPLES 47 | 48 | To enable notifications on a Couchbase cluster run the following command\&. 49 | 50 | $ couchbase-cli setting-notification -c 192.168.1.5 -u Administrator \ 51 | -p password --enable-notification 1 52 | 53 | To disable notifications run the following command. 54 | 55 | $ couchbase-cli setting-notification -c 192.168.1.5 -u Administrator \ 56 | -p password --enable-notification 0 57 | 58 | == DISCUSSION 59 | 60 | The setting-notification subcommand either enables or disables notifications 61 | about new Couchbase releases. This setting is a global parameter and applies to 62 | all nodes in a cluster. 63 | 64 | == ENVIRONMENT AND CONFIGURATION VARIABLES 65 | 66 | include::{partialsdir}/cbcli/part-common-env.adoc[] 67 | 68 | == SEE ALSO 69 | 70 | man:couchbase-cli[1], 71 | man:couchbase-cli-cluster-init[1] 72 | 73 | include::{partialsdir}/cbcli/part-footer.adoc[] 74 | -------------------------------------------------------------------------------- /jenkins/.aspell.en.pws: -------------------------------------------------------------------------------- 1 | personal_ws-1.1 en 0 2 | adoc 3 | AES 4 | analytics 5 | APAC 6 | API 7 | api 8 | APIs 9 | args 10 | arn 11 | auth 12 | autofailover 13 | autoreprovision 14 | aws 15 | AzureBlob 16 | azureblob 17 | AzureDataLake 18 | azuredatalake 19 | backend 20 | backoff 21 | bashrc 22 | bucketType 23 | cacert 24 | CAS 25 | cbbackup 26 | cbbackupmgr 27 | cbbackupwrapper 28 | cbcli 29 | cbcollect 30 | cbdatarecovery 31 | cblogredaction 32 | CBO 33 | cbrecovery 34 | cbrestore 35 | cbrestorewrapper 36 | cbtransfer 37 | cbworkloadgen 38 | cfg 39 | CLI 40 | cli 41 | cmd 42 | config 43 | Couchbase 44 | couchbase 45 | couchdb 46 | couchstore 47 | CPU 48 | cpu 49 | CPUs 50 | creds 51 | CSV 52 | csv 53 | Ctrl 54 | dataset 55 | datasets 56 | dataverse 57 | dataverses 58 | DCP 59 | dcp 60 | DDoc 61 | decrypt 62 | decrypted 63 | decrypts 64 | DEK 65 | dek 66 | DEKs 67 | deks 68 | DER 69 | dest 70 | dir 71 | dn 72 | doctitle 73 | DSA 74 | ebin 75 | EE 76 | enablement 77 | erl 78 | erlang 79 | eshell 80 | ETL 81 | eventing 82 | expirations 83 | failover 84 | failovers 85 | forestdb 86 | FQDN 87 | FTS 88 | fts 89 | fullEviction 90 | gamesim 91 | GCS 92 | gcs 93 | geolocation 94 | GSI 95 | gsi 96 | HLC 97 | hlc 98 | hostname 99 | hostnames 100 | hsts 101 | http 102 | HTTPS 103 | https 104 | https 105 | imds 106 | includeSubDomains 107 | init 108 | intra 109 | ip 110 | IPv 111 | ipv 112 | iso 113 | JSON 114 | json 115 | JWT 116 | kek 117 | kmip 118 | kms 119 | kubernetes 120 | KV 121 | kv 122 | ldap 123 | localhost 124 | loopback 125 | majorityAndPersistActive 126 | mebibytes 127 | membase 128 | memberOf 129 | memcached 130 | MiB 131 | moxi 132 | msg 133 | MTLS 134 | mTLS 135 | namespace 136 | NAT'd 137 | NFS 138 | noEviction 139 | nosql 140 | nruEviction 141 | ns 142 | num 143 | oauth 144 | oom 145 | opsys 146 | ou 147 | pem 148 | persistToMajority 149 | PKCS 150 | pkey 151 | preload 152 | QL 153 | ql 154 | ramsize 155 | RBAC 156 | rbac 157 | readd 158 | readded 159 | rebalance 160 | rebalanced 161 | rebalances 162 | rebalancing 163 | reprovision 164 | reprovisioned 165 | reprovisioning 166 | ro 167 | roadmins 168 | RSA 169 | runtime 170 | SASL 171 | sasl 172 | saslauth 173 | saslauthd 174 | SDK 175 | sdk 176 | SDKs 177 | seqno 178 | SIGINT 179 | sqlpp 180 | SSL 181 | ssl 182 | startTLS 183 | stderr 184 | stdin 185 | stdout 186 | storages 187 | subcommand 188 | subcommands 189 | TCP 190 | tcp 191 | tls 192 | tmp 193 | transactional 194 | TTL 195 | ttl 196 | UI 197 | ui 198 | uid 199 | uncompress 200 | UNDEPLOY 201 | undeploy 202 | undeployed 203 | undeploys 204 | unencrypted 205 | url 206 | urls 207 | UUID 208 | v's 209 | valueOnly 210 | Varley 211 | vBucket 212 | vbucket 213 | vBuckets 214 | vbuckets 215 | VM 216 | vm 217 | VVV 218 | vvv 219 | WHITELIST 220 | www 221 | xattr 222 | xdcr 223 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-password-policy.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-password-policy(1) 2 | :description: Manage the password policy for new users 3 | ifndef::doctype-manpage[:doctitle: setting-password-policy] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-password-policy - 9 | endif::[] 10 | Manage the password policy for new users 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-password-policy_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--get] [--set] [--min-length ] 18 | [--uppercase <0|1> ] [--lowercase <0|1>] [--digit <0|1>] 19 | [--special-chars <0|1>] 20 | 21 | == DESCRIPTION 22 | 23 | Allows retrieval of the current password policy and creating a new password 24 | policy for new Couchbase users. This allows administrators to customize the 25 | complexity of user passwords. 26 | 27 | == OPTIONS 28 | 29 | include::{partialsdir}/cbcli/part-common-options.adoc[] 30 | 31 | --get:: 32 | Retrieves the current password policy. 33 | 34 | --set:: 35 | Creates a new password policy. Use the flags below to specify different 36 | levels of password complexity required for new users and users who change 37 | their existing passwords. 38 | 39 | --min-length :: 40 | Specifies the minimum password length for new passwords. 41 | 42 | --uppercase <0|1>:: 43 | Specifies that new passwords must contain at least one upper case letter. 44 | 45 | --lowercase <0|1>:: 46 | Specifies that new passwords must contain at least one lower case letter. 47 | 48 | --digit <0|1>:: 49 | Specifies that new passwords must contain at least one digit. 50 | 51 | --special-char <0|1>:: 52 | Specifies that new passwords must contain at least one special character. 53 | 54 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 55 | 56 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 57 | 58 | == EXAMPLES 59 | 60 | To get the current password policy run the following command. 61 | 62 | $ couchbase-cli setting-password-policy -c 192.168.1.5 -u Administrator \ 63 | -p password --get 64 | 65 | To set a new password policy where the minimum password length is 10 character 66 | and require that all passwords contain an upper case letter, lower case letter, 67 | and a digit run the following command. 68 | 69 | $ couchbase-cli setting-password-policy -c 192.168.1.5 -u Administrator \ 70 | -p password --set --min-length 10 --uppercase 1 --lowercase 1 --digits 1 71 | 72 | == ENVIRONMENT AND CONFIGURATION VARIABLES 73 | 74 | include::{partialsdir}/cbcli/part-common-env.adoc[] 75 | 76 | == SEE ALSO 77 | 78 | man:couchbase-cli[1], 79 | man:couchbase-cli-user-manage[1] 80 | 81 | include::{partialsdir}/cbcli/part-footer.adoc[] 82 | -------------------------------------------------------------------------------- /jenkins/adoc-lint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Copyright 2020 Couchbase, Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 18 | # FILTER allows us to pre-process the source and discard irrelevant parts. 19 | FILTER="sed" 20 | # Ignore source code blocks (contain arbitrary non-English configuration). 21 | FILTER="${FILTER} -e /^----$/,/^----$/d" 22 | # Ignore asciidoc ifdef blocks (contain arbitrary non-English configuration). 23 | FILTER="${FILTER} -e /^ifdef/,/^endif/d" 24 | # Ignore inline literals (contain arbitrary non-English configuration). 25 | FILTER="${FILTER} -e s/\`[^\`]*\`//g" 26 | # Ignore definition lists (contain arbitrary non-English configuration). 27 | FILTER="${FILTER} -e s/^.*::$//g" 28 | # Ignore cross-reference file names (not user-visible, however this may affect SEO). 29 | FILTER="${FILTER} -e s/xref:[^\[]*//g" 30 | # Ignore image file names (not user-visible, however this may affect SEO). 31 | FILTER="${FILTER} -e s/image:[^\[]*//g" 32 | # Ignore include statements. 33 | FILTER="${FILTER} -e s/^include::.*\[]$//g" 34 | # Ignore ifndef statements. 35 | FILTER="${FILTER} -e s/^ifndef::.*\[//g" 36 | # In the CLI we use for meta var which sometimes are not real words so lets ignore them. 37 | FILTER="${FILTER} -e s/<.*>//g" 38 | # Ignore page aliases directives 39 | FILTER="${FILTER} -e s/:page-aliases:\s\S*//g" 40 | 41 | # CHECK_ARGS is the spell checking command to run. 42 | CHECK_ARGS="-l en_US --home-dir=. --add-extra-dicts=${DIR}/.aspell.en.pws" 43 | 44 | # For each asciidoc we find in the documentation, filter out the 45 | # stuff that isn't real text and spell check the remainder. 46 | FAIL="" 47 | for DOCUMENT in $(find docs/modules/cli/pages/ -type f -name '*.adoc'); do 48 | # Skip old adocs 49 | if [[ $DOCUMENT == *"/old/"* ]]; then 50 | continue 51 | fi 52 | 53 | MISTAKES=$(cat ${DOCUMENT} | ${FILTER} | aspell list ${CHECK_ARGS} | sort | uniq) 54 | if [[ ${MISTAKES} != "" ]]; then 55 | echo "Spell check for file ${DOCUMENT} failed:" 56 | echo "${MISTAKES}" | sed 's/^/ /g' 57 | FAIL="yes" 58 | fi 59 | done 60 | 61 | # Any failures need to be fixed up, and we need to report and error for CI. 62 | if [[ ${FAIL} != "" ]]; then 63 | echo "Documentation contains errors" 64 | echo " run 'aspell check ${CHECK_ARGS}' to fix typos or add to .aspell.en.pws" 65 | exit 1 66 | fi 67 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-bucket-compact.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-bucket-compact(1) 2 | :description: Compact a bucket 3 | ifndef::doctype-manpage[:doctitle: bucket-compact] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-bucket-compact - 9 | endif::[] 10 | Compact a bucket 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli bucket-compact_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--bucket ] 18 | 19 | == DESCRIPTION 20 | 21 | Starts compaction of view index and data files for a specified bucket. To 22 | compact view index files only, specify the --view-only option. To compact data 23 | files only, specify the --data-only option. Only Couchbase buckets can be 24 | compacted: Ephemeral and Memcached buckets cannot be compacted. 25 | 26 | == OPTIONS 27 | 28 | include::{partialsdir}/cbcli/part-common-options.adoc[] 29 | 30 | --bucket:: 31 | The name of the bucket on which to perform compaction. 32 | 33 | --data-only:: 34 | Indicates that only data files should be compacted, and that compaction 35 | for view index files should therefore be skipped. This option cannot be 36 | specified at the same time as the --view-only option. 37 | 38 | --view-only:: 39 | Indicates that only view index files should be compacted, and that 40 | compaction for data files should therefore be skipped. This option cannot be 41 | specified at the same time as the --data-only option. 42 | 43 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 44 | 45 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 46 | 47 | == EXAMPLES 48 | 49 | To start compaction of both data and view index files for a bucket named 50 | "travel-data", run the following command. 51 | 52 | $ couchbase-cli bucket-compact -c 192.168.1.5:8091 --username Administrator \ 53 | --password password --bucket travel-data 54 | 55 | If view index files only should be compacted for a specific bucket, and 56 | data files thereby skipped, run the following command. 57 | 58 | $ couchbase-cli bucket-compact -c 192.168.1.5:8091 --username Administrator \ 59 | --password password --bucket travel-data --view-only 60 | 61 | If data files only should be compacted for a specific bucket, and view 62 | index files thereby skipped, run the following command. 63 | 64 | $ couchbase-cli bucket-compact -c 192.168.1.5:8091 --username Administrator \ 65 | --password password --bucket travel-data --data-only 66 | 67 | == ENVIRONMENT AND CONFIGURATION VARIABLES 68 | 69 | include::{partialsdir}/cbcli/part-common-env.adoc[] 70 | 71 | == SEE ALSO 72 | 73 | man:couchbase-cli-bucket-compact[1], 74 | man:couchbase-cli-bucket-create[1], 75 | man:couchbase-cli-bucket-delete[1], 76 | man:couchbase-cli-bucket-edit[1], 77 | man:couchbase-cli-bucket-flush[1] 78 | 79 | include::{partialsdir}/cbcli/part-footer.adoc[] 80 | -------------------------------------------------------------------------------- /test/mock_binary_server.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import socketserver 3 | import threading 4 | 5 | 6 | class MockMemSession(socketserver.BaseRequestHandler): 7 | def handle(self): 8 | data = self.request.recv(1024) 9 | self.server.append(data) 10 | self.server.server.basic_handler(self.server.data, self.request) 11 | 12 | 13 | class MockMemcachedServerInternal(socketserver.ThreadingMixIn, socketserver.TCPServer): 14 | def __init__(self, address, port, request_class, server): 15 | super(MockMemcachedServerInternal, self).__init__(server_address=(address, port), 16 | RequestHandlerClass=request_class) 17 | self.data = [] 18 | self.server = server 19 | 20 | def append(self, data): 21 | self.data.append(data) 22 | 23 | def reset(self): 24 | self.data = [] 25 | 26 | def log(self, msg): 27 | self.server.log(msg) 28 | 29 | def pop(self, n): 30 | data = b'' 31 | if n >= len(self.data): 32 | data = self.data[:] 33 | self.data = [] 34 | else: 35 | data = self.data[:n] 36 | self.data = self.data[n:] 37 | return data 38 | 39 | 40 | class MockMemcachedServer: 41 | def __init__(self, address='127.0.0.1', port=52135, debug=False, handler=None): 42 | socketserver.TCPServer.allow_reuse_address = True 43 | self.debug = debug 44 | self.address = address 45 | self.port = port 46 | self.server = MockMemcachedServerInternal(address, port, MockMemSession, self) 47 | self.server_thread = threading.Thread(target=self.server.serve_forever) 48 | self.test_handler = handler 49 | self.running = False 50 | 51 | def set_debug(self, debug): 52 | self.debug = debug 53 | 54 | def set_handler(self, handler): 55 | self.test_handler = handler 56 | 57 | def start(self): 58 | self.running = True 59 | self.log('Starting server thread at {}:{}'.format(self.address, self.port)) 60 | self.server_thread.start() 61 | 62 | def basic_handler(self, data, req): 63 | self.log('Data: {}'.format(data)) 64 | if self.test_handler: 65 | self.test_handler(data, req, self.debug) 66 | 67 | def stop(self): 68 | self.log('Shut down server') 69 | if self.running: 70 | self.server.shutdown() 71 | self.log('Socket close') 72 | self.server.socket.close() 73 | self.log('Joining') 74 | if self.running: 75 | self.server_thread.join() 76 | 77 | self.running = False 78 | self.log('Thread finished') 79 | 80 | def reset(self): 81 | self.test_handler = None 82 | self.server.reset() 83 | 84 | def get_host_address(self): 85 | return self.address, self.port 86 | 87 | def log(self, msg): 88 | if self.debug: 89 | print(msg) 90 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-backup-service-nodes-threads-map.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-backup-service-nodes-threads-map(1) 2 | ifndef::doctype-manpage[:doctitle: backup-service-nodes-threads-map] 3 | 4 | ifdef::doctype-manpage[] 5 | == NAME 6 | 7 | couchbase-cli-backup-service-nodes-threads-map - 8 | endif::[] 9 | Manage the backup service nodes threads map. 10 | 11 | == SYNOPSIS 12 | 13 | [verse] 14 | _couchbase-cli backup-service_ [--cluster ] [--username ] 15 | [--password ] [--client-cert ] [--client-cert-password ] 16 | [--client-key ] [--client-key-password ] 17 | [--output] nodes-threads [--get] [--set] [--add] 18 | [--node ] [--threads ] 19 | 20 | == DESCRIPTION 21 | 22 | Manage backup service nodes threads map. 23 | 24 | == ACTION OPTIONS 25 | 26 | --get:: 27 | Get the backup service's nodes threads map. 28 | 29 | --set:: 30 | Set a new backup service's nodes threads map. 31 | 32 | --add:: 33 | Add a new entry in the backup service's nodes threads map. 34 | 35 | == OPTIONS 36 | 37 | --node:: 38 | node UUID. 39 | 40 | --threads:: 41 | Number of threads. 42 | 43 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 44 | 45 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 46 | 47 | == EXAMPLES 48 | 49 | To retrieve the backup service's nodes threads map: 50 | ---- 51 | $ couchbase-cli backup-service -c 127.0.0.1:8091 -u Administrator -p asdasd \ 52 | nodes-threads --get 53 | Node UUID | Threads 54 | ------------------------------------------------- 55 | 23ec390488495fec2074119a61d2eb91 | 3 56 | 76dc6557ed98ac7e78e70cf0d28921f3 | 4 57 | ---- 58 | 59 | This will show you each backup service node's UUID and the number of threads 60 | allocated to it. 61 | 62 | To set the backup service's nodes threads map: 63 | ---- 64 | $ couchbase-cli backup-service -c 127.0.0.0:8091 -u Administrator -p asdasd \ 65 | nodes-threads --set --node 23ec390488495fec2074119a61d2eb91 --threads 3 66 | SUCCESS: Set node threads map 67 | ---- 68 | 69 | This will overwrite the map in the backup service with the number of threads 70 | allocated to the backup service node with UUID 71 | `23ec390488495fec2074119a61d2eb91` to 3. 72 | 73 | To add a new entry to the backup service's nodes threads map: 74 | ---- 75 | $ couchbase-cli backup-service -c 127.0.0.1:8091 -u Administrator -p asdasd \ 76 | nodes-threads --add --node 76dc6557ed98ac7e78e70cf0d28921f3 --threads 4 77 | SUCCESS: Updated node threads map 78 | ---- 79 | 80 | This will add a new entry to the backup service's nodes threads map, allocating 81 | 4 threads to the backup service node with UUID 82 | `76dc6557ed98ac7e78e70cf0d28921f3`. 83 | 84 | == ENVIRONMENT AND CONFIGURATION VARIABLES 85 | 86 | include::{partialsdir}/cbcli/part-common-env.adoc[] 87 | 88 | == SEE ALSO 89 | 90 | man:couchbase-cli-backup-service[1] 91 | 92 | include::{partialsdir}/cbcli/part-footer.adoc[] 93 | -------------------------------------------------------------------------------- /test/test_topology_bar.py: -------------------------------------------------------------------------------- 1 | import unittest 2 | from typing import List 3 | 4 | from cluster_manager import ClusterManager 5 | from pbar import TopologyProgressBar 6 | 7 | 8 | class TaskGetter: 9 | def __init__(self, tasks: List[any]): 10 | self.calls = 0 11 | self.tasks = tasks 12 | 13 | def get_task(self): 14 | self.calls += 1 15 | if len(self.tasks) == 0: 16 | return [], None 17 | return [self.tasks.pop(0)], None 18 | 19 | 20 | class TopologyBarTest(unittest.TestCase): 21 | def test_topology_progress(self): 22 | client = ClusterManager('http://localhost:8091', 'u', 'p') 23 | tasks = TaskGetter([ 24 | {'type': 'rebalance', 'status': 'running', 'progress': 0.5, 'recommendedRefreshPeriod': 0.1, 25 | 'detailedProgress': {}}, 26 | {'type': 'rebalance', 'status': 'running', 'progress': 0.6, 'recommendedRefreshPeriod': 0.1, 27 | 'detailedProgress': {}}, 28 | {'type': 'rebalance', 'status': 'running', 'progress': 0.7, 'recommendedRefreshPeriod': 0.1, 29 | 'detailedProgress': {}}, 30 | {'type': 'rebalance', 'status': 'notRunning', 'statusIsStale': True}, 31 | {'type': 'rebalance', 'status': 'notRunning', 'masterRequestTimedOut': True}, 32 | {'type': 'rebalance', 'status': 'running', 'progress': 0.9, 'recommendedRefreshPeriod': 0.1, 33 | 'detailedProgress': {}}, 34 | {'type': 'rebalance', 'status': 'notRunning'}, 35 | ]) 36 | 37 | client.get_tasks = tasks.get_task 38 | 39 | bar = TopologyProgressBar(client, 'rebalance', True) 40 | err = bar.show() 41 | 42 | self.assertIsNone(err) 43 | self.assertEqual(tasks.calls, 7) 44 | 45 | def test_topology_progress_with_error(self): 46 | client = ClusterManager('http://localhost:8091', 'u', 'p') 47 | tasks = TaskGetter([ 48 | {'type': 'rebalance', 'status': 'running', 'progress': 0.5, 'recommendedRefreshPeriod': 0.1, 49 | 'detailedProgress': {}}, 50 | {'type': 'rebalance', 'status': 'running', 'progress': 0.6, 'recommendedRefreshPeriod': 0.1, 51 | 'detailedProgress': {}}, 52 | {'type': 'rebalance', 'status': 'running', 'progress': 0.7, 'recommendedRefreshPeriod': 0.1, 53 | 'detailedProgress': {}}, 54 | {'type': 'rebalance', 'status': 'notRunning', 'statusIsStale': True}, 55 | {'type': 'rebalance', 'status': 'notRunning', 'masterRequestTimedOut': True}, 56 | {'type': 'rebalance', 'status': 'notRunning', 'errorMessage': 'it broke'}, 57 | {'type': 'rebalance', 'status': 'notRunning', 'masterRequestTimedOut': True}, 58 | ]) 59 | 60 | client.get_tasks = tasks.get_task 61 | 62 | bar = TopologyProgressBar(client, 'rebalance', True) 63 | err = bar.show() 64 | 65 | self.assertEqual(['it broke'], err) 66 | self.assertEqual(tasks.calls, 6) 67 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-ip-family.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-ip-family(1) 2 | :description: Edits cluster IP family settings 3 | ifndef::doctype-manpage[:doctitle: ip-family] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-ip-family - 9 | endif::[] 10 | Edits cluster IP family settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli ip-family_ [--cluster ] [-username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--get] [--set] [--ipv4] [--ipv4only] [--ipv6] 18 | [--ipv6only] 19 | 20 | == DESCRIPTION 21 | 22 | This command changes the IP family used for inter-cluster communication. 23 | To do this it will execute a number of instructions in each node in the 24 | cluster. The clusters names must be FQDN and not IP addresses. It also 25 | provides an option to retrieve the current IP family being used. 26 | 27 | == OPTIONS 28 | 29 | include::{partialsdir}/cbcli/part-common-options.adoc[] 30 | 31 | --get:: 32 | Show current IP family. 33 | 34 | --set:: 35 | Change the cluster IP family, specify the IP family to be used using the 36 | --ipv4 or --ipv6 flags. 37 | 38 | --ipv4:: 39 | When specified together with --set it will change the cluster to use IPv4 for 40 | communication between the nodes. It will still be possible for traffic to go 41 | over IPv6 from clients. 42 | 43 | --ipv4only:: 44 | When specified together with --set it will change the cluster to only use IPv4. 45 | It will not blind to any IPv6 addresses, all traffic will be over IPv4 46 | 47 | --ipv6:: 48 | When specified together with --set it will change the cluster to use IPv6 for 49 | communication between the nodes. It will still be possible for traffic to go 50 | over IPv4 from clients. 51 | 52 | --ipv6only:: 53 | When specified together with --set it will change the cluster to only use IPv6. 54 | It will not blind to any IPv4 addresses, all traffic will be over IPv6. 55 | 56 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 57 | 58 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 59 | 60 | == EXAMPLES 61 | 62 | For a cluster with nodes [`cb1.com`, `cb2.com`, `cb3.com`] communicating via IPv4 we 63 | can change the IP family being used to IPv6 by using the following command. 64 | ---- 65 | $ couchbase-cli ip-family -c http://cb1.com:8091 -u Administrator \ 66 | -p password --set --ipv6 67 | ---- 68 | This command will configure each node in the cluster to use IPv6. To check what 69 | family is being used use the command below: 70 | ---- 71 | $ couchbase-cli ip-family -c http://cb1.com:8091 -u Administrator \ 72 | -p password --get 73 | ---- 74 | 75 | == ENVIRONMENT AND CONFIGURATION VARIABLES 76 | 77 | include::{partialsdir}/cbcli/part-common-env.adoc[] 78 | 79 | == SEE ALSO 80 | 81 | man:couchbase-cli-setting-security[1] 82 | man:couchbase-cli-ssl-manage[1] 83 | man:couchbase-cli-node-to-node-encryption[1] 84 | 85 | include::{partialsdir}/cbcli/part-footer.adoc[] 86 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-reset-admin-password.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-reset-admin-password(1) 2 | :description: Resets the Couchbase Server administrator password 3 | ifndef::doctype-manpage[:doctitle: reset-admin-password] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-reset-admin-password - 9 | endif::[] 10 | Resets the Couchbase Server administrator password 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli reset-admin-password_ [--regenerate] [--new-password ] 16 | [--port ] [--config-path ] 17 | 18 | == DESCRIPTION 19 | 20 | This command is used to reset the built-in Couchbase Server Administrator 21 | password. There is only one built-in Administrator account, which is managed 22 | separately from the internal and external Administrator users. External and 23 | internal Administrator accounts can be managed using the 24 | man:couchbase-cli-user-manage[1] command. 25 | 26 | The `reset-admin-password` command must be run locally on a node that is part 27 | of the cluster (i.e. must connect to the host the command is run on). This is 28 | required, as `reset-admin-password` relies on a local authentication token, 29 | which is used to authenticate with the server and change the password. As a 30 | result, the command does not require credentials to be passed. 31 | 32 | == OPTIONS 33 | 34 | --new-password :: 35 | Sets the password for the Couchbase Server administrator user to the value 36 | specified by the argument. If no password is specified, the command 37 | prompts the user for the new password through non-echoed stdin. 38 | 39 | --regenerate:: 40 | Sets the password for the Couchbase Server administrator user to a randomly 41 | generated value. The new password is printed to the command line after 42 | the password is changed. 43 | 44 | --port:: 45 | Specify the REST API port of the locally running Couchbase Server. If no 46 | port is specified the default port 8091 is used. 47 | 48 | --config-path:: 49 | Manually specify the path to the Couchbase Server configuration file. This 50 | is only needed if the configuration file is not in the default location, 51 | otherwise it can be found at `var/lib/couchbase` within the Couchbase 52 | Server installation directory. 53 | 54 | Note: on Mac, this path is instead located in the user's home directory, at 55 | `~/Library/Application Support/Couchbase/var/lib/couchbase`. 56 | 57 | == EXAMPLES 58 | 59 | To change the administrator password to `new_pwd`, run the following command: 60 | ---- 61 | $ couchbase-cli reset-admin-password --new-password new_pwd 62 | ---- 63 | 64 | To change the administrator password to a randomly generated value, run the 65 | following command. The new password will be printed to stdout if the 66 | password is successfully changed: 67 | ---- 68 | $ couchbase-cli reset-admin-password --regenerate jXjNW6LG 69 | ---- 70 | == SEE ALSO 71 | 72 | man:couchbase-cli-admin-manage[1], 73 | man:couchbase-cli-setting-ldap[1], 74 | man:couchbase-cli-user-manage[1] 75 | 76 | include::{partialsdir}/cbcli/part-footer.adoc[] 77 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-group-manage.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-group-manage(1) 2 | :description: Manage server groups 3 | ifndef::doctype-manpage[:doctitle: group-manage] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-group-manage - 9 | endif::[] 10 | Manage server groups 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli group-manage_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] [--client-key-password ] 17 | [--create] [--delete] [--list] [--rename ] [--move-servers] [--group-name ] [--from-group ] 18 | [--to-group ] 19 | 20 | == DESCRIPTION 21 | 22 | This command is used to manage server groups in a Couchbase cluster. When moving 23 | servers between groups it is possible that you may need to rebalance the cluster 24 | since the cluster topology may be changing. You should always run 25 | man:couchbase-cli-rebalance[1] after running this command. 26 | 27 | == OPTIONS 28 | 29 | include::{partialsdir}/cbcli/part-common-options.adoc[] 30 | 31 | --create:: 32 | Creates a new server group. 33 | 34 | --delete:: 35 | Deletes a server group. 36 | 37 | --list:: 38 | Lists all server groups. 39 | 40 | --rename :: 41 | Renames a server group. It takes the new name of the group as a parameter. 42 | 43 | --move-servers :: 44 | A list of servers to move between groups. 45 | 46 | --group-name :: 47 | The name of the server group. 48 | 49 | --from-group :: 50 | The group to move servers from. 51 | 52 | --to-group :: 53 | The group to move servers to. This group must already exists. 54 | 55 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 56 | 57 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 58 | 59 | == EXAMPLES 60 | 61 | To create a new server group called "rack1" run the following command. 62 | 63 | $ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \ 64 | -p password --create --group-name rack1 65 | 66 | To rename the server group "rack1" to "rack2" run the following command. 67 | 68 | $ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \ 69 | -p password --group-name rack1 --rename rack2 70 | 71 | To list all of the server groups in a cluster run the following command. 72 | 73 | $ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \ 74 | -p password --list 75 | 76 | To delete the server group "rack2" run the following command. 77 | 78 | $ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \ 79 | -p password --delete --group-name rack2 80 | 81 | To move the servers 192.168.1.5 and 192.168.1.6 from server group "rack3" to 82 | server group "rack4" run the following command. 83 | 84 | $ couchbase-cli group-manage -c 192.168.1.5 -u Administrator \ 85 | -p password --move-servers 192.168.1.5,192.168.1.6 --from-group rack3 \ 86 | --to-group rack4 87 | 88 | == ENVIRONMENT AND CONFIGURATION VARIABLES 89 | 90 | include::{partialsdir}/cbcli/part-common-env.adoc[] 91 | 92 | == SEE ALSO 93 | 94 | man:couchbase-cli-rebalance[1], 95 | man:couchbase-cli-server-add[1] 96 | 97 | include::{partialsdir}/cbcli/part-footer.adoc[] 98 | -------------------------------------------------------------------------------- /docs/design/cli-sherlock-func-spec.md: -------------------------------------------------------------------------------- 1 | 2 | Newly added options for existed commands 3 | ---------------------------------------- 4 | 5 | **- Add servers with data, index and query services** 6 | 7 | couchbase-cli server-add 8 | 9 | OPTIONS: 10 | 11 | --services=[data|index|query|moxi] services that run on the server 12 | 13 | Use cases: 14 | 15 | Add a new server with service data and query: 16 | 17 | couchbase-cli server-add -c 192.168.0.1:8091 \\ 18 | --server-add=10.11.12.13:8091 \\ 19 | --server-add-username=Admin1 \\ 20 | --server-add-password=password \\ 21 | --services=data;n1ql 22 | 23 | 24 | Add a new server with service index: 25 | 26 | couchbase-cli server-add -c 192.168.0.1:8091 \\ 27 | --server-add=10.11.12.13:8091 \\ 28 | --server-add-username=Admin1 \\ 29 | --server-add-password=password \\ 30 | --services=index 31 | 32 | **- Add servers with data, index and query services to a group** 33 | 34 | couchbase-cli group-manage 35 | 36 | OPTIONS: 37 | 38 | --services=[data|index|n1ql|moxi] services that run on the server 39 | 40 | Use cases: 41 | 42 | Add a new server with service data and query to a group: 43 | 44 | couchbase-cli group-manage -c 192.168.0.1:8091 \\ 45 | --group-name=group1 \\ 46 | --create \\ 47 | --add-servers=10.11.12.13:8091 \\ 48 | --services=data;query 49 | 50 | Add a new server with index service: 51 | 52 | couchbase-cli group-manage -c 192.168.0.1:8091 \\ 53 | --group-name=group2 \\ 54 | --create \\ 55 | --add-servers=10.11.12.13:8091;10.11.12.14 \\ 56 | --services=index 57 | 58 | **- Add filtering to xdcr replication** 59 | 60 | couchbase-cli bucket-create 61 | couchbase-cli bucket-edit 62 | 63 | Use cases: 64 | 65 | Modify existed bucket: 66 | 67 | couchbase-cli bucket-edit -c 192.168.0.1:8091 -u Administrator -p password 68 | 69 | 70 | Create a new bucket: 71 | 72 | couchbase-cli bucket-create -c 192.168.0.1:8091 \\ 73 | --bucket=test_bucket \\ 74 | --bucket-type=couchbase \\ 75 | --bucket-port=11222 \\ 76 | --bucket-ramsize=200 \\ 77 | --bucket-replica=1 \\ 78 | --bucket-priority=high \\ 79 | -u Administrator -p password 80 | 81 | Add a new server with index service: 82 | 83 | couchbase-cli group-manage -c 192.168.0.1:8091 \\ 84 | --group-name=group2 \\ 85 | --create \\ 86 | --add-servers=10.11.12.13:8091;10.11.12.14 \\ 87 | --services=index 88 | 89 | **- Add filter to xdcr replication** 90 | 91 | couchbase-cli xdcr-replicate 92 | 93 | OPTIONS: 94 | 95 | --regex=REGEX regular expression as filter 96 | 97 | Use cases: 98 | 99 | Create a xdcr replication: 100 | 101 | Start a replication stream in memcached protocol 102 | couchbase-cli xdcr-replicate -c 192.168.0.1:8091 \\ 103 | --create \\ 104 | --xdcr-cluster-name=test \\ 105 | --xdcr-from-bucket=default \\ 106 | --xdcr-to-bucket=default1 \\ 107 | --xdcr-replication-mode=xmem \\ 108 | --regex="192\.168\.1\.\d{1,3}" \\ 109 | -u Administrator -p password 110 | -------------------------------------------------------------------------------- /test/testdata/valid_rsa_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIJJwIBAAKCAgEA7Vl3orN5Uek33bSnI1wLnuYJI4xaUw64khoCZsWSYDSNy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gY5IXkmHg== 51 | -----END RSA PRIVATE KEY----- 52 | -------------------------------------------------------------------------------- /test/testdata/valid_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC5A0VfAcly+uAX 3 | OkTVZMQ63eEwsMRgdAMhdgFtwset0FbrIZ2RErE1LliZqdzDrvI4Wz/zJ9Mm/87G 4 | ad6TksLWvf9es28qxWa3pkyEYerrWi5/SPyGUSAhRTbv2ESi7HgjpGKMfhkLUfGz 5 | C0HRQO1dhQ5N+tpXo1EhKecoEkyFu7n0yr2lhi7YldWbDLOYlq+LevTe6G/uJDGq 6 | OueQ8zegs3VfmGfp/uw/e+y9tOrYz7zDMYudtqwUxBod/EvTQQEiIdCaj61A1k45 7 | NlFvCgXS3l3YNyhRGx0z7PJescM7AoOBNP7KMN0PwYLam7XGIWVzPhxpfo0F7Pfd 8 | GuOWm9SrLi7DRf8Cy2HH8RaYFMJSDN8LRnmgIQrjMwBrLLp2YrM7cfSuLtXV7gBF 9 | XzqBxtc83t/63t87BqBKaPGdiWgxJe5cwhex9TT9pt4DNixWylFUX5JA4N8CJCCY 10 | yog8UHpGfmLmD5K6sOCF7Fr+WJa7QUySsUmedvoQuOma6w4A+6CEodoIbVqOkhOx 11 | A6S2kkPYRbXMsY+FF9YO8wU47kD3V8jVChrsK83PzdtvW5daOUedyeK4Ujs7tj8S 12 | gzKL9PhmOlNJUrLaENOl95Qc3J/wNtpf0IPrN4MhK2WqgX6hFjEE3978/OiFQ6Rp 13 | u6DaZc5kD3wGVClaOX3LhAgIpvKoXQIDAQABAoICAQCizRsNGCBxOgtYxSBu+qWl 14 | +zq+Qr369fsPRazKLfzRmSPy8fiaAO3Ik0jJpuwpkVd5eepTCDdI+Q62D9EY4Krs 15 | lfISHijzZRMXBZINZ7B1ezyxKsNzWg3A2QwXj6IOD7FEA9HoOMnG6UubNourG8wD 16 | YCMPQW9CcObi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SfSY/N+HEVYX43ovZJXrXX1t 48 | VpztUFB1+tzpTnztBjuWdPUiWetXLfOnypc9A+XuFSdp+Ga6fWzMyaElaT6eHugV 49 | GUJkAQCQ7UjPj9v/WG0DVxfWSV8GyRQOuxQuIzK3xdzdxkhuTdWoFohHcXgSIioH 50 | YPQ1Ysn9nqU0NRAwSJYMwkkr7ZDsCMXlYaFt1F+rCt9HG0l+t4RBdZewjXVFvnxS 51 | AbWC3XXuBX+oTX/8CXDlKv9NkgzhglE= 52 | -----END PRIVATE KEY----- 53 | -------------------------------------------------------------------------------- /test/testdata/invalid_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQC5A0VfAcly+uAX 3 | OkTVZMQ63eEwsMRgdAMhdgFtwset0FbrIZ2RErE1LliZqdzDrvI4Wz/zJ9Mm/87G 4 | ad6TksLWvf9es28qxWa3pkyEYerrWi5/SPyGUSAhRTbv2ESi7HgjpGKMfhkLUfGz 5 | C0HRQO1dhQ5N+tpXo1EhKecoEkyFu7n0yr2lhi7YldWbDLOYlq+LevTe6G/uJDGq 6 | OueQ8zegs3VfmGfp/uw/e+y9tOrYz7zDMYudtqwUxBod/EvTQQEiIdCaj61A1k45 7 | NlFvCgXS3l3YNyhRGx0z7PJescM7AoOBNP7KMN0PwYLam7XGIWVzPhxpfo0F7Pfd 8 | GuOWm9SrLi7DRf8Cy2HH8RaYFMJSDN8LRnmgIQrjMwBrLLp2YrM7cfSuLtXV7gBF 9 | XzqBxtc83t/63t87BqBKaPGdiWgxJe5cwhex9TT9pt4DNixWylFUX5JA4N8CJCCY 10 | yog8UHpGfmLmD5K6sOCF7Fr+WJa7QUySsUmedvoQuOma6w4A+6CEodoIbVqOkhOx 11 | A6S2kkPYRbXMsY+FF9YO8wU47kD3V8jVChrsK83PzdtvW5daOUedyeK4Ujs7tj8S 12 | gzKL9PhmOlNJUrLaENOl95Qc3J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ot2YNYqlVy+K 44 | Msnl6I9C9FWUfo+fswTmkhVMYWpEgL/i/sNh01ItG5SgeoeOf1IR30F5hvCwLuhm 45 | 8BLcb2ntyMfthYV4I1qybF96SsQphzYXeqbv4bR9cWSg8UfLZYEiiHZBKfrCJr3G 46 | zDUCggEBAN6EnwlBFi84+rfaAataTPMvPnqMNvECm4t6a/USH9a22LxNHckt/7Ie 47 | BMKtyA/Cq5Fm46Je4NAqI/SyA+8xj4a9vYg7fodMSfSY/N+HEVYX43ovZJXrXX1t 48 | VpztUFB1+tzpTnztBjuWdPUiWetXLfOnypc9A+XuFSdp+Ga6fWzMyaElaT6eHugV 49 | GUJkAQCQ7UjPj9v/WG0DVxfWSV8GyRQOuxQuIzK3xdzdxkhuTdWoFohHcXgSIioH 50 | YPQ1Ysn9nqU0NRAwSJYMwkkr7ZDsCMXlYaFt1F+rCt9HG0l+t4RBdZewjXVFvnxS 51 | AbWC3XXuBX+oTX/8CXDlKv9NkgzhglE= 52 | -----END PRIVATE KEY----- 53 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-saslauthd.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-saslauthd(1) 2 | :description: Modifies saslauthd settings 3 | ifndef::doctype-manpage[:doctitle: setting-saslauthd] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-saslauthd - 9 | endif::[] 10 | Modifies saslauthd settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-saslauthd_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--admins ] 18 | [--roadmins ] [--default ] 19 | [--enabled <1|0>] 20 | 21 | == DESCRIPTION 22 | 23 | This command is only available for clusters running Enterprise Edition on 24 | GNU/Linux. 25 | 26 | This command allows users to enable SASL on their cluster as well as add 27 | administrator and read-only administrator SASL users to their cluster. 28 | 29 | == OPTIONS 30 | 31 | include::{partialsdir}/cbcli/part-common-options.adoc[] 32 | 33 | --admins :: 34 | A list of SASL users who should have administrator privileges on this 35 | cluster. This list should be comma separated if multiple users are being 36 | added. 37 | 38 | --roadmins :: 39 | A list of SASL users who should have read-only administrator privileges on 40 | this cluster. This list should be comma separated if multiple users are 41 | being added. 42 | 43 | --enabled <1|0>:: 44 | Enables or disables SASL on this cluster. To enable SASL set this option to 45 | "1". To disable SASL set this parameter to "0". 46 | 47 | --default :: 48 | Specifies the default role for SASL users who have not been explicitly been 49 | added to the cluster. This option may be set to "admins", "ro_admins", or 50 | "none". If this option is set to "admins" then all SASL users not explicitly 51 | add to this cluster have administrator privileges. If this option is set to 52 | "roadmins" then all SASL users not explicitly add to this cluster have 53 | read-only administrator privileges. If this option is set to "none" then all 54 | SASL users not explicitly add to this cluster will have no access. This 55 | option default to "none". 56 | 57 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 58 | 59 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 60 | 61 | == EXAMPLES 62 | 63 | To enable SASL on a cluster run the following command. 64 | ---- 65 | $ couchbase-cli setting-saslauthd -c 192.168.1.5 --username Administrator \ 66 | --password password --enabled 1 67 | ---- 68 | To add users `alice` and `barry` as Administrators and users `clair` and `daniel` as 69 | Read-Only Administrators run the following command. 70 | ---- 71 | $ couchbase-cli setting-saslauthd -c 192.168.1.5 --username Administrator \ 72 | --password password --enabled 1 --admins alice,barry \ 73 | --roadmins clair,daniel 74 | ---- 75 | To enable SASL and allow all SASL users to have Administrator access run the 76 | following command. 77 | ---- 78 | $ couchbase-cli setting-saslauthd -c 192.168.1.5 --username Administrator \ 79 | --password password --enabled 1 --default admins 80 | ---- 81 | == ENVIRONMENT AND CONFIGURATION VARIABLES 82 | 83 | include::{partialsdir}/cbcli/part-common-env.adoc[] 84 | 85 | == SEE ALSO 86 | 87 | man:couchbase-cli-admin-role-manage[1], 88 | man:couchbase-cli-user-manage[1] 89 | 90 | include::{partialsdir}/cbcli/part-footer.adoc[] 91 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-master-password.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-master-password(1) 2 | :description: Sends the Couchbase master password 3 | ifndef::doctype-manpage[:doctitle: master-password] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-master-password - 9 | endif::[] 10 | Sends the Couchbase master password 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli master-password_ [--send-password ] 16 | [--config-path ] 17 | 18 | == DESCRIPTION 19 | 20 | Couchbase Server Enterprise Edition has a "Secret Management" feature, which 21 | allows users to securely encrypt passwords and other sensitive configuration 22 | information that is stored on disk. These secrets must be stored in a secure 23 | way, and access must be controlled to reduce the risk of accidental exposure. 24 | By using Secret Management in Couchbase Server, secrets are written to disk 25 | in encrypted format. To decrypt these secrets, Couchbase requires the 26 | entering of a "master password", which is supplied by the user during server 27 | startup. This master password can be passed to the server using this command. 28 | 29 | By default the Secret Management feature is disabled. To enable the feature, 30 | you must first set the master password. Once a master password is set, the 31 | user is required to enter it when the server starts up. This can be done by 32 | setting the environment variable CB_MASTER_PASSWORD= during server 33 | startup. Alternatively, you can enter the master password using the 34 | couchbase-cli `master-password` command. This command must be run locally on 35 | the node that needs to be unlocked and the user running the command must be 36 | a member of the `couchbase` group (or be root.) 37 | 38 | == OPTIONS 39 | 40 | --send-password:: 41 | Sends the master password to the server that is waiting to start up. 42 | 43 | --config-path:: 44 | Manually specify the path to the Couchbase Server configuration file. This 45 | is only needed if the configuration file is not in the default location, 46 | otherwise it can be found at `var/lib/couchbase` within the Couchbase 47 | Server installation directory. 48 | 49 | Note: on Mac, this path is instead located in the user's home directory, at 50 | `~/Library/Application Support/Couchbase/var/lib/couchbase`. 51 | 52 | == EXAMPLES 53 | 54 | To use the Secret Management feature, the first thing you need to do is set a 55 | password on each node of the cluster. To do this, install, start and initialize 56 | Couchbase. Once Couchbase has started, run the following command to set the master 57 | password for your server. 58 | 59 | $ couchbase-cli setting-master-password -c 127.0.0.1 -u Administrator \ 60 | -p password --new-password password 61 | 62 | Once the master password is configured restart the server. Upon restarting the 63 | cluster you will notice that the server doesn't fully start. This is because it 64 | is waiting for you to enter the master password. You can do this by running the 65 | command below. The master-password subcommand has to be run locally on the node 66 | that is waiting for the master password and as the user must have be able to 67 | read files in the `couchbase` group. 68 | 69 | $ couchbase-cli master-password --send-password password 70 | 71 | == ENVIRONMENT AND CONFIGURATION VARIABLES 72 | 73 | include::{partialsdir}/cbcli/part-common-env.adoc[] 74 | 75 | == SEE ALSO 76 | 77 | man:couchbase-cli-setting-master-password[1], 78 | man:couchbase-cli-cluster-init[1], 79 | man:couchbase-cli-server-add[1] 80 | 81 | include::{partialsdir}/cbcli/part-footer.adoc[] 82 | -------------------------------------------------------------------------------- /test/testdata/valid_key_p8.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN ENCRYPTED PRIVATE KEY----- 2 | MIIJrTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIbJCg/rXIm4QCAggA 3 | MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBCTb0skWzmYXPQ7NAe9SSD0BIIJ 4 | UBO6oped2Se2Q8i8rWmjcL36wC+n6ZKklzC4qcMmfCPyeQcYZV341UyyJC23pU3W 5 | kCV+9a5gRirBEU16zZ5Lz91ICGrfTIzGTplmaywQrDGFgfZhc1brDcY1i/2CGe0W 6 | OT36tChxlrOrGLIDNyIbA42Oh7LL0URwnqZyIRE1yCOlDy69bxaYB+B9+1RqJ3J8 7 | Ja2PCIEEu6DDzcl2Jv2LnbcR42ZTpmiy+dMYaaRwuYqPX4+b/bEB2knh1+rHSQ3S 8 | hKgSpGT0f84J8o1meFfF1hCxlLKmYU/KZHrUvP9H/3/C7Z0ijH9qCLefauf4F/fo 9 | 2Q8xfGjSlb9HXBBPIjlYS1nPLVpCDV2QqVutmERnG8I/Uo3DVuUvrOnVHYHzkrNP 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2Wp5FF3dnR4EpSVQDuzsFW3 42 | nEmsq+n5PO72sWfGkLYNghS3oifxd/kFfkK/fCyZlJ3jj+uRKFSa2eAqo+Ijh2u6 43 | 93Oi1BK5pag+jxb9UoB17WKAtfwRxr05Uzj4ZLaQx0uYsFQk8b/fcV9BcvknwOGe 44 | zPxwXu6UVLT/zTrNg1H2MiCBo+ykOnoeu9uUOL9F1nCdi93//OaaFbL/OsUAesUP 45 | VRAlY/bW9tgVcgB+IRS8SO5+26RK7/FEAIN33CosHlSm5y1qNVKwuG8PhuXKc26i 46 | Mmb88/VEPrF7H6xgchUQPXS9QKC4+TQ2Ev5505Kf4RXJcbFmrO+9/ta24lfbumJg 47 | 9Vieq90DS+gIRutmcg4FDml1+5L95Zvp4RX5NuEuHGbqCI1+s4AqM5jSF9UXUFCe 48 | qU4cF07hGI4JkVJeordg5nfZtR5Ijp/YtBjs6SdWbA2tFe2EMIrLP0LiVB7egn3x 49 | gD0UaooIWWI4pguTKt7bgjNakbzb9KG6IEwpSYyPIutyRmAkC2v3xc4YcXWxOf+/ 50 | tJtFIbU6MrXO2byYM0HxSh4enllurzArYQYseTQJWFMgwK4CMIf9SxvkG4bsLvUQ 51 | IUk2BYCqLNX6BAk5/RtaQYKP8jlVV2cDMmigMUE4Qju0qow1nmwllToe2PthnH50 52 | AdMAg00V83Jp7vdw8vVj4mcUexJPkas+aWdFQ3GA41Vovevq3YUuzB2DGJuquEkB 53 | Cn5qpPemWUm/L+APa6S0w7Gxf6wo2FsdItE6gm1brupV 54 | -----END ENCRYPTED PRIVATE KEY----- 55 | -------------------------------------------------------------------------------- /test/testdata/invalid_key_p8.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN ENCRYPTED PRIVATE KEY----- 2 | MIIJrTBXBgkqhkiG9w0BBQ0wSjApBgkqhkiG9w0BBQwwHAQIbJCg/rXIm4QCAggA 3 | MAwGCCqGSIb3DQIJBQAwHQYJYIZIAWUDBAEqBBCTb0skWzmYXPQ7NAe9SSD0BI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LNX6BAk5/RtaQYKP8jlVV2cDMmigMUE4Qju0qow1nmwllToe2PthnH50 52 | AdMAg00V83Jp7vdw8vVj4mcUexJPkas+aWdFQ3GA41Vovevq3YUuzB2DGJuquEkB 53 | Cn5qpPemWUm/L+APa6S0w7Gxf6wo2FsdItE6gm1brupV 54 | -----END ENCRYPTED PRIVATE KEY----- 55 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-failover.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-failover(1) 2 | :description: Failover a node in the cluster 3 | ifndef::doctype-manpage[:doctitle: failover] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-failover - 9 | endif::[] 10 | Failover a node in the cluster 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli failover_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--server-failover ] [--hard] 18 | [--force] [--no-progress-bar] [--no-wait] 19 | 20 | == DESCRIPTION 21 | 22 | This command fails over one or more nodes. Nodes can be either hard failed 23 | over or gracefully failed over. A hard failover means that the failover happens 24 | immediately but risks potential data loss. Graceful failover ensures that 25 | replication is up to date before the node is failed over so that there is no 26 | data loss, but the failover is not immediate. Note that if a node is already down, 27 | you must perform a hard failover. 28 | 29 | == OPTIONS 30 | 31 | include::{partialsdir}/cbcli/part-common-options.adoc[] 32 | 33 | --server-failover :: 34 | A comma-separated list of nodes to failover. 35 | 36 | --hard:: 37 | Specifying this flag signifies that the nodes to be failed over should be 38 | hard failed over. A hard failover means that the failover is immediate, but 39 | you risk potential data loss. If this flag is not specified, then a graceful 40 | failover will occur which ensures that the replication is up to date. This 41 | means there will be no data loss, but the failover is not immediate. Note 42 | that if a server is already down, you must hard fail it over. 43 | 44 | --force:: 45 | Specifying this flag forces a hard failover. 46 | This option should only be used when needed. 47 | In order to perform a failover, the cluster needs a quorum 48 | of nodes. 49 | There are cases where the majority of nodes are unavailable, and it 50 | will be impossible to get a quorum. 51 | In those cases, this flag can be used to 52 | force a hard failover. 53 | This flag has to be used with '--hard' flag. 54 | 55 | --no-progress-bar:: 56 | Disables showing the progress bar which tracks the progress of the 57 | rebalance. 58 | Note that a rebalance only occurs for graceful failovers (e.g., non-forced failovers). 59 | The failover command will still wait for rebalance 60 | completion even if this flag is specified, but the progress bar will not 61 | be shown. 62 | 63 | --no-wait:: 64 | Specifies that this command should not wait for the completion of rebalance 65 | before exiting. Note that a rebalance only occurs for graceful failovers 66 | (e.g., non-forced failovers). 67 | 68 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 69 | 70 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 71 | 72 | == EXAMPLES 73 | 74 | To hard fail over two nodes, run the following command: 75 | 76 | $ couchbase-cli failover -c 192.168.1.5:8091 --username Administrator \ 77 | --password password \ 78 | --server-failover 192.168.1.6:8091,192.168.1.7:8091 --hard 79 | 80 | To gracefully failover a node, run the following command: 81 | 82 | $ couchbase-cli failover -c 192.168.1.5:8091 --username Administrator \ 83 | --password password --server-failover 192.168.1.6:8091 84 | 85 | == ENVIRONMENT AND CONFIGURATION VARIABLES 86 | 87 | include::{partialsdir}/cbcli/part-common-env.adoc[] 88 | 89 | == SEE ALSO 90 | 91 | man:couchbase-cli-rebalance[1], 92 | man:couchbase-cli-recovery[1], 93 | man:couchbase-cli-server-add[1], 94 | man:couchbase-cli-setting-autofailover[1] 95 | 96 | include::{partialsdir}/cbcli/part-footer.adoc[] 97 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-recovery.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-recovery(1) 2 | :description: Recovers a previously failed over node 3 | ifndef::doctype-manpage[:doctitle: recovery] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-recovery - 9 | endif::[] 10 | Recovers a previously failed over node 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli recovery_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--server-recovery ] [--recovery-type ] 18 | 19 | == DESCRIPTION 20 | 21 | When a server is failed over and removed from the cluster it may only be able to 22 | be added back to the cluster. And example of this is when a server loses power. 23 | This server might get failed over and removed from the cluster, but once power 24 | is restored to the server you may want to add it back to the cluster. 25 | 26 | Another use case is taking a server out of the cluster for maintenance. This 27 | is done by gracefully failing over a server to ensure there is no data loss. 28 | The administrator can then perform maintenance on the removed server and add it 29 | back with the recovery command. 30 | 31 | The recovery command also allows a server to have it's data removed before being 32 | added back to the cluster (full recovery) or having the server resume from where 33 | it last left off (delta recovery). Delta recovery will always take the least 34 | amount of time and is the recommended recovery mode. 35 | 36 | Note that after the recovery subcommand is run you must rebalance the 37 | cluster. See the man:couchbase-cli-rebalance[1] command for more information 38 | on rebalancing a cluster. 39 | 40 | == OPTIONS 41 | 42 | include::{partialsdir}/cbcli/part-common-options.adoc[] 43 | 44 | --server-recovery :: 45 | A comma separated list of servers to recover. The each server should 46 | correspond to the hostname or IP address of a server to be added back to the 47 | cluster. 48 | 49 | --recovery-type :: 50 | Specifies whether or not we should do full or delta recovery of data on the 51 | servers being added back. Full recover means that all data on the servers 52 | being recovered will be removed and we will recover all data. Specifying 53 | delta recover means we will keep the data that is on each server and only 54 | recover the data that each server doesn't have. To specify full recovery set 55 | this option to "full". For delta recovery set this option to "delta". The 56 | default value for this option is "full". 57 | 58 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 59 | 60 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 61 | 62 | == EXAMPLES 63 | 64 | If we have a server at 192.168.1.6:8091 that we want to recover and we want to 65 | recover data using delta recovery then we can run the following command. 66 | 67 | $ couchbase-cli recovery -c 192.168.1.5:8091 --username Administrator \ 68 | --password password --server-recovery 192.168.1.6:8091 \ 69 | --recovery-type delta 70 | 71 | If we need to recover multiple servers then we would run the following command. 72 | 73 | $ couchbase-cli recovery -c 192.168.1.5:8091 --username Administrator \ 74 | --password password --server-recovery 192.168.1.6:8091,192.168.1.7:8091 \ 75 | --recovery-type delta 76 | 77 | If we wanted the servers being recovered to use full recovery then we would run 78 | the following command. 79 | 80 | $ couchbase-cli recovery -c 192.168.1.5:8091 --username Administrator \ 81 | --password password --server-recovery 192.168.1.6:8091 \ 82 | --recovery-type full 83 | 84 | == ENVIRONMENT AND CONFIGURATION VARIABLES 85 | 86 | include::{partialsdir}/cbcli/part-common-env.adoc[] 87 | 88 | == SEE ALSO 89 | 90 | man:couchbase-cli-rebalance[1], 91 | man:couchbase-cli-server-add[1] 92 | 93 | include::{partialsdir}/cbcli/part-footer.adoc[] 94 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-index.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-index(1) 2 | :description: Modifies index settings 3 | ifndef::doctype-manpage[:doctitle: setting-index] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-index - 9 | endif::[] 10 | Modifies index settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-index_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--index-max-rollback-points ] 18 | [--index-stable-snapshot-interval ] 19 | [--index-memory-snapshot-interval ] 20 | [--index-storage-setting ] [--index-threads ] 21 | [--index-log-level ] [--replicas ] 22 | [--optimize-placement <1|0>] 23 | 24 | == DESCRIPTION 25 | 26 | This command sets various advanced settings for the index service. 27 | 28 | == OPTIONS 29 | 30 | include::{partialsdir}/cbcli/part-common-options.adoc[] 31 | 32 | --index-max-rollback-points :: 33 | The maximum number of rollback points. The value of this option must be 34 | greater than or equal to 1. If this option is not specified it defaults 35 | to 2. 36 | 37 | --index-stable-snapshot-interval :: 38 | Specifies the frequency of persisted snapshots for recovery in seconds. This 39 | means that in the event of a failover this is the farthest back we may have 40 | to rebuild the index from. This value of this parameter must be greater than 1. 41 | If this option is not specified it defaults to 5000 seconds. 42 | 43 | --index-memory-snapshot-interval :: 44 | Specifies the frequency of in-memory snapshots in milliseconds. This 45 | determines the earliest possibility of a scan seeing a given KV mutation. 46 | This value of this parameter must be greater than 1. This parameter defaults 47 | to 200 if it is not specified. 48 | 49 | --index-storage-setting :: 50 | Sets the index storage mode for all indexes in this cluster. This parameter 51 | may only be changed if there are no nodes running the index service. To 52 | specify the disk based forestdb index backend set this parameter to 53 | "default". To set the storage mode to use memory optimized indexes set this 54 | parameter to `memopt`. This option does not have a default value if not set. 55 | 56 | --index-threads :: 57 | Sets the number of CPUs that can be used by the indexer. The value of this 58 | option must be between 0 and 1024. If this option is not set then it 59 | default to 0. 60 | 61 | --index-log-level :: 62 | Sets the log level for the index service. Valid log levels include "debug", 63 | "silent", "fatal", "error", "warn", "info", "verbose", "timing", and 64 | "trace". If this option is not specified it defaults to "info". 65 | 66 | --replicas :: 67 | Number of index replicas. 68 | 69 | --optimize-placement <1|0>:: 70 | When enabled (1) it will move the indexes to the new node during a rebalance 71 | to eliminate the need of doing a 'swap rebalance'. 72 | 73 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 74 | 75 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 76 | 77 | == EXAMPLES 78 | 79 | To set the max index rollback points to 8, the index stable snapshot interval to 80 | 40000 seconds, the index memory snapshot interval to 150 milliseconds, the index 81 | thread count to 8 and in the index log level to info run the following command. 82 | 83 | $ couchbase-cli setting-index -c 127.0.0.1:8091 -u Administrator \ 84 | -p password --index-max-rollback-points 8 --index-threads 8 \ 85 | --index-log-level info --index-stable-snapshot-interval 40000 \ 86 | --index-memory-snapshot-interval 150 \ 87 | 88 | == ENVIRONMENT AND CONFIGURATION VARIABLES 89 | 90 | include::{partialsdir}/cbcli/part-common-env.adoc[] 91 | 92 | == SEE ALSO 93 | 94 | man:couchbase-cli-setting-cluster[1] 95 | 96 | include::{partialsdir}/cbcli/part-footer.adoc[] 97 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-master-password.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-master-password(1) 2 | :description: Manages the Couchbase master password 3 | ifndef::doctype-manpage[:doctitle: setting-master-password] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-master-password - 9 | endif::[] 10 | Manages the Couchbase master password 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-master-password_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--new-password ] [--rotate-password] 18 | 19 | == DESCRIPTION 20 | 21 | Couchbase Server Enterprise Edition has a "Secret Management" feature, which 22 | allows users to securely encrypt passwords and other sensitive configuration 23 | information that is stored on disk. These secrets must be stored in a secure 24 | way; and access must be controlled, to reduce the risk of accidental exposure. 25 | By using Secret Management in Couchbase Server, secrets are written to disk 26 | in encrypted format. To decrypt these secrets, Couchbase requires entry of a 27 | "master password", which is supplied by the user during server startup. This 28 | master password can be passed to the server using the couchbase-cli 29 | master-password command. 30 | 31 | By default, the Secret Management feature is disabled. To enable the feature, 32 | you must first set the master password. Once a master password is set, the 33 | user is required to enter it when the server starts up. This can be done by 34 | setting the environment variable CB_MASTER_PASSWORD= during server 35 | startup. 36 | 37 | == OPTIONS 38 | 39 | include::{partialsdir}/cbcli/part-common-options.adoc[] 40 | 41 | --rotate-data-key:: 42 | Secrets are encrypted using a data key file, which is a unique key that is 43 | stored on disk for each server. To open this file, the master password is 44 | used to generate a key which decrypts the contents of the data key file. 45 | The contents of the decrypted data key file can then be used to decrypt 46 | secrets. Some users may want to generate a new data key file periodically, 47 | to increase security. This option is used to generate a new data key file. 48 | 49 | --new-password:: 50 | Sets a new master password for the server specified. The user may specify 51 | this password on the command line, or through non-echoed stdin. To specify 52 | the password through non-echoed stdin, do not provide a value for this 53 | option. The user will then be prompted to enter the password. 54 | 55 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 56 | 57 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 58 | 59 | == EXAMPLES 60 | 61 | To use the Secret Management feature, the first thing you need to do is set a 62 | password on each node of the cluster. To do this, install and start Couchbase, 63 | but don't go through the setup process or initialize the cluster. Once 64 | Couchbase has started, run the following command to set the master password 65 | for your server. 66 | 67 | $ couchbase-cli setting-master-password -c 127.0.0.1 -u Administrator \ 68 | -p password --new-password password 69 | 70 | Once the master password is configured restart the server. Upon restarting the 71 | cluster you will notice that the server doesn't fully start. This is because it 72 | is waiting for you to enter the master password. You can do this by running the 73 | command below. The master-password subcommand has to be run locally on the node 74 | that is waiting for the master password. 75 | 76 | $ couchbase-cli master-password --send-password password 77 | 78 | Note you can also use the CB_MASTER_PASSWORD= environmental variable 79 | to pass the password to the node during startup. 80 | 81 | == ENVIRONMENT AND CONFIGURATION VARIABLES 82 | 83 | include::{partialsdir}/cbcli/part-common-env.adoc[] 84 | 85 | == SEE ALSO 86 | 87 | man:couchbase-cli-master-password[1], 88 | man:couchbase-cli-cluster-init[1], 89 | man:couchbase-cli-server-add[1] 90 | 91 | include::{partialsdir}/cbcli/part-footer.adoc[] 92 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-alternate-address.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-alternate-address(1) 2 | :description: Modify alternate addresses 3 | ifndef::doctype-manpage[:doctitle: setting-alternate-address] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-alternate-address - 9 | endif::[] 10 | Modify alternate addresses 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-alternate-address_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--list] [--set] [--remove] [--hostname ] 18 | [--ports ] 19 | 20 | == DESCRIPTION 21 | 22 | This command is used to set the alternate address for a node. This alternate address 23 | allows the node to be connected by a different address, this is useful when an external 24 | agent tries to connect via a NAT'd environment such as the cloud or kubernetes. 25 | 26 | == OPTIONS 27 | 28 | include::{partialsdir}/cbcli/part-common-options.adoc[] 29 | 30 | --list:: 31 | Show current alternate addresses. Please note only the first 43 characters hostname and 32 | alternate address are displayed. The full hostnames are shown in the json output 33 | (-o json). 34 | 35 | --set:: 36 | Set alternate address for the node specified in the -c/--cluster option. 37 | 38 | --remove:: 39 | Remove alternate address for the node specified in the -c/--cluster option. 40 | 41 | --node :: 42 | The node in the cluster to take action on. This is required when using 43 | --set or --remove flags. 44 | 45 | --hostname :: 46 | Alternate host address 47 | 48 | --ports :: 49 | Alternate port mappings. Specified as a comma separated list: 50 | e.g. `--ports kv=9000,kvSSL=9999.` 51 | 52 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 53 | 54 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 55 | 56 | == EXAMPLES 57 | 58 | To set the alternate address and custom ports for node 192.168.1.5 we would use the 59 | following command: 60 | ---- 61 | $ couchbase-cli setting-alternate-address -c 192.168.1.5:8091 --username Administrator \ 62 | --password password --set --node 192.168.1.5 --hostname 10.10.10.10 \ 63 | --ports mgmt=1100,capi=2000,capiSSL=3000 64 | ---- 65 | To see the current alternate address configuration we would use the --list flag as 66 | follows: 67 | ---- 68 | $ couchbase-cli setting-alternate-address -c 192.168.1.5:8091 --username Administrator \ 69 | --password password --list 70 | ---- 71 | == DISCUSSION 72 | 73 | All of the ports that can be configured: 74 | 75 | .Alternate Ports 76 | |=== 77 | |Port Name | Encrypted Port Name | Service | Description 78 | 79 | |`mgmt` 80 | |`mgmtSSL` 81 | |Cluster Manager 82 | |The UI and REST API for managing the Cluster 83 | 84 | |`kv` 85 | |`kvSSL` 86 | |Data 87 | |Used by the SDKs and XDCR to transfer data to and from the Data Service 88 | 89 | |`capi` 90 | |`capiSSL` 91 | |View Engine 92 | |Used by the SDKs and XDCR 93 | 94 | |`n1ql` 95 | |`n1qlSSL` 96 | |Query 97 | |Used by the SDKs to query data 98 | 99 | |`fts` 100 | |`ftsSSL` 101 | |Search 102 | |Used by the SDKs to do full text searches 103 | 104 | |`cbas` 105 | |`cbasSSL` 106 | |Analytics 107 | |Used by the SDKs to query data managed by the Analytic service 108 | 109 | |`eventingAdminPort` 110 | |`eventingSSL` 111 | |Eventing 112 | |Used by the SDK to transfer data to and from the Eventing Service 113 | 114 | |`eventingDebug` 115 | |N/A 116 | |Eventing 117 | |The Eventing debugger port, this should only be set in development environments. 118 | 119 | |`backupAPI` 120 | |`backupAPIHTTPS` 121 | |Backup 122 | |The backup service REST API. 123 | 124 | | N/A 125 | |`backupGRPC` 126 | |Backup 127 | |Used by backup nodes to communicate with each other. 128 | 129 | |=== 130 | 131 | 132 | == ENVIRONMENT AND CONFIGURATION VARIABLES 133 | 134 | include::{partialsdir}/cbcli/part-common-env.adoc[] 135 | 136 | == SEE ALSO 137 | 138 | man:couchbase-cli-cluster-init[1] 139 | 140 | include::{partialsdir}/cbcli/part-footer.adoc[] 141 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-autoreprovision.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-autoreprovision(1) 2 | :description: Modifies auto-reprovision settings 3 | ifndef::doctype-manpage[:doctitle: setting-autoreprovision] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-autoreprovision - 9 | endif::[] 10 | Modifies auto-reprovision settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-autoreprovision_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--enabled <1|0>] [--max-nodes ] 18 | 19 | == DESCRIPTION 20 | 21 | Auto-reprovisioning is used in order to prevent data loss in ephemeral buckets 22 | during failure scenarios when a node crashes and restarts quickly. Under this 23 | scenario auto-reprovisioning ensures that an ephemeral bucket's replica vBuckets 24 | are promoted to active state. This mechanism is not needed for Couchbase buckets 25 | because a Couchbase buckets data is persisted to disk and can be loaded back 26 | into memory after a node restarts. Ephemeral buckets on the other hand 27 | completely lose their data when a node crashes and replicas must be relied upon 28 | in order to prevent data loss. If ephemeral buckets are not in use this setting 29 | has no effect on the cluster. 30 | 31 | Auto-reprovisioning can either be enabled or disabled. If you have ephemeral 32 | buckets it is always recommended that auto-reprovisioning is enabled otherwise 33 | the cluster will experience data loss if a node crashes or is restarted. Users 34 | can also specify the number of nodes that can be auto-reprovisioned before the 35 | cluster is rebalanced. An auto-reprovision event occurs if a cluster has at 36 | least one ephemeral bucket and a node crashes and restarts. If the number of 37 | crashes and restarts exceed the maximum number of nodes that can be 38 | auto-reprovisioned then the next crash and restart will result in data loss for 39 | all ephemeral buckets in the cluster. 40 | 41 | When setting the max nodes parameter, note that specifying the max nodes to be 42 | too high could result in cascading node failures. This can happen because when a 43 | node fails and restarts the server load for the crashed node is distributed to 44 | the rest of the servers in the cluster. This extra load could cause the one or 45 | more of the remaining servers in the cluster to become overloaded and 46 | unresponsive leading to more failures. On the other hand specifying max nodes to 47 | be too small could lead to data loss if there are many failures in the cluster at 48 | the same time. How this variable is set depends on the cluster size, workload, 49 | and configuration. However, it is always recommended that auto-reprovisioning is 50 | at least enabled and that max nodes is set to at least 1. 51 | 52 | == OPTIONS 53 | 54 | include::{partialsdir}/cbcli/part-common-options.adoc[] 55 | 56 | --enabled :: 57 | Specifies whether or not auto-reprovisioning is enabled. Set this option to 58 | "1" to enable autofailover or "0" to disable autofailover. 59 | 60 | --max-nodes :: 61 | Specifies the maximum number of servers that can be auto-reprovisioned 62 | before a rebalance must take place (which resets the count). This parameter 63 | must always be set to a number greater than or equal to 1. 64 | 65 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 66 | 67 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 68 | 69 | == EXAMPLES 70 | 71 | To enable auto-reprovisioning and allow up to three nodes be auto-reprovisioned 72 | before a rebalance takes place run the following command. 73 | 74 | $ couchbase-cli setting-autoreprovision -c 192.168.1.5 -u Administrator \ 75 | -p password --enabled 1 --max-nodes 3 76 | 77 | To disable auto-reprovisioning run the following command. 78 | 79 | $ couchbase-cli setting-autoreprovision -c 192.168.1.5 -u Administrator \ 80 | -p password --enabled 0 81 | 82 | == ENVIRONMENT AND CONFIGURATION VARIABLES 83 | 84 | include::{partialsdir}/cbcli/part-common-env.adoc[] 85 | 86 | == SEE ALSO 87 | 88 | man:couchbase-cli-setting-autofailover[1] 89 | 90 | include::{partialsdir}/cbcli/part-footer.adoc[] 91 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-xdcr.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-xdcr(1) 2 | :description: Modifies cross data center replication (XDCR) settings 3 | ifndef::doctype-manpage[:doctitle: setting-xdcr] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-xdcr - 9 | endif::[] 10 | Modifies cross data center replication (XDCR) settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-xdcr_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--checkpoint-interval ] 18 | [--worker-batch-size ] [--doc-batch-size ] 19 | [--failure-restart-interval ] [--source-nozzle-per-node ] 20 | [--target-nozzle-per-node ] [--bandwidth-usage-limit ] 21 | [--enable-compression ] [--stats-interval ] 22 | [--optimistic-replication-threshold ] [--log-level ] 23 | [--max-processes ] 24 | 25 | == DESCRIPTION 26 | 27 | This command sets global default settings for all XDCR replications. If you only 28 | want to change the settings for a single XDCR replication see the 29 | man:couchbase-cli-xdcr-replicate[1] command. 30 | 31 | == OPTIONS 32 | 33 | include::{partialsdir}/cbcli/part-common-options.adoc[] 34 | 35 | --checkpoint-interval :: 36 | The interval between checkpoints in seconds. The value of this option must 37 | be between 60 and 14,400. 38 | 39 | --worker-batch-size :: 40 | The worker batch size. The value of this option must be between 500 and 41 | 10,000. 42 | 43 | --doc-batch-size :: 44 | The document batch size in Kilobytes. The value of this option must be 45 | between 10 and 100,000. 46 | 47 | --failure-restart-interval :: 48 | Interval for restarting failed XDCR connections in seconds. The value of 49 | this option must be between 1 and 300. 50 | 51 | --optimistic-replication-threshold :: 52 | Document body size threshold in bytes used to trigger optimistic 53 | replication. 54 | 55 | --source-nozzle-per-node :: 56 | The number of source nozzles to each node in the target cluster. The 57 | value of this option must be between 1 and 10. 58 | 59 | --target-nozzle-per-node :: 60 | The number of outgoing nozzles to each node in the target cluster. The 61 | value of this option must be between 1 and 10. 62 | 63 | --bandwidth-usage-limit :: 64 | The default bandwidth limit for XDCR replications in mebibytes per second. 65 | 66 | --enable-compression :: 67 | Specifies whether or not XDCR compression is enabled. Set this option to 68 | "1" to enable compression or "0" to disable compression. This feature is 69 | only available in Couchbase Enterprise Edition and can only be used where 70 | the target cluster supports compression. 71 | 72 | --log-level :: 73 | The XDCR log level. 74 | 75 | --stats-interval :: 76 | The interval for statistics updates in milliseconds. 77 | 78 | --max-processes :: 79 | Specify the number of processes allocated to XDCR. As new replications are 80 | added, it will require more resources to maintain the replication throughput. 81 | This option allows to allocate more resources to XDCR. 82 | 83 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 84 | 85 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 86 | 87 | == EXAMPLES 88 | 89 | If we want to change the checkpoint interval to 500 seconds, the worker batch to 90 | 1000 documents, the document batch size to 1024KB, the failure restart interval 91 | to 60 seconds. the optimistic replication threshold to 102400 bytes, the source 92 | nozzles to 8, the target nozzles to 8, the log level to info, and the stats 93 | interval to 500 milliseconds run the following command. 94 | 95 | $ couchbase-cli setting-xdcr -c 192.168.1.5 -u Administrator \ 96 | -p password --checkpoint-interval 500 --worker-batch-size 1000 \ 97 | --doc-batch-size 1024 --failure-restart-interval 60 \ 98 | --optimistic-replication-threshold 102400 --source-nozzle-per-node 8 \ 99 | --target-nozzle-per-node 8 --log-level Info --stats-interval 500 100 | 101 | == ENVIRONMENT AND CONFIGURATION VARIABLES 102 | 103 | include::{partialsdir}/cbcli/part-common-env.adoc[] 104 | 105 | == SEE ALSO 106 | 107 | man:couchbase-cli-xdcr-replicate[1], 108 | man:couchbase-cli-xdcr-setup[1] 109 | 110 | include::{partialsdir}/cbcli/part-footer.adoc[] 111 | -------------------------------------------------------------------------------- /docs/design/cli-2.5-func-spec.md: -------------------------------------------------------------------------------- 1 | Newly added commands for 2.5 features: 2 | ---------------------------------------- 3 | 4 | **- Rack/Zone awareness - configure 5 | servers into groups** 6 | 7 | couchbase-cli group CLUSTER OPTIONS: 8 | 9 | CLUSTER: 10 | 11 | --cluster=HOST[:PORT] or -c HOST[:PORT] 12 | 13 | OPTONS: 14 | 15 | -u USERNAME, --username=USERNAME admin username of the cluster 16 | -p PASSWORD, --password=PASSWORD admin password of the cluster 17 | 18 | <<<<<<< HEAD 19 | --create=GROUPNAME group name to be added 20 | --delete=GROUPNAME group name to be removed 21 | --list-map show group/server relationship map 22 | --add-server=HOST[:PORT];HOST[:PORT] add a list of servers to the group 23 | --remove-server=HOST[:PORT];HOST[:PORT] remove a list of servers from the group 24 | --move-server=HOST[:PORT];HOST[:PORT] move a list of servers from one group to another 25 | --from-group=GROUPNAME group name that to move servers from group 26 | --to-group=GROUPNAME group name that to move servers to group 27 | 28 | ======= 29 | --create --group-name=GROUPNAME group name to be added 30 | --delete --group-name=GROUPNAME group name to be removed 31 | --list show group/server relationship map 32 | --rename=NEWGROUPNAME --group-name=GROUPNAME rename existed group to a new name 33 | --add-servers=HOST[:PORT];HOST[:PORT] add a list of servers to the group 34 | --move-servers=HOST[:PORT];HOST[:PORT] move a list of servers from one group to another 35 | --from-group=GROUPNAME group name that to move servers from group 36 | --to-group=GROUPNAME group name that to move servers to group 37 | 38 | 39 | Use cases: 40 | ---------- 41 | 42 | Create a new group 43 | 44 | couchbase-cli group-manage -c 192.168.0.1:8091 \\ 45 | --create --group-name=group1 -u Administor -p password 46 | 47 | Delete an empty group 48 | 49 | couchbase-cli group-manage -c 192.168.0.1:8091 \\ 50 | --delete --group-name=group1 -u Administor -p password 51 | 52 | Rename an existed group 53 | 54 | couchbase-cli group-manage -c 192.168.0.1:8091 \\ 55 | --rename=newgroup --group-name=group1 -u Administor -p password 56 | 57 | Show group/server map 58 | 59 | couchbase-cli group-manage -c 192.168.0.1:8091 \\ 60 | --list -u Administor -p password 61 | 62 | Add list of servers to a group 63 | 64 | couchbase-cli group-manage -c 192.168.0.1:8091 \\ 65 | --add-servers=10.1.1.1;10.1.1.2:8091 \\ 66 | --group-name=group1 \\ 67 | -u Administor -p password 68 | 69 | Move list of servers from group1 to group2 70 | 71 | couchbase-cli group-manage -c 192.168.0.1:8091 \\ 72 | --move-servers=10.1.1.1;10.1.1.2:8091 \\ 73 | --from-group=group1 \\ 74 | --to-group=group2 \\ 75 | -u Administor -p password 76 | 77 | >>>>>>> 9d5206b... MB-9312: Implement server grouping 78 | Question: 79 | 80 | What if a server is removed from a group, but never added back to another server? Do we allow such scenario? 81 | 82 | Modify existed commands 83 | ----------------------- 84 | 85 | couchbase-cli server-add/server-readd 86 | 87 | OPTIONS: 88 | 89 | --server-add=HOST[:PORT] server to be added 90 | --server-add-username=USERNAME admin username for the server to be added 91 | --server-add-password=PASSWORD admin password for the server to be added 92 | --group=GROUPNAME group name for the server to be added 93 | 94 | couchbase-cli server-list OPTIONS show not only servers, but also groups that servers belong to 95 | 96 | 97 | Newly added options for existed commands 98 | ---------------------------------------- 99 | 100 | - Enable XDCR Data security using SSL 101 | 102 | couchbase-cli xdcr-replicate 103 | 104 | OPTIONS: 105 | 106 | --create create and start a new replication 107 | --delete stop and cancel a replication 108 | --xdcr-from-bucket=BUCKET local bucket name to replicate from 109 | --xdcr-cluster-name=CLUSTERNAME remote cluster to replicate to 110 | --xdcr-to-bucket=BUCKETNAME remote bucket to replicate to 111 | --enable-data-security=[0|1] allow data security using ssl -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-cluster-edit.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-cluster-edit(1) 2 | :description: Edits cluster settings 3 | ifndef::doctype-manpage[:doctitle: cluster-edit] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-cluster-edit - 9 | endif::[] 10 | Edits cluster settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli cluster-edit_ [--cluster ] [--cluster-username ] [--cluster-password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--cluster-port ] 18 | [--cluster-ramsize ] [--cluster-name ] 19 | [--cluster-index-ramsize ] [--cluster-fts-ramsize ] 20 | 21 | == DESCRIPTION 22 | 23 | DEPRECATED: Please use the man:couchbase-cli-setting-cluster[1] command 24 | which provides the same functionality as this command. 25 | 26 | This command is used to modify cluster level settings. It allows users to change 27 | the Couchbase Server built-in administrator username and password, change the port 28 | that the cluster manager listens on, and modify the data, index, and full-text 29 | service memory quotas. 30 | 31 | == OPTIONS 32 | 33 | include::{partialsdir}/cbcli/part-common-options.adoc[] 34 | 35 | --cluster-username:: 36 | Specifies the new username for the Couchbase Server administrator user. 37 | 38 | --cluster-password:: 39 | Specifies the new password for the Couchbase Server administrator user. 40 | 41 | --cluster-ramsize:: 42 | Sets the data service memory quota (in MiB). This quota will be assigned 43 | to all future nodes added to the cluster with the data service. 44 | 45 | --cluster-fts-ramsize:: 46 | Sets the full-text service memory quota (in MiB). This parameter is required 47 | if the full-text service is specified in the --services option. This quota 48 | will be assigned to all future nodes added to the cluster with the full-text 49 | service. 50 | 51 | --cluster-index-ramsize:: 52 | Sets the index service memory quota (in MiB). This parameter is required if 53 | the index service is specified in the --services option. This quota will be 54 | assigned to all future nodes added to the cluster with the index service. 55 | 56 | --cluster-name:: 57 | Sets the name for this cluster. Naming clusters is useful when you have 58 | multiple Couchbase Server clusters in your deployment. 59 | 60 | --cluster-port:: 61 | Specifies the port for the Couchbase Server Administration Console. Defaults 62 | to port 8091. 63 | 64 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 65 | 66 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 67 | 68 | == EXAMPLES 69 | 70 | To change the username and password of the Couchbase Server administrator user run 71 | the following command. 72 | 73 | $ couchbase-cli cluster-edit -c 192.168.1.5:8091 --username current_user \ 74 | --password current_password --cluster-username new_username \ 75 | --cluster-password new_password 76 | 77 | To change the port number that the cluster manager listens on and the cluster 78 | name to "new_name" run the following command. 79 | 80 | $ couchbase-cli cluster-edit -c 192.168.1.5:8091 --username Administrator \ 81 | --password password --cluster-port 5000 --cluster-name new_name 82 | 83 | To change the memory quota of the data service to 2048MiB and the memory quota of 84 | the index service to 4096MiB run the following command. 85 | 86 | $ couchbase-cli cluster-edit -c 192.168.1.5:8091 --username Administrator \ 87 | --password password --cluster-ramsize 2048 --cluster-index-ramsize 4096 88 | 89 | All of the parameters in this command can be specified at the same time. To 90 | change the username and password of the Couchbase Server administrator user, change 91 | the port number to 5000, change the cluster name to "new_name", change the memory 92 | quota of the data service to 2048MiB and change the memory quota of the index 93 | service to 4096MiB run the following command. 94 | 95 | $ couchbase-cli cluster-edit -c 192.168.1.5:8091 --username current_user \ 96 | --password current_password --cluster-username new_username \ 97 | --cluster-password new_password --cluster-port 5000 \ 98 | --cluster-name new_name --cluster-ramsize 2048 --cluster-index-ramsize 4096 99 | 100 | == ENVIRONMENT AND CONFIGURATION VARIABLES 101 | 102 | include::{partialsdir}/cbcli/part-common-env.adoc[] 103 | 104 | == SEE ALSO 105 | 106 | man:couchbase-cli-cluster-init[1], 107 | man:couchbase-cli-setting-cluster[1] 108 | 109 | include::{partialsdir}/cbcli/part-footer.adoc[] 110 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-node-init.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-node-init(1) 2 | :description: Initializes a node 3 | ifndef::doctype-manpage[:doctitle: node-init] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-node-init - 9 | endif::[] 10 | Initializes a node 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli node-init_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--node-init-data-path ] 18 | [--node-init-index-path ] [--node-init-analytics-path ] 19 | [--node-init-eventing-path ] [--node-init-hostname ] 20 | [--node-init-java-home ] [--ipv4] [--ipv6] 21 | 22 | == DESCRIPTION 23 | 24 | This command initializes a Couchbase Server node. In particular this command 25 | allows the user to set the data path, index path, analytics path, java home 26 | and hostname. These settings must be set prior to initializing the cluster or 27 | adding the node to an existing cluster as they cannot be changed later. The 28 | hostname however can be changed later if the node is the only node in the 29 | cluster. 30 | 31 | To get the best performance from Couchbase Server, it is recommended that the 32 | data, index and analytics paths be set to separate disks. 33 | 34 | == OPTIONS 35 | 36 | include::{partialsdir}/cbcli/part-common-options.adoc[] 37 | 38 | --node-init-data-path:: 39 | The path to store data files create by the Couchbase data service. Note that 40 | this path is also where view indexes are written on this server. This flag 41 | can only be specified against a node that is not yet part of a cluster. 42 | 43 | --node-init-index-path:: 44 | The path to store files create by the Couchbase index service. This flag can 45 | only be specified against a node that is not yet part of a cluster. 46 | 47 | --node-init-analytics-path:: 48 | The path to store files create by the Couchbase Analytics service. This flag 49 | can only be specified against a node that is not yet part of a cluster. 50 | Multiple paths can be specified by setting this option multiple times. 51 | 52 | --node-init-eventing-path:: 53 | The path to store files create by the Couchbase Eventing service. This flag 54 | can only be specified against a node that is not yet part of a cluster. 55 | 56 | --node-init-hostname:: 57 | Specifies the hostname for this server. 58 | 59 | --node-init-java-home:: 60 | Specifies the location of the Java Runtime Environment for the Analytics 61 | service to use. 62 | 63 | --ipv4:: 64 | Switch the node to use ipv4 for node to node communication 65 | 66 | --ipv6:: 67 | Switch the node to use ipv6 for node to node communication 68 | 69 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 70 | 71 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 72 | 73 | == EXAMPLES 74 | 75 | To initialize a node and set the index path to `/mnt1/indexes` and the data path 76 | to `/mnt2/data` run the following command. Note that this command must be run 77 | before the node becomes part of a cluster. 78 | ---- 79 | $ couchbase-cli node-init -c 192.168.1.5 \ 80 | --node-init-data-path /mnt2/data --node-init-index-path /mnt1/indexes 81 | ---- 82 | In the command above, the cluster username and password have not yet been set so 83 | you can skip adding these to the command line. If you later initialize the cluster 84 | and want to set the hostname for the cluster, then run the command 85 | below. Note that this time the cluster is initialized, so you must include the 86 | username and password. 87 | ---- 88 | $ couchbase-cli node-init -c 192.168.1.5 -u Administrator -p password \ 89 | --node-init-hostname cb1.mydomain.com 90 | ---- 91 | You could have alternatively set all five of these options below before 92 | initializing the cluster. This can be done with the following command. 93 | 94 | ---- 95 | $ couchbase-cli node-init -c 192.168.1.5 --node-init-hostname cb1.mydomain.com \ 96 | --node-init-data-path /mnt2/data --node-init-index-path /mnt1/indexes \ 97 | --node-init-analytics-path /mnt3/analytics \ 98 | --node-init-java-home /usr/lib/java/ 99 | ---- 100 | Again, note that you don't need the username and password because in this example 101 | the cluster has not yet been initialized. 102 | 103 | == ENVIRONMENT AND CONFIGURATION VARIABLES 104 | 105 | include::{partialsdir}/cbcli/part-common-env.adoc[] 106 | 107 | == SEE ALSO 108 | 109 | man:couchbase-cli-cluster-init[1], 110 | man:couchbase-cli-server-add[1], 111 | man:couchbase-cli-node-reset[1] 112 | 113 | include::{partialsdir}/cbcli/part-footer.adoc[] 114 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-server-readd.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-server-readd(1) 2 | :description: Adds a node back to the cluster after a failover 3 | ifndef::doctype-manpage[:doctitle: server-readd] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-server-readd - 9 | endif::[] 10 | Adds a node back to the cluster after a failover 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli server-readd_ [--cluster ] [--username ] [--password ] [--client-cert ] 16 | [--client-cert-password ] [--client-key ] [--client-key-password ] 17 | [--server-add ] [--group-name ] [--server-username ] [--server-password ] 18 | 19 | == DESCRIPTION 20 | 21 | DEPRECATED: This command was deprecated in 5.0.0 and will be removed in future 22 | releases. Please use the man:couchbase-cli-recovery[1] subcommand which 23 | provides similar functionality to this command. 24 | 25 | The server-readd subcommand is used to add a server back to the cluster. This 26 | operation is useful after a node is failed over and also when a node is 27 | removed from the cluster for maintenance. 28 | 29 | When a node is failed over and removed from the cluster it may be able to 30 | be added back to the cluster. An example of this is when a node loses power. 31 | This node might get failed over and removed from the cluster, but once power 32 | is restored to the node you may want to add it back to the cluster. 33 | 34 | Another use case is taking a node out of the cluster for maintenance. This 35 | is done by gracefully failing over a node to ensure there is no data loss. 36 | The administrator can then perform maintenance on the removed node and add it 37 | back with the server-readd command. 38 | 39 | It is also possible to add a server back to the cluster without removing the 40 | data and instead having the server recover data from where it left off. This is 41 | called delta recovery and is available from the 42 | man:couchbase-cli-recovery[1] subcommand. 43 | 44 | Note that after the server-readd subcommand is run you must rebalance the 45 | cluster. See the man:couchbase-cli-rebalance[1] command for more 46 | information on rebalancing a cluster. 47 | 48 | == OPTIONS 49 | 50 | include::{partialsdir}/cbcli/part-common-options.adoc[] 51 | 52 | --server-add :: 53 | A comma separated list of nodes to readd. The each server should 54 | correspond to the hostname or IP address of a server to be added back to 55 | the cluster. 56 | 57 | --server-username :: 58 | Adding a node back to the cluster can only be done by a user with the 59 | appropriate credentials. This flag specifies the username for a user who 60 | has the ability to modify the cluster topology of the node being added 61 | back. 62 | 63 | --server-password :: 64 | Adding a node back to the cluster can only be done by a user with the 65 | appropriate credentials. This flag specifies the password for a user who 66 | has the ability to modify the cluster topology of the node being added 67 | back. 68 | 69 | --group-name :: 70 | The name of the group to add the node to. 71 | 72 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 73 | 74 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 75 | 76 | == EXAMPLES 77 | 78 | If there is a node at 192.168.1.6:8091 that you want to add back and that 79 | node has credentials that allow us to change the cluster topology with 80 | "Administrator" as the username and "password" as the password, run the 81 | following command. 82 | 83 | $ couchbase-cli server-readd -c 192.168.1.5:8091 --username Administrator \ 84 | --password password --server-add 192.168.1.6:8091 \ 85 | --server-username Administrator --server-password password 86 | 87 | If you need to add back multiple nodes then you would run the following command. 88 | 89 | $ couchbase-cli server-readd -c 192.168.1.5:8091 --username Administrator \ 90 | --password password --server-add 192.168.1.6:8091,192.168.1.7:8091 \ 91 | --server-username Administrator --server-password password 92 | 93 | If you wanted the nodes being added back to the cluster to be a part of the 94 | "East" group we would run the following command 95 | 96 | $ couchbase-cli server-readd -c 192.168.1.5:8091 --username Administrator \ 97 | --password password --server-add 192.168.1.6:8091 --group-name East \ 98 | --server-username Administrator --server-password password 99 | 100 | == ENVIRONMENT AND CONFIGURATION VARIABLES 101 | 102 | include::{partialsdir}/cbcli/part-common-env.adoc[] 103 | 104 | == SEE ALSO 105 | 106 | man:couchbase-cli-rebalance[1], 107 | man:couchbase-cli-recovery[1], 108 | man:couchbase-cli-server-add[1] 109 | 110 | include::{partialsdir}/cbcli/part-footer.adoc[] 111 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-rebalance.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-rebalance(1) 2 | :description: Modifies rebalance retry settings 3 | ifndef::doctype-manpage[:doctitle: setting-rebalance] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-rebalance - 9 | endif::[] 10 | Modifies rebalance retry settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-rebalance [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--set] [--get] [--cancel] [--pending-info] [--enable <1|0>] 18 | [--wait-for ] [--moves-per-node ] [--max-attempts ] 19 | [--rebalance-id ] 20 | 21 | == DESCRIPTION 22 | 23 | This command allows configuring and retrieving automatic rebalance retry 24 | settings as well as canceling and retrieving information of pending rebalance 25 | retries. 26 | 27 | == OPTIONS 28 | 29 | include::{partialsdir}/cbcli/part-common-options.adoc[] 30 | 31 | --set:: 32 | Specify to configure the automatic rebalance retry settings. 33 | 34 | --get:: 35 | Specify to retrieve the automatic rebalance retry settings. 36 | 37 | --cancel:: 38 | Specify to cancel a pending rebalance retry, use --rebalance-id together 39 | with this option to provide the rebalance id. 40 | 41 | --pending-info:: 42 | Specify to retrieve information of pending rebalance retries. 43 | 44 | --enable <1|0>:: 45 | Enable (1) or disable (0) automatic rebalance retry. This flag is required 46 | when using --set. By default, automatic rebalance retry is disabled. 47 | 48 | --wait-for :: 49 | Specify the amount of time to wait after a failed rebalance before retrying. 50 | Time must be a value between 5 and 3600 seconds. 51 | By default, the wait time is 300 seconds. 52 | 53 | --max-attempts :: 54 | Specify the number of times a failed rebalance will be retried. The value 55 | provided must be between 1 and 3, the default is 1. 56 | 57 | --moves-per-node :: 58 | Specify the number of concurrent vBucket to move per a node during a rebalance. 59 | The value provided must be between 1 and 64, the default is 4. A higher 60 | setting may improve rebalance performance, at the cost of higher resource 61 | consumption; in terms of CPU, memory, disk, and bandwidth. Conversely, a lower 62 | setting may degrade rebalance performance while freeing up such resources. 63 | Note, however, that rebalance performance can be affected by many additional 64 | factors; and that in consequence, changing this parameter may not always have 65 | the expected effects. Note also that a higher setting, due to its additional 66 | consumption of resources, may degrade the performance of other systems, 67 | including the Data Service. 68 | 69 | --rebalance-id :: 70 | Specify the rebalance id of a failed rebalance. Use together with --cancel, 71 | to cancel a pending retry. 72 | 73 | 74 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 75 | 76 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 77 | 78 | == EXAMPLES 79 | 80 | To retrieve the current automatic rebalance retry configuration, use: 81 | ---- 82 | $ couchbase-cli setting-rebalance -c 127.0.0.1:8091 -u Administrator \ 83 | -p password --get 84 | ---- 85 | To enable automatic rebalance retry use the command bellow. 86 | ---- 87 | $ couchbase-cli setting-rebalance -c 127.0.0.1:8091 -u Administrator \ 88 | -p password --set --enable 1 89 | ---- 90 | You can also set the `wait-for` period and the maximum number of retries. 91 | The command above enables automatic rebalance retry as well as setting the wait time 92 | before retrying to 60 seconds and the maximum number of retries to 2. 93 | ---- 94 | $ couchbase-cli setting-rebalance -c 127.0.0.1:8091 -u Administrator \ 95 | -p password --set --enable 1 --wait-for 60 --retries 2 96 | ---- 97 | To retrieve information of the pending rebalance retries, run the command bellow. 98 | ---- 99 | $ couchbase-cli setting-rebalance -c 127.0.0.1:8091 -u Administrator \ 100 | -p password --pending-info 101 | ---- 102 | To cancel a pending rebalance retry run the command bellow where 103 | `4198f4b1564a800223271af76edd4f98` is the rebalance id, this can be retrieved using 104 | the `--pending-info` flag above. 105 | ---- 106 | $ couchbase-cli setting-rebalance -c 127.0.0.1:8091 -u Administrator \ 107 | -p password --pending-info --rebalance-id 4198f4b1564a800223271af76edd4f98 108 | ---- 109 | == ENVIRONMENT AND CONFIGURATION VARIABLES 110 | 111 | include::{partialsdir}/cbcli/part-common-env.adoc[] 112 | 113 | == SEE ALSO 114 | 115 | man:couchbase-cli-rebalance[1], 116 | man:couchbase-cli-rebalance-status[1] 117 | 118 | include::{partialsdir}/cbcli/part-footer.adoc[] 119 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-server-eshell.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-server-eshell(1) 2 | :description: Opens a shell to talk to the cluster manager process 3 | ifndef::doctype-manpage[:doctitle: server-eshell] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-server-eshell - 9 | endif::[] 10 | Opens a shell to talk to the cluster manager process 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli server-eshell_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--vm ] [--erl-path ] 18 | [--ns-ebin-path ] [--hosts-path ] [--base-path ] 19 | 20 | == DESCRIPTION 21 | 22 | This is a hidden command and is not intended for typical production use. This 23 | command allows the user to connect to the cluster manager process in order to 24 | make unsupported changes in the cluster manager. This command is typically used 25 | as last resort in order to address uncommon production issues. Check with the 26 | Couchbase Support team before running this command because improper use can lead 27 | to the cluster being placed in an unusable state. 28 | 29 | When this command is executed it connects to the local cluster manager process 30 | specified and starts a shell so that the user can interact with the cluster 31 | manager. This command only works for localhost and can't connect to any other 32 | host. 33 | 34 | == OPTIONS 35 | 36 | include::{partialsdir}/cbcli/part-common-options.adoc[] 37 | 38 | --vm:: 39 | The part of the cluster manager to connect to. This option can either be set 40 | to babysitter, couchdb, or ns_server. The babysitter vm is a monitor that 41 | ensures the cluster manager is always running and is restarted in the event 42 | of a crash or error. The couchdb vm runs the views service on each data node 43 | and the ns_server vm corresponds to the cluster manager. By default the vm 44 | option is set to ns_server. 45 | 46 | --erl-path:: 47 | Specifies the location of the directory containing the erlang process. This 48 | parameter should only be set if the default erlang process that is shipped 49 | with Couchbase is not the correct executable to connect to the cluster 50 | manager with. The directory containing the erlang process is `bin` within the 51 | Couchbase Server installation directory. 52 | 53 | --ns-ebin-path:: 54 | Specifies the location of the ns_server ebin directory. This parameter should 55 | only be set if the default ebin directory that is shipped with Couchbase is 56 | not the correct directory to connect to the cluster manager with. The ebin 57 | directory can be found within the Couchbase Server installation directory at 58 | at `ns_server/erlang/lib/ns_server/ebin` on Mac/Linux, and `ns_server/ebin` 59 | on Windows. 60 | 61 | --hosts_path:: 62 | Specifies the location of the hosts.cfg file. This parameter should only be 63 | set if the default hosts.cfg file that is shipped with Couchbase is not the 64 | correct file to connect to the cluster manager with. The hosts.cfg file can 65 | be found within the Couchbase Server installation directory at 66 | `etc/couchbase/hosts.cfg`. 67 | 68 | --base-path:: 69 | Specifies the location of the base directory. This parameter should only be 70 | set if Couchbase was installed in a non-standard location. Note that this 71 | parameter is only currently used on Mac - on other operating systems it isn't 72 | used. 73 | 74 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 75 | 76 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 77 | 78 | == EXAMPLES 79 | 80 | To connect to the cluster manager process you can run the following command 81 | below. 82 | 83 | $ couchbase-cli server-eshell -c 192.168.1.5:8091 --username Administrator \ 84 | --password password 85 | 86 | Erlang R16B03-1 (erts-5.10.4.0.0.1) 87 | 88 | Eshell V5.10.4.0.0.1 (abort with ^G) 89 | (n_0@192.168.1.5)1> 90 | 91 | When the command is executed it will bring up a shell that is connected to the 92 | vm specified in the command. Since the --vm parameter is not specified we 93 | connect to the default ns_server vm. 94 | 95 | To connect to the babysitter vm the following command would be run. 96 | 97 | $ couchbase-cli server-eshell -c 192.168.1.5:8091 --username Administrator \ 98 | --password password --vm babysitter 99 | 100 | Erlang R16B03-1 (erts-5.10.4.0.0.1) 101 | 102 | Eshell V5.10.4.0.0.1 (abort with ^G) 103 | (n_0@192.168.1.5)1> 104 | 105 | To exit the shell send the SIGINT signal. This can be done by typing Ctrl-C. 106 | 107 | == ENVIRONMENT AND CONFIGURATION VARIABLES 108 | 109 | include::{partialsdir}/cbcli/part-common-env.adoc[] 110 | 111 | include::{partialsdir}/cbcli/part-footer.adoc[] 112 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/_partials/cbcli/nav.adoc: -------------------------------------------------------------------------------- 1 | * xref:cli:cbcli/couchbase-cli.adoc[couchbase-cli] 2 | ** xref:cli:cbcli/couchbase-cli-admin-manage.adoc[lock-admin] 3 | ** xref:cli:cbcli/couchbase-cli-analytics-link-setup.adoc[analytics-link-setup] 4 | ** xref:cli:cbcli/couchbase-cli-backup-service.adoc[backup-service] 5 | ** xref:cli:cbcli/couchbase-cli-backup-service-nodes-threads-map.adoc[backup-service nodes-threads-map] 6 | ** xref:cli:cbcli/couchbase-cli-backup-service-plan.adoc[backup-service plan] 7 | ** xref:cli:cbcli/couchbase-cli-backup-service-repository.adoc[backup-service repository] 8 | ** xref:cli:cbcli/couchbase-cli-backup-service-settings.adoc[backup-service settings] 9 | ** xref:cli:cbcli/couchbase-cli-bucket-compact.adoc[bucket-compact] 10 | ** xref:cli:cbcli/couchbase-cli-bucket-create.adoc[bucket-create] 11 | ** xref:cli:cbcli/couchbase-cli-bucket-delete.adoc[bucket-delete] 12 | ** xref:cli:cbcli/couchbase-cli-bucket-edit.adoc[bucket-edit] 13 | ** xref:cli:cbcli/couchbase-cli-bucket-flush.adoc[bucket-flush] 14 | ** xref:cli:cbcli/couchbase-cli-bucket-list.adoc[bucket-list] 15 | ** xref:cli:cbcli/couchbase-cli-cluster-edit.adoc[cluster-edit] 16 | ** xref:cli:cbcli/couchbase-cli-cluster-init.adoc[cluster-init] 17 | ** xref:cli:cbcli/couchbase-cli-collect-logs-start.adoc[collect-logs-start] 18 | ** xref:cli:cbcli/couchbase-cli-collect-logs-status.adoc[collect-logs-status] 19 | ** xref:cli:cbcli/couchbase-cli-collect-logs-stop.adoc[collect-logs-stop] 20 | ** xref:cli:cbcli/couchbase-cli-collection-manage.adoc[collection-manage] 21 | ** xref:cli:cbcli/couchbase-cli-enable-developer-preview.adoc[enable-developer-preview] 22 | ** xref:cli:cbcli/couchbase-cli-enterprise-analytics-link-setup.adoc[enterprise-analytics-link-setup] 23 | ** xref:cli:cbcli/couchbase-cli-eventing-function-setup.adoc[eventing-function-setup] 24 | ** xref:cli:cbcli/couchbase-cli-failover.adoc[failover] 25 | ** xref:cli:cbcli/couchbase-cli-group-manage.adoc[group-manage] 26 | ** xref:cli:cbcli/couchbase-cli-host-list.adoc[host-list] 27 | ** xref:cli:cbcli/couchbase-cli-ip-family.adoc[ip-family] 28 | ** xref:cli:cbcli/couchbase-cli-master-password.adoc[master-password] 29 | ** xref:cli:cbcli/couchbase-cli-node-init.adoc[node-init] 30 | ** xref:cli:cbcli/couchbase-cli-node-reset.adoc[node-reset] 31 | ** xref:cli:cbcli/couchbase-cli-node-to-node-encryption.adoc[node-to-node-encryption] 32 | ** xref:cli:cbcli/couchbase-cli-rebalance-status.adoc[rebalance-status] 33 | ** xref:cli:cbcli/couchbase-cli-rebalance-stop.adoc[rebalance-stop] 34 | ** xref:cli:cbcli/couchbase-cli-rebalance.adoc[rebalance] 35 | ** xref:cli:cbcli/couchbase-cli-recovery.adoc[recovery] 36 | ** xref:cli:cbcli/couchbase-cli-reset-admin-password.adoc[reset-admin-password] 37 | ** xref:cli:cbcli/couchbase-cli-reset-cipher-suites.adoc[reset-cipher-suites] 38 | ** xref:cli:cbcli/couchbase-cli-server-add.adoc[server-add] 39 | ** xref:cli:cbcli/couchbase-cli-server-info.adoc[server-info] 40 | ** xref:cli:cbcli/couchbase-cli-server-list.adoc[server-list] 41 | ** xref:cli:cbcli/couchbase-cli-server-readd.adoc[server-readd] 42 | ** xref:cli:cbcli/couchbase-cli-setting-alert.adoc[setting-alert] 43 | ** xref:cli:cbcli/couchbase-cli-setting-alternate-address.adoc[setting-alternate-address] 44 | ** xref:cli:cbcli/couchbase-cli-setting-analytics.adoc[setting-analytics] 45 | ** xref:cli:cbcli/couchbase-cli-setting-audit.adoc[setting-audit] 46 | ** xref:cli:cbcli/couchbase-cli-setting-autofailover.adoc[setting-autofailover] 47 | ** xref:cli:cbcli/couchbase-cli-setting-autoreprovision.adoc[setting-autoreprovision] 48 | ** xref:cli:cbcli/couchbase-cli-setting-cluster.adoc[setting-cluster] 49 | ** xref:cli:cbcli/couchbase-cli-setting-compaction.adoc[setting-compaction] 50 | ** xref:cli:cbcli/couchbase-cli-setting-encryption.adoc[setting-encryption] 51 | ** xref:cli:cbcli/couchbase-cli-setting-enterprise-analytics.adoc[setting-enterprise-analytics] 52 | ** xref:cli:cbcli/couchbase-cli-setting-index.adoc[setting-index] 53 | ** xref:cli:cbcli/couchbase-cli-setting-ldap.adoc[setting-ldap] 54 | ** xref:cli:cbcli/couchbase-cli-setting-master-password.adoc[setting-master-password] 55 | ** xref:cli:cbcli/couchbase-cli-setting-notification.adoc[setting-notification] 56 | ** xref:cli:cbcli/couchbase-cli-setting-password-policy.adoc[setting-password-policy] 57 | ** xref:cli:cbcli/couchbase-cli-setting-query.adoc[setting-query] 58 | ** xref:cli:cbcli/couchbase-cli-setting-rebalance.adoc[setting-rebalance] 59 | ** xref:cli:cbcli/couchbase-cli-setting-saslauthd.adoc[setting-saslauthd] 60 | ** xref:cli:cbcli/couchbase-cli-setting-security.adoc[setting-security] 61 | ** xref:cli:cbcli/couchbase-cli-setting-xdcr.adoc[setting-xdcr] 62 | ** xref:cli:cbcli/couchbase-cli-ssl-manage.adoc[ssl-manage] 63 | ** xref:cli:cbcli/couchbase-cli-user-change-password.adoc[user-change-password] 64 | ** xref:cli:cbcli/couchbase-cli-user-manage.adoc[user-manage] 65 | ** xref:cli:cbcli/couchbase-cli-xdcr-replicate.adoc[xdcr-replicate] 66 | ** xref:cli:cbcli/couchbase-cli-xdcr-setup.adoc[xdcr-setup] 67 | -------------------------------------------------------------------------------- /test/test_cbrecovery.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright 2022 Couchbase Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | import imp 18 | import json 19 | import os 20 | import unittest 21 | from optparse import Values 22 | 23 | from mock_server import MockRESTServer, generate_self_signed_cert 24 | 25 | cbrecovery = imp.load_source('cbrecovery', './cbrecovery') 26 | 27 | host = '127.0.0.1' 28 | port = 6789 29 | 30 | # setUpModule will generate new certificates for the mock HTTPS server used during unit testing. 31 | # 32 | # NOTE: We don't remove the key/cert once generated since they're included in the '.gitignore' file. 33 | 34 | 35 | def setUpModule(): 36 | generate_self_signed_cert(os.path.dirname(os.path.abspath(__file__))) 37 | 38 | 39 | class RecoveryTest(unittest.TestCase): 40 | def test_pre_transfer(self): 41 | tests = { 42 | "MissingRecoveryMap": { 43 | "opts": Values({ 44 | "username": "", 45 | "password": "", 46 | # Assert that we use these credentials, and not the empty source credentials 47 | "username_dest": "Administrator", 48 | "password_dest": "asdasd", 49 | "ssl": False, 50 | }), 51 | "response": {}, 52 | "error": "Missing recovery map from response", 53 | }, 54 | "MissingRecoveryMap1": { 55 | "opts": Values({ 56 | "username": "", 57 | "password": "", 58 | # Assert that we use these credentials, and not the empty source credentials 59 | "username_dest": "Administrator", 60 | "password_dest": "asdasd", 61 | "ssl": False, 62 | }), 63 | "status": 400, 64 | "response": {"code": "not_needed"}, 65 | "error": "error: unable to access REST API: " 66 | "127.0.0.1:6789/pools/default/buckets/bucket/controller/startRecovery; please check source URL, " 67 | "server status, username (-u) and password (-p); response: 400; reason: start_recovery", 68 | "cmd": "startRecovery", 69 | "bad_request_code": "not_needed", 70 | } 71 | } 72 | 73 | recovery = cbrecovery.Recovery() 74 | recovery.sink_bucket = "bucket" 75 | 76 | opts = Values({ 77 | "username": "", 78 | "password": "", 79 | # Assert that we use these credentials, and not the empty source credentials 80 | "username_dest": "Administrator", 81 | "password_dest": "asdasd", 82 | "ssl": False, 83 | }) 84 | 85 | def value(test, key): 86 | return test[key] if key in test else None 87 | 88 | for name, test in tests.items(): 89 | with self.subTest(name): 90 | server = MockRESTServer(host, port) 91 | server.set_args({"/pools/default/buckets/bucket/controller/startRecovery": value(test, "response")}) 92 | status = value(test, "status") 93 | if status: 94 | server.args['override-status'] = status 95 | server.run() 96 | 97 | err, cmd, bad_request_code = recovery.pre_transfer(opts, "", f"http://{host}:{port}") 98 | self.assertEqual(value(test, "error"), err) 99 | self.assertEqual(value(test, "cmd"), cmd) 100 | self.assertEqual(value(test, "bad_request_code"), bad_request_code) 101 | self.assertIn('POST:/pools/default/buckets/bucket/controller/startRecovery', server.trace) 102 | 103 | server.shutdown() 104 | 105 | def test_post_transfer(self): 106 | server = MockRESTServer(host, port) 107 | server.run() 108 | 109 | recovery = cbrecovery.Recovery() 110 | recovery.sink_bucket = "bucket" 111 | 112 | opts = Values({ 113 | "username": "", 114 | "password": "", 115 | # Assert that we use these credentials, and not the empty source credentials 116 | "username_dest": "Administrator", 117 | "password_dest": "asdasd", 118 | "dry_run": False, 119 | "ssl": False, 120 | }) 121 | 122 | err, _ = recovery.post_transfer(opts, "", f"http://{host}:{port}", 0) 123 | self.assertIn('POST:/pools/default/buckets/bucket/controller/commitVBucket', server.trace) 124 | self.assertIsNone(err) 125 | 126 | server.shutdown() 127 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-server-add.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-server-add(1) 2 | :description: Adds a server to the cluster 3 | ifndef::doctype-manpage[:doctitle: server-add] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-server-add - 9 | endif::[] 10 | Adds a server to the cluster 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli server-add_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] [--client-key-password ] 17 | [--server-add ] [--group-name ] 18 | [--server-add-username ] [--server-add-password ] 19 | [--services ] [--index-storage-setting ] 20 | 21 | == DESCRIPTION 22 | 23 | The server-add subcommand is used to add one or more servers to a cluster. 24 | Before adding a server it is important to decide which services the server will 25 | be running and whether or not the server should be a part of a specific group. 26 | Keep in mind that if the index service is being added on one of the servers and 27 | the cluster is not currently running the index service that you also need to 28 | set the index storage mode. This can be done with the --index-storage-setting 29 | option. 30 | 31 | Note that the server to be added can not be specified using the http scheme 32 | since, in 7.1+, addition must occur over a secure connection. 33 | 34 | == OPTIONS 35 | 36 | include::{partialsdir}/cbcli/part-common-options.adoc[] 37 | 38 | --server-add :: 39 | A comma separated list of servers to add to the cluster. The each server in 40 | the list should be identified by a hostname or IP address. If a scheme is not 41 | provided it will use `https://` 42 | 43 | --server-add-username :: 44 | Adding a server to the cluster can only be done by a user with the 45 | appropriate credentials. This flag specifies the username for a user who 46 | has the ability to modify the cluster topology on the server being added. 47 | 48 | --server-add-password :: 49 | Adding a server to the cluster can only be done by a user with the 50 | appropriate credentials. This flag specifies the password for a user who 51 | has the ability to modify the cluster topology on the server being added. 52 | 53 | --group-name :: 54 | The name of the group to add the server to. If this option is not specified 55 | then the server is added to the default group. 56 | 57 | --services :: 58 | A comma separated list of services that this server should be running. 59 | Accepted services are "data", "index", "query", "fts", "eventing", 60 | "analytics", "backup" and "manager-only". No other service can be used 61 | alongside the "manager-only" service because the server with this service 62 | specified will only act as a cluster manager and will not run any of the 63 | other functional services. 64 | 65 | --index-storage-setting :: 66 | Specifies the index storage mode. This parameter must be set if the servers 67 | being added contain the index service and this is the first time the index 68 | service is being added in this cluster. You may specify "default" for disk 69 | based indexes or `memopt` for memory optimized indexes. 70 | 71 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 72 | 73 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 74 | 75 | == EXAMPLES 76 | 77 | If we want to add a server at 192.168.1.6:8091 with the index, data and query 78 | service on it then we would run the command below. 79 | ---- 80 | $ couchbase-cli server-add -c 192.168.1.5:8091 --username Administrator \ 81 | --password password --server-add https://192.168.1.6:18091 \ 82 | --server-add-username Administrator --server-add-password password 83 | --services data,index,query 84 | ---- 85 | Note that in the example above we set the username and password of the server 86 | being added to the same value as the username and password of the servers 87 | already in the cluster. This is done if the server being added has not already 88 | been initialized. If the server being added has been initialized then you will 89 | need to specify an appropriate username and password for the server being added. 90 | 91 | Now lets add two server to the East group with data, index,and full-text 92 | services. In this example we will also assume that the index is being added for 93 | the first time so we need to specify the index storage mode. If we want to index 94 | storage mode to be memory optimized then we would run the following command. 95 | ---- 96 | $ couchbase-cli server-add -c 192.168.1.5:8091 --username Administrator \ 97 | --password password --server-add https://192.168.1.6:18091,https://192.168.1.7:18091 \ 98 | --server-username Administrator --server-password password 99 | --services data,fts --group-name --index-storage-setting memopt 100 | ---- 101 | == ENVIRONMENT AND CONFIGURATION VARIABLES 102 | 103 | include::{partialsdir}/cbcli/part-common-env.adoc[] 104 | 105 | == SEE ALSO 106 | 107 | man:couchbase-cli-rebalance[1], 108 | man:couchbase-cli-server-info[1], 109 | man:couchbase-cli-server-list[1] 110 | 111 | include::{partialsdir}/cbcli/part-footer.adoc[] 112 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-xdcr-setup.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-xdcr-setup(1) 2 | :description: Manage references to remote clusters 3 | ifndef::doctype-manpage[:doctitle: xdcr-setup] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-xdcr-setup - 9 | endif::[] 10 | Manage references to remote clusters 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli xdcr-setup_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--create] [--delete] [--edit] [--list] [--stage] 18 | [--xdcr-cluster-name ] [--xdcr-hostname ] [--xdcr-hostname-external] 19 | [--xdcr-username ] [--xdcr-password ] 20 | [--xdcr-user-certificate ] [--xdcr-user-key ] 21 | [--xdcr-certificate ] [--xdcr-secure-connection ] 22 | 23 | == DESCRIPTION 24 | 25 | This command is used to manage the remote clusters that are available to be 26 | replicated to. 27 | 28 | == OPTIONS 29 | 30 | include::{partialsdir}/cbcli/part-common-options.adoc[] 31 | 32 | --create:: 33 | Creates an new XDCR remote reference. 34 | 35 | --delete:: 36 | Deletes an XDCR remote reference. 37 | 38 | --edit:: 39 | Edits an XDCR remote reference. 40 | 41 | --stage:: 42 | Adds staged credentials to the XDCR remote reference. 43 | 44 | --list:: 45 | List all XDCR remote references. 46 | 47 | --xdcr-cluster-name :: 48 | The name for the remote cluster reference. 49 | 50 | --xdcr-hostname :: 51 | The hostname of the remote cluster reference. 52 | 53 | --xdcr-hostname-external:: 54 | Specifies that the hostname passed as `--xdcr-hostname` is an external address. 55 | 56 | --xdcr-username :: 57 | The username of the remote cluster reference. 58 | 59 | --xdcr-password :: 60 | The password of the remote cluster reference. 61 | 62 | --xdcr-user-certificate :: 63 | The user certificate for authentication 64 | 65 | --xdcr-user-key :: 66 | The user key for authentication 67 | 68 | --xdcr-certificate :: 69 | The certificate used for encryption 70 | 71 | --xdcr-secure-connection :: 72 | Specifies the type of encryption to use. This flag may either be set to 73 | either "half", "full", or "none". Half encryption means that passwords are 74 | encrypted, but data is not. This results in faster data transfer, but less 75 | security. Full encryption means that all data and passwords are encrypted 76 | which increases security, but reduces overall data transfer speed. If no 77 | encryption is needed then "none" can be specified. This flag defaults to 78 | "none" if it is not specified. 79 | 80 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 81 | 82 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 83 | 84 | == EXAMPLES 85 | 86 | To create a new remote reference to a Couchbase cluster named "east" run the 87 | following command. 88 | 89 | $ couchbase-cli xdcr-setup -c 192.168.1.5 -u Administrator \ 90 | -p password --create --xdcr-cluster-name east --xdcr-hostname 192.168.1.6 \ 91 | --xdcr-username Administrator --xdcr-password password 92 | 93 | If the new remote reference should always be encrypted then make sure to enable 94 | encryption. 95 | 96 | $ couchbase-cli xdcr-setup -c 192.168.1.5 -u Administrator \ 97 | -p password --create --xdcr-cluster-name east --xdcr-hostname 192.168.1.6 \ 98 | --xdcr-username Administrator --xdcr-password password \ 99 | --xdcr-demand-encryption 1 --xdcr-certificate /root/cluster.cert 100 | 101 | To list all current XDCR cluster references run the following command. 102 | 103 | $ couchbase-cli xdcr-setup -c 192.168.1.5 -u Administrator \ 104 | -p password --list 105 | 106 | If you need to edit a cluster references named "east" and change the password 107 | run the following command. 108 | 109 | $ couchbase-cli xdcr-setup -c 192.168.1.5 -u Administrator \ 110 | -p password --edit --xdcr-cluster-name east --xdcr-hostname 192.168.1.6 \ 111 | --xdcr-username Administrator --xdcr-password new_password 112 | 113 | Note in the above example that you need to specify all of the current unchanging 114 | configuration parameters also to avoid them being reset to defaults. 115 | 116 | Remote references can have "staged" credentials which are used if the first set 117 | start failing. Username and password or client certificate and key can be passed. 118 | These can be set like so. 119 | 120 | $ couchbase-cli xdcr-setup -c 192.168.1.5 -u Administrator \ 121 | -p password --stage --xdcr-cluster-name east \ 122 | --xdcr-username Admin2 --xdcr-password password 123 | 124 | If you no longer need an XDCR remote reference then you can delete it. We should 125 | this below using the "east" remote reference as an example. 126 | 127 | $ couchbase-cli xdcr-setup -c 192.168.1.5 -u Administrator \ 128 | -p password --delete --xdcr-cluster-name east 129 | 130 | == ENVIRONMENT AND CONFIGURATION VARIABLES 131 | 132 | include::{partialsdir}/cbcli/part-common-env.adoc[] 133 | 134 | == SEE ALSO 135 | 136 | man:couchbase-cli-setting-xdcr[1], 137 | man:couchbase-cli-xdcr-replicate[1] 138 | 139 | include::{partialsdir}/cbcli/part-footer.adoc[] 140 | -------------------------------------------------------------------------------- /docs/modules/cli/pages/cbcli/couchbase-cli-setting-cluster.adoc: -------------------------------------------------------------------------------- 1 | = couchbase-cli-setting-cluster(1) 2 | :description: Modifies cluster settings 3 | ifndef::doctype-manpage[:doctitle: setting-cluster] 4 | 5 | ifdef::doctype-manpage[] 6 | == NAME 7 | 8 | couchbase-cli-setting-cluster - 9 | endif::[] 10 | Modifies cluster settings 11 | 12 | == SYNOPSIS 13 | 14 | [verse] 15 | _couchbase-cli setting-cluster_ [--cluster ] [--username ] [--password ] 16 | [--client-cert ] [--client-cert-password ] [--client-key ] 17 | [--client-key-password ] [--cluster-username ] 18 | [--cluster-password ] [--cluster-port ] 19 | [--cluster-ramsize ] [--cluster-name ] 20 | [--cluster-index-ramsize ] [--cluster-fts-ramsize ] 21 | [--cluster-eventing-ramsize ] 22 | [--cluster-analytics-ramsize ] 23 | 24 | == DESCRIPTION 25 | 26 | This command is used to modify cluster level settings. It allows users to change 27 | the Couchbase root username and password, change the port that the cluster 28 | manager listens on, and modify the data, index, full-text or analytics service 29 | memory quotas. 30 | 31 | == OPTIONS 32 | 33 | include::{partialsdir}/cbcli/part-common-options.adoc[] 34 | 35 | --cluster-username:: 36 | Specifies the new username for the Couchbase administrator user. 37 | 38 | --cluster-password:: 39 | Specifies the new password for the Couchbase administrator user. 40 | 41 | --cluster-ramsize:: 42 | Specifies the data services memory quota. This quota will be assigned to all 43 | future nodes added to the cluster with the data service. 44 | 45 | --cluster-fts-ramsize:: 46 | Sets the full-text service memory quota. This parameter is required if the 47 | full-text service is specified in the --services option. This quota will be 48 | assigned to all future nodes added to the cluster with the full-text 49 | service. 50 | 51 | --cluster-index-ramsize:: 52 | Sets the index service memory quota. This parameter is required if the index 53 | service is specified in the --services option. This quota will be assigned 54 | to all future nodes added to the cluster with the index service. 55 | 56 | --cluster-eventing-ramsize:: 57 | Sets the Eventing service memory quota (in MiB). This parameter is required 58 | if the Eventing service is specified in the --services option. This quota 59 | will be assigned to all future nodes added to the cluster with the eventing 60 | service. 61 | 62 | --cluster-analytics-ramsize:: 63 | Sets the Analytics service memory quota (in MiB). This parameter is required 64 | if the Analytics service is specified in the --services option. This quota 65 | will be assigned to all future nodes added to the cluster with the 66 | Analytics service. 67 | 68 | --cluster-query-ramsize:: 69 | Sets the Query service memory quota (in MiB). This parameter is required 70 | if the Query service is specified in the --services option. This quota 71 | will be assigned to all future nodes added to the cluster with the 72 | Query service. 73 | 74 | --cluster-name:: 75 | Sets the name for this cluster. Naming clusters is useful when you have 76 | multiple Couchbase clusters in your deployment. 77 | 78 | --cluster-port:: 79 | Specifies the port for the Couchbase Administration Console. Defaults to 80 | port 8091. 81 | 82 | include::{partialsdir}/cbcli/part-host-formats.adoc[] 83 | 84 | include::{partialsdir}/cbcli/part-certificate-authentication.adoc[] 85 | 86 | == EXAMPLES 87 | 88 | To change the username and password of the Couchbase administrator user run the 89 | following command. 90 | 91 | $ couchbase-cli setting-cluster -c 192.168.1.5:8091 --username cur_user \ 92 | --password cur_password --cluster-username new_username \ 93 | --cluster-password new_password 94 | 95 | To change the port number that the cluster manager listens on and the cluster 96 | name to "new_name" run the following command. 97 | 98 | $ couchbase-cli setting-cluster -c 192.168.1.5:8091 --username Administrator \ 99 | --password password --cluster-port 5000 --cluster-name new_name 100 | 101 | To change the memory quota of the data server to 2048 and the memory quota of 102 | the index service to 4096 run the following command. 103 | 104 | $ couchbase-cli setting-cluster -c 192.168.1.5:8091 --username Administrator \ 105 | --password password --cluster-ramsize 2048 --cluster-index-ramsize 4096 106 | 107 | All of the parameters in this command can be specified at the same time. To 108 | change the username and password of the Couchbase administrator user, change the 109 | port number to 5000, change the cluster name to "new_name", change the memory 110 | quota of the data service to 2048 and change the memory quota of the index 111 | service to 4096 run the following command. 112 | 113 | $ couchbase-cli setting-cluster -c 192.168.1.5:8091 --username cur_user \ 114 | --password cur_password --cluster-username new_username \ 115 | --cluster-password new_password --cluster-port 5000 \ 116 | --cluster-name new_name --cluster-ramsize 2048 --cluster-index-ramsize 4096 117 | 118 | == ENVIRONMENT AND CONFIGURATION VARIABLES 119 | 120 | include::{partialsdir}/cbcli/part-common-env.adoc[] 121 | 122 | == SEE ALSO 123 | 124 | man:couchbase-cli-cluster-init[1] 125 | 126 | include::{partialsdir}/cbcli/part-footer.adoc[] 127 | -------------------------------------------------------------------------------- /docs/design/cli-3.0-func-spec.md: -------------------------------------------------------------------------------- 1 | Newly added commands for 3.0 features: 2 | ---------------------------------------- 3 | 4 | **- delta recovery (MB-10456)** 5 | 6 | couchbase-cli recovery OPTIONS: 7 | 8 | recovery OPTIONS: 9 | 10 | --server-recovery=HOST[:PORT] server to recover 11 | --recovery-type=TYPE[delta|full] type of recovery to be performed for a node 12 | 13 | Use cases: 14 | 15 | Set recovery type to a server: 16 | 17 | couchbase-cli recovery -c 192.168.0.1:8091 \\ 18 | --server-recovery=192.168.0.2 \\ 19 | --recovery-type=full \\ 20 | -u Administrator -p password 21 | 22 | Set a failover, readd, recovery and rebalance sequence operations 23 | 24 | couchbase-cli failover -c 192.168.0.1:8091 \\ 25 | --server-failover=192.168.0.2 \\ 26 | -u Administrator -p password 27 | 28 | couchbase-cli server-readd -c 192.168.0.1:8091 \\ 29 | --server-add=192.168.0.2 \\ 30 | -u Administrator -p password 31 | 32 | couchbase-cli recovery -c 192.168.0.1:8091 \\ 33 | --server-recovery=192.168.0.2 \\ 34 | --recovery-type=delta \\ 35 | -u Administrator -p password 36 | 37 | couchbase-cli rebalance -c 192.168.0.1:8091 \\ 38 | -u Administrator -p password 39 | 40 | 41 | Newly added options for existed commands 42 | ---------------------------------------- 43 | 44 | **- Tuable memory for bucket (MB-10366)** 45 | couchbase-cli bucket-create/bucket-edit 46 | 47 | OPTIONS: 48 | 49 | --bucket-eviction-policy=[valueOnly|fullEviction] policy how to retain meta in memory 50 | 51 | Use cases: 52 | 53 | Create a new sasl bucket: 54 | 55 | couchbase-cli bucket-create -c 192.168.0.1:8091 \\ 56 | --bucket=test_bucket \\ 57 | --bucket-password=password \\ 58 | --bucket-ramsize=200 \\ 59 | --bucket-eviction-policy=valueOnly \\ 60 | --enable-flush=1 \\ 61 | -u Administrator -p password 62 | 63 | Modify a dedicated port bucket: 64 | 65 | couchbase-cli bucket-edit -c 192.168.0.1:8091 \\ 66 | --bucket=test_bucket \\ 67 | --bucket-port=11222 \\ 68 | --bucket-ramsize=400 \\ 69 | --bucket-eviction-policy=fullEviction \\ 70 | --enable-flush=1 \\ 71 | -u Administrator -p password 72 | 73 | **- Pause/Resume XDCR replication (MB-10056)** 74 | 75 | couchbase-cli xdcr-replicate 76 | 77 | OPTIONS: 78 | 79 | --pause pause the replication 80 | --resume resume the replication 81 | --settings update settings for the replication 82 | --xdcr-replicator=REPLICATOR replication id 83 | --max-concurrent-reps=[32] maximum concurrent replications per bucket, 8 to 256. 84 | --checkpoint-interval=[1800] intervals between checkpoints, 60 to 14400 seconds. 85 | --worker-batch-size=[500] doc batch size, 500 to 10000. 86 | --doc-batch-size=[2048]KB document batching size, 10 to 100000 KB 87 | --failure-restart-interval=[30] interval for restarting failed xdcr, 1 to 300 seconds 88 | --optimistic-replication-threshold=[256] document body size threshold (bytes) to trigger optimistic replication 89 | 90 | Use cases: 91 | 92 | Pause a running replication stream 93 | 94 | couchbase-cli xdcr-replicate -c 192.168.0.1:8091 \\ 95 | --pause \\ 96 | --xdcr-replicator=f4eb540d74c43fd3ac6d4b7910c8c92f/default/default \\ 97 | -u Administrator -p password 98 | 99 | Resume a paused replication stream 100 | 101 | couchbase-cli xdcr-replicate -c 192.168.0.1:8091 \\ 102 | --resume \\ 103 | --xdcr-replicator=f4eb540d74c43fd3ac6d4b7910c8c92f/default/default \\ 104 | -u Administrator -p password 105 | 106 | Update settings for a replication stream 107 | 108 | couchbase-cli xdcr-replicate -c 192.168.0.1:8091 \\ 109 | --settings \\ 110 | --xdcr-replicator=f4eb540d74c43fd3ac6d4b7910c8c92f/default/default \\ 111 | --max-concurrent-reps=32 \\ 112 | --checkpoint-interval=1800 \\ 113 | --worker-batch-size=500 \\ 114 | --doc-batch-size=2048 \\ 115 | --failure-restart-interval=30 \\ 116 | --optimistic-replication-threshold=256 \\ 117 | -u Administrator -p password 118 | 119 | **- support graceful failover (CBD-1283)** 120 | 121 | couchbase-cli failover 122 | 123 | OPTIONS: 124 | 125 | --force failover node from cluster right away. Without specified, it will be graceful failover 126 | 127 | 128 | **- bucket priority (MB-10369)** 129 | 130 | couchbase-cli bucket-create/bucket-edit 131 | 132 | OPTIONS: 133 | 134 | --bucket-priority=[low|high] priority when compared to other buckets 135 | 136 | Use cases: 137 | 138 | Create a new couchbase bucket with high priority: 139 | 140 | couchbase-cli bucket-create -c 192.168.0.1:8091 \\ 141 | --bucket=test_bucket \\ 142 | --bucket-type=couchbase \\ 143 | --bucket-port=11222 \\ 144 | --bucket-ramsize=200 \\ 145 | --bucket-replica=1 \\ 146 | --bucket-priority=high \\ 147 | -u Administrator -p password 148 | 149 | Modify a bucket to low priority: 150 | 151 | couchbase-cli bucket-edit -c 192.168.0.1:8091 \\ 152 | --bucket=test_bucket \\ 153 | --bucket-priority=low \\ 154 | -u Administrator -p password 155 | --------------------------------------------------------------------------------