├── 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 | 2EW1zLGPhRfWDvMFOO5A91fI1Qoa7CvNz83bb1uXWjlHncniuFI7O7Y/EoMyi/T4
18 | ZjpTSVKy2hDTpfeUHNyf8DbaX9CD6zeDIStlqoF+oRYxBN/e/PzohUOkabug2mXO
19 | ZA98BlQpWjl9y4QICKbyqF0CAwEAAaNTMFEwHQYDVR0OBBYEFDNInEdkvMN1Gp1F
20 | /0j4M13bsAhTMB8GA1UdIwQYMBaAFDNInEdkvMN1Gp1F/0j4M13bsAhTMA8GA1Ud
21 | EwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggIBAF03h7aptXfsGKcFiv+DC5Ra
22 | C7efzTUu3IrQbxTtS6EyefXlrCRbsgaCUAfwUVJ4yOYqlWavnnisEoYXMuJbSXys
23 | seN07P2EJfDrMEgtVYnBPwPnIOSWZ9w3qT3wuQIQruIXaeNqNJWv7/LQAe/fHiLC
24 | bZBDmFPV+e2LVNFykTmW2UjUxgkrCXu5SFC6FtY7Oye5xclraSItt8wsYhrkAhg5
25 | h2PpwcW3rQE+07B1PP3YFnsmqCFTF9zeSVZ0oxrvgbpZuF5rjPQvzKczjytxs9aL
26 | lNLCZ8+aE7f/OmwlFpcqLKO4tlISn9Z1yRz5GnFS9L+EHjf/2h/sTPrvI7xO4ZuS
27 | n3QsPUHcSfOq4vWrcnpnRCMmqkQ6/j3DqZly48AU5ofmJ24sF+mnzalsI6hRl8MK
28 | Q1KhsuW1vY5VGIP6ZM98v4DKQBh60SEWgWSoW1sJCTv6f5J7AuHM4Wj8sVN75JlQ
29 | Jb7tEhtPRZusYCFhiM4EanNIFdmsVx8cGOuJfMpIpDNZ5xpSjzCHMGCIlUMbsrpI
30 | 4dWS5OykQNw1jhqzwkChirmxf4ixB0KeL7d/wWhDyzq9ilz7AhFXLbs7eB5onp2D
31 | iW5/+AZyyJzvEMvhpP2vNkKmb+dT4F3wgqh5OC80wZg3BbW2ZLL38PmrfVh8MWwD
32 | wJp5yWBQknQBu2wKrMIU
33 | -----END CERTIFICATE-----
34 |
--------------------------------------------------------------------------------
/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/liWu0FMkrFJnnb6ELjpmusOAPughKHaCG1ajpITsQOktpJD
17 | 2EW1zLGPhRfWDvMFOO5A91fI1Qoa7CvNz83bb1uXWjlHncniuFI7O7Y/EoMyi/T4
18 | ZjpTSVKy2hDTpfeUHNyf8DbaX9CD6zeDIStlqoF+oRYxBN/e/PzohUOkabug2mXO
19 | ZA98BlQpWjl9y4QICKbyqF0CAwEAAaNTMFEwHQYDVR0OBBYEFDNInEdkvMN1Gp1F
20 | /0j4M13bsAhTMB8GA1UdIwQYMBaAFDNInEdkvMN1Gp1F/0j4M13bsAhTMA8GA1Ud
21 | EwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggIBAF03h7aptXfsGKcFiv+DC5Ra
22 | C7efzTUu3IrQbxTtS6EyefXlrCRbsgaCUAfwUVJ4yOYqlWavnnisEoYXMuJbSXys
23 | seN07P2EJfDrMEgtVYnBPwPnIOSWZ9w3qT3wuQIQruIXaeNqNJWv7/LQAe/fHiLC
24 | bZBDmFPV+e2LVNFykTmW2UjUxgkrCXu5SFC6FtY7Oye5xclraSItt8wsYhrkAhg5
25 | h2PpwcW3rQE+07B1PP3YFnsmqCFTF9zeSVZ0oxrvgbpZuF5rjPQvzKczjytxs9aL
26 | lNLCZ8+aE7f/OmwlFpcqLKO4tlISn9Z1yRz5GnFS9L+EHjf/2h/sTPrvI7xO4ZuS
27 | n3QsPUHcSfOq4vWrcnpnRCMmqkQ6/j3DqZly48AU5ofmJ24sF+mnzalsI6hRl8MK
28 | Q1KhsuW1vY5VGIP6ZM98v4DKQBh60SEWgWSoW1sJCTv6f5J7AuHM4Wj8sVN75JlQ
29 | Jb7tEhtPRZusYCFhiM4EanNIFdmsVx8cGOuJfMpIpDNZ5xpSjzCHMGCIlUMbsrpI
30 | 4dWS5OykQNw1jhqzwkChirmxf4ixB0KeL7d/wWhDyzq9ilz7AhFXLbs7eB5onp2D
31 | iW5/+AZyyJzvEMvhpP2vNkKmb+dT4F3wgqh5OC80wZg3BbW2ZLL38PmrfVh8MWwD
32 | wJp5yWBQknQBu2wKrMIU
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