diff --git a/source/about.txt b/source/about.txt index 5534d3c6bc4..d24466a5961 100644 --- a/source/about.txt +++ b/source/about.txt @@ -76,7 +76,7 @@ complete the You can clone the repository by issuing the following command at your system shell: -.. code-block:: sh +.. code-block:: bash git clone git://github.com/mongodb/docs.git diff --git a/source/administration/configuration.txt b/source/administration/configuration.txt index 10dc78a3b9f..de45f8b42c4 100644 --- a/source/administration/configuration.txt +++ b/source/administration/configuration.txt @@ -33,20 +33,20 @@ provided. This initialization script can be used to start the - On Linux systems that use the **systemd** init system (the ``systemctl`` command): - .. code-block:: sh + .. code-block:: bash sudo systemctl start mongod - On Linux systems that use the **SystemV init** init system (the ``service`` command): - .. code-block:: sh + .. code-block:: bash sudo service mongod start - On macOS, using the ``brew`` package manger: - .. code-block:: sh + .. code-block:: bash brew services start mongodb-community@{+version+} @@ -58,7 +58,7 @@ a MongoDB instance with this configuration file by using either the :option:`--config ` or :option:`-f ` options to :binary:`~bin.mongod`. For example, on Linux: -.. code-block:: sh +.. code-block:: bash mongod --config /etc/mongod.conf mongod -f /etc/mongod.conf diff --git a/source/administration/production-notes.txt b/source/administration/production-notes.txt index 1cb1c887d35..cd2c4729248 100644 --- a/source/administration/production-notes.txt +++ b/source/administration/production-notes.txt @@ -359,11 +359,11 @@ NUMA for use with MongoDB. #. Disable *zone reclaim* with one of the following commands: - .. code-block:: sh + .. code-block:: bash echo 0 | sudo tee /proc/sys/vm/zone_reclaim_mode - .. code-block:: sh + .. code-block:: bash sudo sysctl -w vm.zone_reclaim_mode=0 @@ -372,7 +372,7 @@ NUMA for use with MongoDB. platform's init system. Run the following command to determine which init system is in use on your platform: - .. code-block:: sh + .. code-block:: bash ps --no-headers -o comm 1 @@ -405,14 +405,14 @@ NUMA for use with MongoDB. #. Copy the default MongoDB service file: - .. code-block:: sh + .. code-block:: bash sudo cp /lib/systemd/system/mongod.service /etc/systemd/system/ #. Edit the ``/etc/systemd/system/mongod.service`` file, and update the ``ExecStart`` statement to begin with: - .. code-block:: sh + .. code-block:: bash /usr/bin/numactl --interleave=all @@ -420,27 +420,27 @@ NUMA for use with MongoDB. If your existing ``ExecStart`` statement reads: - .. code-block:: sh + .. code-block:: bash :copyable: false ExecStart=/usr/bin/mongod --config /etc/mongod.conf Update that statement to read: - .. code-block:: sh + .. code-block:: bash :copyable: false ExecStart=/usr/bin/numactl --interleave=all /usr/bin/mongod --config /etc/mongod.conf #. Apply the change to ``systemd``: - .. code-block:: sh + .. code-block:: bash sudo systemctl daemon-reload #. Restart any running ``mongod`` instances: - .. code-block:: sh + .. code-block:: bash sudo systemctl stop mongod sudo systemctl start mongod @@ -464,7 +464,7 @@ NUMA for use with MongoDB. #. Configure each of your custom init scripts to start each MongoDB instance via ``numactl``: - .. code-block:: sh + .. code-block:: bash numactl --interleave=all @@ -474,7 +474,7 @@ NUMA for use with MongoDB. .. example:: - .. code-block:: sh + .. code-block:: bash :copyable: false numactl --interleave=all /usr/local/bin/mongod -f /etc/mongod.conf @@ -702,14 +702,14 @@ example: - On :abbr:`RHEL (Red Hat Enterprise Linux)` / CentOS, the following command updates the system-provided GNU C Library: - .. code-block:: sh + .. code-block:: bash sudo yum update glibc - On Ubuntu / Debian, the following command updates the system-provided GNU C Library: - .. code-block:: sh + .. code-block:: bash sudo apt-get install libc6 @@ -762,7 +762,7 @@ minimum. As such you should set ``vm.swappiness`` to either ``1`` or - To check the current swappiness setting on your system, run: - .. code-block:: sh + .. code-block:: bash cat /proc/sys/vm/swappiness @@ -770,13 +770,13 @@ minimum. As such you should set ``vm.swappiness`` to either ``1`` or #. Edit the ``/etc/sysctl.conf`` file and add the following line: - .. code-block:: sh + .. code-block:: bash vm.swappiness = 1 #. Run the following command to apply the setting: - .. code-block:: sh + .. code-block:: bash sudo sysctl -p @@ -865,7 +865,7 @@ Typically these messages do not require intervention; however, you can use the following operations to determine the symbol versions that :binary:`~bin.mongod` expects: -.. code-block:: sh +.. code-block:: bash objdump -T /mongod | grep " SSL_" objdump -T /mongod | grep " CRYPTO_" @@ -882,7 +882,7 @@ The last two strings in this output are the symbol version and symbol name. Compare these values with the values returned by the following operations to detect symbol version mismatches: -.. code-block:: sh +.. code-block:: bash objdump -T /libssl.so.1* objdump -T /libcrypto.so.1* diff --git a/source/appendix/security/appendixA-openssl-ca.txt b/source/appendix/security/appendixA-openssl-ca.txt index 39c65687d35..eafce6a1208 100644 --- a/source/appendix/security/appendixA-openssl-ca.txt +++ b/source/appendix/security/appendixA-openssl-ca.txt @@ -105,7 +105,7 @@ B. Generate the Test CA PEM File #. Create the :red:`test` CA key file :file:`mongodb-test-ca.key`. - .. code-block:: sh + .. code-block:: bash openssl genrsa -out mongodb-test-ca.key 4096 @@ -120,13 +120,13 @@ B. Generate the Test CA PEM File generated key file. When asked for Distinguished Name values, enter the appropriate values for your :red:`test` CA certificate. - .. code-block:: sh + .. code-block:: bash openssl req -new -x509 -days 1826 -key mongodb-test-ca.key -out mongodb-test-ca.crt -config openssl-test-ca.cnf #. Create the private key for the intermediate certificate. - .. code-block:: sh + .. code-block:: bash openssl genrsa -out mongodb-test-ia.key 4096 @@ -141,20 +141,20 @@ B. Generate the Test CA PEM File certificate. When asked for Distinguished Name values, enter the appropriate values for your :red:`test` Intermediate Authority certificate. - .. code-block:: sh + .. code-block:: bash openssl req -new -key mongodb-test-ia.key -out mongodb-test-ia.csr -config openssl-test-ca.cnf #. Create the intermediate certificate :file:`mongodb-test-ia.crt`. - .. code-block:: sh + .. code-block:: bash openssl x509 -sha256 -req -days 730 -in mongodb-test-ia.csr -CA mongodb-test-ca.crt -CAkey mongodb-test-ca.key -set_serial 01 -out mongodb-test-ia.crt -extfile openssl-test-ca.cnf -extensions v3_ca #. Create the :red:`test` CA PEM file from the :red:`test` CA certificate :file:`mongod-test-ca.crt` and :red:`test` intermediate certificate :file:`mongodb-test-ia.crt`. - .. code-block:: sh + .. code-block:: bash cat mongodb-test-ca.crt mongodb-test-ia.crt > test-ca.pem diff --git a/source/appendix/security/appendixB-openssl-server.txt b/source/appendix/security/appendixB-openssl-server.txt index d87bbbabc92..cdf8eb3c1d3 100644 --- a/source/appendix/security/appendixB-openssl-server.txt +++ b/source/appendix/security/appendixB-openssl-server.txt @@ -134,7 +134,7 @@ B. Generate the Test PEM File for Server #. Create the :red:`test` key file :file:`mongodb-test-server1.key`. - .. code-block:: sh + .. code-block:: bash openssl genrsa -out mongodb-test-server1.key 4096 @@ -152,19 +152,19 @@ B. Generate the Test PEM File for Server exactly across the member certificates: Organization (``O``), Organizational Unit (``OU``), the Domain Component (``DC``). - .. code-block:: sh + .. code-block:: bash openssl req -new -key mongodb-test-server1.key -out mongodb-test-server1.csr -config openssl-test-server.cnf #. Create the :red:`test` server certificate :file:`mongodb-test-server1.crt`. - .. code-block:: sh + .. code-block:: bash openssl x509 -sha256 -req -days 365 -in mongodb-test-server1.csr -CA mongodb-test-ia.crt -CAkey mongodb-test-ia.key -CAcreateserial -out mongodb-test-server1.crt -extfile openssl-test-server.cnf -extensions v3_req #. Create the :red:`test` PEM file for the server. - .. code-block:: sh + .. code-block:: bash cat mongodb-test-server1.crt mongodb-test-server1.key > test-server1.pem @@ -194,7 +194,7 @@ B. Generate the Test PEM File for Server certificates, create a pkcs-12 file to add to Keychain Access instead of a PEM file: - .. code-block:: sh + .. code-block:: bash openssl pkcs12 -export -out test-server1.pfx -inkey mongodb-test-server1.key -in mongodb-test-server1.crt -certfile mongodb-test-ia.crt diff --git a/source/appendix/security/appendixC-openssl-client.txt b/source/appendix/security/appendixC-openssl-client.txt index eaaa48df098..ea286e633c1 100644 --- a/source/appendix/security/appendixC-openssl-client.txt +++ b/source/appendix/security/appendixC-openssl-client.txt @@ -101,7 +101,7 @@ B. Generate the Test PEM File for Client #. Create the :red:`test` key file :file:`mongodb-test-client.key`. - .. code-block:: sh + .. code-block:: bash openssl genrsa -out mongodb-test-client.key 4096 @@ -116,19 +116,19 @@ B. Generate the Test PEM File for Client Organization (O), the Organizational Unit (OU) or the Domain Component (DC). - .. code-block:: sh + .. code-block:: bash openssl req -new -key mongodb-test-client.key -out mongodb-test-client.csr -config openssl-test-client.cnf #. Create the :red:`test` client certificate :file:`mongodb-test-client.crt`. - .. code-block:: sh + .. code-block:: bash openssl x509 -sha256 -req -days 365 -in mongodb-test-client.csr -CA mongodb-test-ia.crt -CAkey mongodb-test-ia.key -CAcreateserial -out mongodb-test-client.crt -extfile openssl-test-client.cnf -extensions v3_req #. Create the :red:`test` PEM file for the client. - .. code-block:: sh + .. code-block:: bash cat mongodb-test-client.crt mongodb-test-client.key > test-client.pem @@ -158,7 +158,7 @@ B. Generate the Test PEM File for Client create a PKCS 12 file to add to Keychain Access instead of a PEM file: - .. code-block:: sh + .. code-block:: bash openssl pkcs12 -export -out test-client.pfx -inkey mongodb-test-client.key -in mongodb-test-client.crt -certfile mongodb-test-ia.crt diff --git a/source/core/index-creation.txt b/source/core/index-creation.txt index 2306ea65440..67e8d857342 100644 --- a/source/core/index-creation.txt +++ b/source/core/index-creation.txt @@ -366,7 +366,7 @@ While an index is being built, progress is written to the :doc:`MongoDB log`. If an index build is stopped and resumed there will be log messages with fields like these: -.. code-block:: sh +.. code-block:: bash :copyable: false "msg":"Index build: wrote resumable state to disk", diff --git a/source/core/inmemory.txt b/source/core/inmemory.txt index d5430b59ca5..187edc958b4 100644 --- a/source/core/inmemory.txt +++ b/source/core/inmemory.txt @@ -41,7 +41,7 @@ To select the in-memory storage engine, specify: For example, from the command line: -.. code-block:: sh +.. code-block:: bash mongod --storageEngine inMemory --dbpath @@ -88,7 +88,7 @@ the :doc:`YAML configuration file `. If a write operation would cause the data to exceed the specified memory size, MongoDB returns with the error: -.. code-block:: sh +.. code-block:: bash "WT_CACHE_FULL: operation would overflow cache" @@ -108,7 +108,7 @@ To specify a new size, use the Or use the command-line option :option:`--inMemorySizeGB `: -.. code-block:: sh +.. code-block:: bash mongod --storageEngine inMemory --dbpath --inMemorySizeGB diff --git a/source/core/replica-set-rollbacks.txt b/source/core/replica-set-rollbacks.txt index e1423df63dc..434e78998eb 100644 --- a/source/core/replica-set-rollbacks.txt +++ b/source/core/replica-set-rollbacks.txt @@ -89,7 +89,7 @@ By default, when a rollback occurs, MongoDB writes the rollback data to ``/var/log/mongodb/mongod.log``, you can use ``grep`` to search for instances of ``"rollback file"`` in the log: - .. code-block:: sh + .. code-block:: bash grep "rollback file" /var/log/mongodb/mongod.log diff --git a/source/core/retryable-writes.txt b/source/core/retryable-writes.txt index c59098b5d84..9b6d181a9bd 100644 --- a/source/core/retryable-writes.txt +++ b/source/core/retryable-writes.txt @@ -77,7 +77,7 @@ MongoDB Drivers To enable retryable writes in the :binary:`~bin.mongo` shell, use the :option:`--retryWrites ` command line option: - .. code-block:: sh + .. code-block:: bash mongo --retryWrites diff --git a/source/core/schema-validation.txt b/source/core/schema-validation.txt index 1c80072adbe..07962b54c0f 100644 --- a/source/core/schema-validation.txt +++ b/source/core/schema-validation.txt @@ -125,7 +125,7 @@ validation with :ref:`other query operators For example, the following example specifies validator rules using the query expression: -.. code-block:: sh +.. code-block:: bash db.createCollection( "contacts", { validator: { $or: @@ -176,7 +176,7 @@ documents: Issue the following command to add a validator to the ``contacts`` collection: -.. code-block:: sh +.. code-block:: bash db.runCommand( { collMod: "contacts", @@ -346,7 +346,7 @@ Depending on collection usage, this command might return a lot of data. The validation error (one long line in the log, reformatted here for readability) contains information like this: -.. code-block:: sh +.. code-block:: bash :copyable: false "{\"t\":{\"$date\":\"2021-01-20T15:59:57.305+00:00\"}, diff --git a/source/core/security-internal-authentication.txt b/source/core/security-internal-authentication.txt index 633daadc699..2066e0c73d7 100644 --- a/source/core/security-internal-authentication.txt +++ b/source/core/security-internal-authentication.txt @@ -48,7 +48,7 @@ characters (e.g. ``x0d``, ``x09``, and ``x20``) for cross-platform convenience. As a result, the following operations produce identical keys: -.. code-block:: sh +.. code-block:: bash echo -e "mysecretkey" > key1 diff --git a/source/core/security-transport-encryption.txt b/source/core/security-transport-encryption.txt index f1c5accf38b..d54b2963b08 100644 --- a/source/core/security-transport-encryption.txt +++ b/source/core/security-transport-encryption.txt @@ -177,7 +177,7 @@ Alternatively, you can disable ECDHE cipher suites with the :parameter:`opensslCipherConfig` parameter as in the following example (which also disables DHE) -.. code-block:: sh +.. code-block:: bash mongod --setParameter opensslCipherConfig='HIGH:!EXPORT:!aNULL:!kECDHE:!ECDHE:!DHE:!kDHE@STRENGTH' @@ -185,7 +185,7 @@ If you need to disable support for DHE cipher suites due to performance, you can use the :parameter:`opensslCipherConfig` parameter, as in the following example: -.. code-block:: sh +.. code-block:: bash mongod --setParameter opensslCipherConfig='HIGH:!EXPORT:!aNULL:!DHE:!kDHE@STRENGTH' diff --git a/source/core/shell-types.txt b/source/core/shell-types.txt index 573fa044e42..a650e6a040e 100644 --- a/source/core/shell-types.txt +++ b/source/core/shell-types.txt @@ -165,7 +165,7 @@ Retrieve the document to verify: In the returned document, the ``calc`` field contains a ``NumberLong`` object: -.. code-block:: sh +.. code-block:: bash { "_id" : 10, "calc" : NumberLong("2555555000005") } @@ -190,7 +190,7 @@ to a floating point value, as in the following example: In the updated document, the ``calc`` field contains a floating point value: - .. code-block:: sh + .. code-block:: bash { "_id" : 10, "calc" : 2555555000010 } diff --git a/source/faq/diagnostics.txt b/source/faq/diagnostics.txt index 523f9744c90..040b2ffb8b4 100644 --- a/source/faq/diagnostics.txt +++ b/source/faq/diagnostics.txt @@ -28,7 +28,7 @@ message, then check your system logs for messages pertaining to MongoDB. For example, for logs located in ``/var/log/messages``, use the following commands: -.. code-block:: sh +.. code-block:: bash sudo grep mongod /var/log/messages sudo grep score /var/log/messages diff --git a/source/faq/sharding.txt b/source/faq/sharding.txt index 495cab1b5a3..cfef5a78a02 100644 --- a/source/faq/sharding.txt +++ b/source/faq/sharding.txt @@ -123,7 +123,7 @@ connection pools used by the :binary:`~bin.mongos`, connect a :binary:`~bin.mongo` shell to the :binary:`~bin.mongos` with , and run the :dbcommand:`connPoolStats` command: -.. code-block:: sh +.. code-block:: bash db.adminCommand("connPoolStats"); diff --git a/source/includes/extracts-4.0-upgrade-prereq.yaml b/source/includes/extracts-4.0-upgrade-prereq.yaml index 0f34da395c4..5d8864531eb 100644 --- a/source/includes/extracts-4.0-upgrade-prereq.yaml +++ b/source/includes/extracts-4.0-upgrade-prereq.yaml @@ -27,7 +27,7 @@ content: | To upgrade to ``pv1``, connect a :binary:`~bin.mongo` shell to the replica set primary and perform the following sequence of operations: - .. code-block:: sh + .. code-block:: bash cfg = rs.conf(); cfg.protocolVersion=1; diff --git a/source/includes/extracts-4.2-changes.yaml b/source/includes/extracts-4.2-changes.yaml index cbb10516f50..5abc17e62b7 100644 --- a/source/includes/extracts-4.2-changes.yaml +++ b/source/includes/extracts-4.2-changes.yaml @@ -684,7 +684,7 @@ content: | `, including enclosing the field names and the operators in quotes, as in the following: - .. code-block:: sh + .. code-block:: bash mongoexport -d=test -c=records -q='{ "a": { "$gte": 3 }, "date": { "$lt": { "$date": "2016-01-01T00:00:00.000Z" } } }' --out=exportdir/myRecords.json @@ -692,7 +692,7 @@ content: | format ` and the field names and the operators do not need to be in quotes: - .. code-block:: sh + .. code-block:: bash mongoexport -d=test -c=records -q='{ a: { $gte: 3 }, date: { $lt: { "$date": "2016-01-01T00:00:00.000Z" } } }' --out=exportdir/myRecords.json diff --git a/source/includes/extracts-clone-copy-db-examples.yaml b/source/includes/extracts-clone-copy-db-examples.yaml index 6b46abf9fbf..f4a3fbf13b2 100644 --- a/source/includes/extracts-clone-copy-db-examples.yaml +++ b/source/includes/extracts-clone-copy-db-examples.yaml @@ -7,7 +7,7 @@ content: | #. Use :binary:`~bin.mongodump` to dump the ``test`` database to an archive ``mongodump-test-db``: - .. code-block:: sh + .. code-block:: bash mongodump --archive="mongodump-test-db" --db=test @@ -15,7 +15,7 @@ content: | ` and :option:`--nsTo ` to restore (with database name change) from the archive: - .. code-block:: sh + .. code-block:: bash mongorestore --archive="mongodump-test-db" --nsFrom='test.*' --nsTo='examples.*' @@ -29,7 +29,7 @@ content: | :binary:`~bin.mongodump` the ``test`` database to the standard output stream and pipe into :binary:`~bin.mongorestore`: - .. code-block:: sh + .. code-block:: bash mongodump --archive --db=test | mongorestore --archive --nsFrom='test.*' --nsTo='examples.*' ... \ No newline at end of file diff --git a/source/includes/extracts-install-mongodb-manually.yaml b/source/includes/extracts-install-mongodb-manually.yaml index adfead11edc..a01d2b92820 100644 --- a/source/includes/extracts-install-mongodb-manually.yaml +++ b/source/includes/extracts-install-mongodb-manually.yaml @@ -1,24 +1,24 @@ ref: install-mongodb-enterprise-manually-suse-15 content: | - .. code-block:: sh + .. code-block:: bash sudo zypper install cyrus-sasl cyrus-sasl-plain cyrus-sasl-gssapi krb5 libcurl4 libldap-2_4-2 libopenssl1_1 libsensors4 libsnmp30 libwrap0 --- ref: install-mongodb-enterprise-manually-suse-12 content: | - .. code-block:: sh + .. code-block:: bash sudo zypper install cyrus-sasl cyrus-sasl-plain cyrus-sasl-gssapi krb5 libcurl4 libldap-2_4-2 libopenssl1_0_0 libsensors4 libsnmp30 libwrap0 liblzma5 --- ref: install-mongodb-community-manually-suse-15 content: | - .. code-block:: sh + .. code-block:: bash sudo zypper install libcurl4 libopenssl1_1 --- ref: install-mongodb-community-manually-suse-12 content: | - .. code-block:: sh + .. code-block:: bash sudo zypper install libcurl4 libopenssl1_0_0 liblzma5 --- @@ -26,25 +26,25 @@ content: | ref: install-mongodb-enterprise-manually-debian-10 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl4 libgssapi-krb5-2 libldap-2.4-2 libwrap0 libsasl2-2 libsasl2-modules libsasl2-modules-gssapi-mit snmp openssl liblzma5 --- ref: install-mongodb-enterprise-manually-debian-9 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl3 libgssapi-krb5-2 libldap-2.4-2 libwrap0 libsasl2-2 libsasl2-modules libsasl2-modules-gssapi-mit snmp openssl liblzma5 --- ref: install-mongodb-community-manually-debian-10 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl4 openssl liblzma5 --- ref: install-mongodb-community-manually-debian-9 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl3 openssl liblzma5 --- @@ -52,37 +52,37 @@ content: | ref: install-mongodb-enterprise-manually-ubuntu-20 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl4 libgssapi-krb5-2 libldap-2.4-2 libwrap0 libsasl2-2 libsasl2-modules libsasl2-modules-gssapi-mit snmp openssl liblzma5 --- ref: install-mongodb-enterprise-manually-ubuntu-18 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl4 libgssapi-krb5-2 libldap-2.4-2 libwrap0 libsasl2-2 libsasl2-modules libsasl2-modules-gssapi-mit snmp openssl liblzma5 --- ref: install-mongodb-enterprise-manually-ubuntu-16 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl3 libgssapi-krb5-2 libldap-2.4-2 libwrap0 libsasl2-2 libsasl2-modules libsasl2-modules-gssapi-mit snmp openssl liblzma5 --- ref: install-mongodb-community-manually-ubuntu-20 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl4 openssl liblzma5 --- ref: install-mongodb-community-manually-ubuntu-18 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl4 openssl liblzma5 --- ref: install-mongodb-community-manually-ubuntu-16 content: | - .. code-block:: sh + .. code-block:: bash sudo apt-get install libcurl3 openssl liblzma5 --- @@ -90,25 +90,25 @@ content: | ref: install-mongodb-enterprise-manually-redhat-8 content: | - .. code-block:: sh + .. code-block:: bash sudo yum install cyrus-sasl cyrus-sasl-gssapi cyrus-sasl-plain krb5-libs libcurl net-snmp openldap openssl xz-libs --- ref: install-mongodb-enterprise-manually-redhat-7 content: | - .. code-block:: sh + .. code-block:: bash sudo yum install cyrus-sasl cyrus-sasl-gssapi cyrus-sasl-plain krb5-libs libcurl net-snmp openldap openssl xz-libs --- ref: install-mongodb-enterprise-manually-redhat-6 content: | - .. code-block:: sh + .. code-block:: bash sudo yum install cyrus-sasl cyrus-sasl-gssapi cyrus-sasl-plain krb5-libs libcurl net-snmp openldap openssl xz-libs --- ref: install-mongodb-community-manually-redhat content: | - .. code-block:: sh + .. code-block:: bash sudo yum install libcurl openssl xz-libs ... diff --git a/source/includes/extracts-x509-certificate.yaml b/source/includes/extracts-x509-certificate.yaml index dedb124b7da..81736beabd9 100644 --- a/source/includes/extracts-x509-certificate.yaml +++ b/source/includes/extracts-x509-certificate.yaml @@ -100,7 +100,7 @@ content: | For example, the certificates for a cluster could have the following subjects: - .. code-block:: sh + .. code-block:: bash subject= CN=,OU=Dept1,O=MongoDB,ST=NY,C=US subject= CN=,OU=Dept1,O=MongoDB,ST=NY,C=US diff --git a/source/includes/fact-confirm-enterprise-binaries.rst b/source/includes/fact-confirm-enterprise-binaries.rst index 9be4e9be15f..7aa2db91a44 100644 --- a/source/includes/fact-confirm-enterprise-binaries.rst +++ b/source/includes/fact-confirm-enterprise-binaries.rst @@ -1,7 +1,7 @@ To verify that you are using MongoDB Enterprise, pass the ``--version`` command line option to the :binary:`~bin.mongod` or :binary:`~bin.mongos`: -.. code-block:: sh +.. code-block:: bash mongod --version diff --git a/source/includes/fact-selinux-redhat-options.rst b/source/includes/fact-selinux-redhat-options.rst index eef954e9386..5642952170a 100644 --- a/source/includes/fact-selinux-redhat-options.rst +++ b/source/includes/fact-selinux-redhat-options.rst @@ -14,13 +14,13 @@ to your SELinux policy: #. Ensure your system has the ``checkpolicy`` package installed: - .. code-block:: sh + .. code-block:: bash sudo yum install checkpolicy #. Create a custom policy file :file:`mongodb_cgroup_memory.te`: - .. code-block:: sh + .. code-block:: bash cat > mongodb_cgroup_memory.te < mongodb_proc_net.te < @@ -129,7 +129,7 @@ Using a Custom MongoDB Directory Path #. Update the SELinux user policy for the new directory: - .. code-block:: sh + .. code-block:: bash sudo chcon -Rv -u system_u -t @@ -143,7 +143,7 @@ Using a Custom MongoDB Directory Path #. Apply the updated SELinux policies to the directory: - .. code-block:: sh + .. code-block:: bash restorecon -R -v @@ -156,7 +156,7 @@ For example: - If using a non-default MongoDB data path of ``/mongodb/data``: - .. code-block:: sh + .. code-block:: bash sudo semanage fcontext -a -t mongod_var_lib_t '/mongodb/data.*' sudo chcon -Rv -u system_u -t mongod_var_lib_t '/mongodb/data' @@ -165,7 +165,7 @@ For example: - If using a non-default MongoDB log directory of ``/mongodb/log`` (e.g. if the log file path is ``/mongodb/log/mongod.log``): - .. code-block:: sh + .. code-block:: bash sudo semanage fcontext -a -t mongod_log_t '/mongodb/log.*' sudo chcon -Rv -u system_u -t mongod_log_t '/mongodb/log' @@ -175,6 +175,6 @@ For example: Using a Custom MongoDB Port +++++++++++++++++++++++++++ -.. code-block:: sh +.. code-block:: bash sudo semanage port -a -t mongod_port_t -p tcp diff --git a/source/includes/fact-systemd-vs-initd.rst b/source/includes/fact-systemd-vs-initd.rst index 2a07cea3501..0bac5fb8e25 100644 --- a/source/includes/fact-systemd-vs-initd.rst +++ b/source/includes/fact-systemd-vs-initd.rst @@ -7,7 +7,7 @@ the ``service`` command). If you are unsure which init system your platform uses, run the following command: -.. code-block:: sh +.. code-block:: bash ps --no-headers -o comm 1 diff --git a/source/includes/fact-tcp-keepalive-linux.rst b/source/includes/fact-tcp-keepalive-linux.rst index 7e4261303c5..55478ce6ad3 100644 --- a/source/includes/fact-tcp-keepalive-linux.rst +++ b/source/includes/fact-tcp-keepalive-linux.rst @@ -1,13 +1,13 @@ - To view the keepalive setting on Linux, use one of the following commands: - .. code-block:: sh + .. code-block:: bash sysctl net.ipv4.tcp_keepalive_time Or: - .. code-block:: sh + .. code-block:: bash cat /proc/sys/net/ipv4/tcp_keepalive_time @@ -21,13 +21,13 @@ - To change the ``tcp_keepalive_time`` value, you can use one of the following commands, supplying a ** in seconds: - .. code-block:: sh + .. code-block:: bash sudo sysctl -w net.ipv4.tcp_keepalive_time= Or: - .. code-block:: sh + .. code-block:: bash echo | sudo tee /proc/sys/net/ipv4/tcp_keepalive_time @@ -35,7 +35,7 @@ the setting, add the following line to ``/etc/sysctl.conf``, supplying a ** in seconds, and reboot the machine: - .. code-block:: sh + .. code-block:: bash net.ipv4.tcp_keepalive_time = diff --git a/source/includes/fact-tcp-keepalive-osx.rst b/source/includes/fact-tcp-keepalive-osx.rst index c8fdd71755c..a655fd0ff06 100644 --- a/source/includes/fact-tcp-keepalive-osx.rst +++ b/source/includes/fact-tcp-keepalive-osx.rst @@ -1,6 +1,6 @@ - To view the keepalive setting on macOS, issue the following command: - .. code-block:: sh + .. code-block:: bash sysctl net.inet.tcp.keepidle @@ -11,7 +11,7 @@ - To change the ``net.inet.tcp.keepidle`` value, you can use the following command, supplying a ** in milliseconds: - .. code-block:: sh + .. code-block:: bash sudo sysctl net.inet.tcp.keepidle= diff --git a/source/includes/steps-3.2-downgrade-sharded-cluster-sccc.yaml b/source/includes/steps-3.2-downgrade-sharded-cluster-sccc.yaml index d672b76c358..a69cdf30433 100644 --- a/source/includes/steps-3.2-downgrade-sharded-cluster-sccc.yaml +++ b/source/includes/steps-3.2-downgrade-sharded-cluster-sccc.yaml @@ -32,7 +32,7 @@ content: | :binary:`~bin.mongos`. For example, if :binary:`~bin.mongos` has the following :option:`--configdb ` listing: - .. code-block:: sh + .. code-block:: bash --configdb confserver1,confserver2,confserver3 @@ -43,7 +43,7 @@ content: | :setting:`storage.engine` if using the configuration file) with the 3.0 binary. - .. code-block:: sh + .. code-block:: bash mongod --configsvr --dbpath --port --storageEngine --- diff --git a/source/includes/steps-3.2-downgrade-sharded-cluster.yaml b/source/includes/steps-3.2-downgrade-sharded-cluster.yaml index 0fb95e0aba2..b865db9358b 100644 --- a/source/includes/steps-3.2-downgrade-sharded-cluster.yaml +++ b/source/includes/steps-3.2-downgrade-sharded-cluster.yaml @@ -107,7 +107,7 @@ content: | shutdown the :doc:`CSRS ` member. - .. code-block:: sh + .. code-block:: bash mongodump --db "config" @@ -128,7 +128,7 @@ content: | #. Use ``mongorestore --drop`` to restore the ``config`` dump to the new MMAPv1 ``mongod``. - .. code-block:: sh + .. code-block:: bash mongorestore --db="config" --drop /path/to/dump @@ -141,7 +141,7 @@ content: | i.e. without the :option:`--replSet ` or, if using a configuration file, :setting:`replication.replSetName`. - .. code-block:: sh + .. code-block:: bash mongod --configsvr --dbpath --port --storageEngine @@ -188,7 +188,7 @@ content: | :option:`--storageEngine ` option (or :setting:`storage.engine` if using the configuration file) with the 3.0 binary. - .. code-block:: sh + .. code-block:: bash mongod --configsvr --dbpath --port --storageEngine diff --git a/source/includes/steps-3.2-upgrade-sharded-cluster.yaml b/source/includes/steps-3.2-upgrade-sharded-cluster.yaml index 7013fc0168c..edc41f5703a 100644 --- a/source/includes/steps-3.2-upgrade-sharded-cluster.yaml +++ b/source/includes/steps-3.2-upgrade-sharded-cluster.yaml @@ -51,7 +51,7 @@ content: | :binary:`~bin.mongos`. That is, if the :binary:`~bin.mongos` has the following :option:`--configdb ` listing: - .. code-block:: sh + .. code-block:: bash mongos --configdb confserver1:port1,confserver2:port2,confserver3:port2 @@ -66,7 +66,7 @@ content: | #. Start the 3.2 binary with both the ``--configsvr`` and ``--port`` options: - .. code-block:: sh + .. code-block:: bash mongod --configsvr --port --dbpath @@ -95,7 +95,7 @@ content: | Replace each :binary:`~bin.mongos` instance with the 3.2 binary and restart. - .. code-block:: sh + .. code-block:: bash mongos --configdb ,, --- diff --git a/source/includes/steps-3.4-downgrade-sharded-cluster.yaml b/source/includes/steps-3.4-downgrade-sharded-cluster.yaml index 93abe912c3b..d1cf7c8256f 100644 --- a/source/includes/steps-3.4-downgrade-sharded-cluster.yaml +++ b/source/includes/steps-3.4-downgrade-sharded-cluster.yaml @@ -38,7 +38,7 @@ content: | #. Start the |oldversion| binary with the ``--shardsvr`` and ``--port`` command line options. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --port --dbpath @@ -85,7 +85,7 @@ content: | #. Start the |oldversion| binary with the ``--shardsvr`` and ``--port`` command line options. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --port --dbpath @@ -121,7 +121,7 @@ content: |- #. Start the |oldversion| binary with both the ``--configsvr`` and ``--port`` options: - .. code-block:: sh + .. code-block:: bash mongod --configsvr --port --dbpath @@ -166,7 +166,7 @@ content: |- #. Start the |oldversion| binary with both the ``--configsvr`` and ``--port`` options: - .. code-block:: sh + .. code-block:: bash mongod --configsvr --port --dbpath diff --git a/source/includes/steps-3.4-upgrade-sharded-cluster.yaml b/source/includes/steps-3.4-upgrade-sharded-cluster.yaml index 3278919c0b6..a25e2294cd5 100644 --- a/source/includes/steps-3.4-upgrade-sharded-cluster.yaml +++ b/source/includes/steps-3.4-upgrade-sharded-cluster.yaml @@ -20,7 +20,7 @@ content: |- #. Start the |newversion| binary with both the ``--configsvr`` and ``--port`` options: - .. code-block:: sh + .. code-block:: bash mongod --configsvr --port --dbpath @@ -65,7 +65,7 @@ content: |- #. Start the |newversion| binary with both the ``--configsvr`` and ``--port`` options: - .. code-block:: sh + .. code-block:: bash mongod --configsvr --port --dbpath @@ -101,7 +101,7 @@ content: |- #. Start the |newversion| binary with the ``--shardsvr`` and ``--port`` command line options. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --port --dbpath @@ -148,7 +148,7 @@ content: |- #. Start the |newversion| binary with the ``--shardsvr`` and ``--port`` command line options. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --port --dbpath @@ -185,7 +185,7 @@ content: |- configuration includes these settings, remove the settings when running the 3.4 :binary:`~bin.mongos`. - .. code-block:: sh + .. code-block:: bash mongos --configdb csReplSet/,, --- diff --git a/source/includes/steps-3.6-downgrade-sharded-cluster.yaml b/source/includes/steps-3.6-downgrade-sharded-cluster.yaml index 0a80f54a669..5725ca3e258 100644 --- a/source/includes/steps-3.6-downgrade-sharded-cluster.yaml +++ b/source/includes/steps-3.6-downgrade-sharded-cluster.yaml @@ -44,7 +44,7 @@ content: | configuration as appropriate for your deployment, e.g. ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --port --dbpath \ --bind_ip localhost, @@ -96,7 +96,7 @@ content: | configuration as appropriate for your deployment, e.g. ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --port --dbpath --bind_ip localhost, @@ -134,7 +134,7 @@ content: |- configuration as appropriate for your deployment, e.g. ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --configsvr --port --dbpath --bind_ip localhost, @@ -183,7 +183,7 @@ content: |- configuration as appropriate for your deployment, e.g. ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --configsvr --port --dbpath --bind_ip localhost, diff --git a/source/includes/steps-3.6-upgrade-sharded-cluster.yaml b/source/includes/steps-3.6-upgrade-sharded-cluster.yaml index 78061ccbc6d..f35b825b935 100644 --- a/source/includes/steps-3.6-upgrade-sharded-cluster.yaml +++ b/source/includes/steps-3.6-upgrade-sharded-cluster.yaml @@ -46,7 +46,7 @@ content: |- .. include:: /includes/fact-bind-ip-sharded-clusters.rst - .. code-block:: sh + .. code-block:: bash mongod --configsvr --replSet --port --dbpath --bind_ip localhost, @@ -97,7 +97,7 @@ content: |- options. Include any optional command line options used by the previous deployment: - .. code-block:: sh + .. code-block:: bash mongod --configsvr --replSet --port --dbpath --bind_ip localhost, @@ -143,7 +143,7 @@ content: |- options. Include any optional command line options used by the previous deployment: - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --replSet --port --dbpath --bind_ip localhost, @@ -198,7 +198,7 @@ content: |- options. Include any optional command line options used by the previous deployment: - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --replSet --port --dbpath --bind_ip localhost, @@ -235,7 +235,7 @@ content: |- .. include:: /includes/fact-bind-ip-sharded-clusters.rst - .. code-block:: sh + .. code-block:: bash mongos --configdb csReplSet/,, --bind_ip localhost, --- diff --git a/source/includes/steps-4.0-downgrade-sharded-cluster.yaml b/source/includes/steps-4.0-downgrade-sharded-cluster.yaml index 14418f1bc80..7438be91ca6 100644 --- a/source/includes/steps-4.0-downgrade-sharded-cluster.yaml +++ b/source/includes/steps-4.0-downgrade-sharded-cluster.yaml @@ -64,7 +64,7 @@ content: | configuration as appropriate for your deployment, e.g. ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --port --dbpath --bind_ip localhost, @@ -115,7 +115,7 @@ content: | configuration as appropriate for your deployment, e.g. ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --port --dbpath --bind_ip localhost, @@ -153,7 +153,7 @@ content: |- configuration as appropriate for your deployment, e.g. ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --configsvr --port --dbpath --bind_ip localhost, @@ -202,7 +202,7 @@ content: |- configuration as appropriate for your deployment, e.g. ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --configsvr --port --dbpath --bind_ip localhost, diff --git a/source/includes/steps-4.0-upgrade-sharded-cluster.yaml b/source/includes/steps-4.0-upgrade-sharded-cluster.yaml index ba7900c7675..b67b5b88be7 100644 --- a/source/includes/steps-4.0-upgrade-sharded-cluster.yaml +++ b/source/includes/steps-4.0-upgrade-sharded-cluster.yaml @@ -48,7 +48,7 @@ content: |- .. include:: /includes/extracts/4.0-upgrade-incompatible-options-rs.rst - .. code-block:: sh + .. code-block:: bash mongod --configsvr --replSet --port --dbpath --bind_ip localhost, @@ -105,7 +105,7 @@ content: |- ` options. Include any optional command line options used by the previous deployment: - .. code-block:: sh + .. code-block:: bash mongod --configsvr --replSet --port --dbpath --bind_ip localhost, @@ -164,7 +164,7 @@ content: |- .. include:: /includes/extracts/4.0-upgrade-incompatible-options-rs.rst - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --replSet --port --dbpath --bind_ip localhost, @@ -225,7 +225,7 @@ content: |- options as appropriate for your deployment: - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --replSet --port --dbpath --bind_ip localhost, @@ -271,7 +271,7 @@ content: |- .. include:: /includes/fact-bind-ip-sharded-clusters.rst - .. code-block:: sh + .. code-block:: bash mongos --configdb csReplSet/,, --bind_ip localhost, --- diff --git a/source/includes/steps-4.2-downgrade-mongod.yaml b/source/includes/steps-4.2-downgrade-mongod.yaml index 91e403a4c8d..fba5c686126 100644 --- a/source/includes/steps-4.2-downgrade-mongod.yaml +++ b/source/includes/steps-4.2-downgrade-mongod.yaml @@ -49,7 +49,7 @@ content: | `. Use :binary:`~bin.mongorestore` to restore that data to your |oldversion| standalone. - .. code-block:: sh + .. code-block:: bash mongorestore --host= --port= mystandalone.uncompressed.fcv4.0 diff --git a/source/includes/steps-4.2-downgrade-sharded-cluster.yaml b/source/includes/steps-4.2-downgrade-sharded-cluster.yaml index ef7fd1ae3ed..0a074543949 100644 --- a/source/includes/steps-4.2-downgrade-sharded-cluster.yaml +++ b/source/includes/steps-4.2-downgrade-sharded-cluster.yaml @@ -231,7 +231,7 @@ content: | not re-enable auto-splitting. If you wish to re-enable auto-splitting, run :method:`sh.enableAutoSplit()`: - .. code-block:: sh + .. code-block:: bash sh.enableAutoSplit() diff --git a/source/includes/steps-4.2-upgrade-sharded-cluster.yaml b/source/includes/steps-4.2-upgrade-sharded-cluster.yaml index 8f033c92fa1..d1b359f6a9b 100644 --- a/source/includes/steps-4.2-upgrade-sharded-cluster.yaml +++ b/source/includes/steps-4.2-upgrade-sharded-cluster.yaml @@ -44,7 +44,7 @@ content: |- :option:`--replSet `, and :option:`--port `. Include any other options as used by the deployment. - .. code-block:: sh + .. code-block:: bash mongod --configsvr --replSet --port --dbpath --bind_ip localhost, @@ -97,7 +97,7 @@ content: |- ` options. Include any optional command line options used by the previous deployment: - .. code-block:: sh + .. code-block:: bash mongod --configsvr --replSet --port --dbpath --bind_ip localhost, @@ -144,7 +144,7 @@ content: |- ` options. Include any additional command line options as appropriate for your deployment: - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --replSet --port --dbpath --bind_ip localhost, @@ -201,7 +201,7 @@ content: |- options as appropriate for your deployment: - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --replSet --port --dbpath --bind_ip localhost, @@ -239,7 +239,7 @@ content: |- .. include:: /includes/fact-bind-ip-sharded-clusters.rst - .. code-block:: sh + .. code-block:: bash mongos --configdb csReplSet/,, --bind_ip localhost, diff --git a/source/includes/steps-4.4-upgrade-sharded-cluster.yaml b/source/includes/steps-4.4-upgrade-sharded-cluster.yaml index 320e81bdd2e..fad2c2e0a68 100644 --- a/source/includes/steps-4.4-upgrade-sharded-cluster.yaml +++ b/source/includes/steps-4.4-upgrade-sharded-cluster.yaml @@ -44,7 +44,7 @@ content: |- :option:`--replSet `, and :option:`--port `. Include any other options as used by the deployment. - .. code-block:: sh + .. code-block:: bash mongod --configsvr --replSet --port --dbpath --bind_ip localhost, @@ -97,7 +97,7 @@ content: |- ` options. Include any optional command line options used by the previous deployment: - .. code-block:: sh + .. code-block:: bash mongod --configsvr --replSet --port --dbpath --bind_ip localhost, @@ -144,7 +144,7 @@ content: |- ` options. Include any additional command line options as appropriate for your deployment: - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --replSet --port --dbpath --bind_ip localhost, @@ -201,7 +201,7 @@ content: |- options as appropriate for your deployment: - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --replSet --port --dbpath --bind_ip localhost, @@ -239,7 +239,7 @@ content: |- .. include:: /includes/fact-bind-ip-sharded-clusters.rst - .. code-block:: sh + .. code-block:: bash mongos --configdb csReplSet/,, --bind_ip localhost, diff --git a/source/includes/steps-change-replica-set-wiredtiger.yaml b/source/includes/steps-change-replica-set-wiredtiger.yaml index cef13e4d372..5ccf070dfe9 100644 --- a/source/includes/steps-change-replica-set-wiredtiger.yaml +++ b/source/includes/steps-change-replica-set-wiredtiger.yaml @@ -44,7 +44,7 @@ content: | - id: general name: General Use (For Most Architectures) content: | - .. code-block:: sh + .. code-block:: bash mongod --storageEngine wiredTiger --dbpath --replSet --bind_ip localhost, @@ -60,7 +60,7 @@ content: | :option:`--enableMajorityReadConcern false ` to disable read concern ``majority``. |seemore| - .. code-block:: sh + .. code-block:: bash mongod --storageEngine wiredTiger --dbpath --replSet --bind_ip localhost, --enableMajorityReadConcern false diff --git a/source/includes/steps-clear-jumbo-flag-command.yaml b/source/includes/steps-clear-jumbo-flag-command.yaml index adfe2e95a9d..6b45a6bbe7e 100644 --- a/source/includes/steps-clear-jumbo-flag-command.yaml +++ b/source/includes/steps-clear-jumbo-flag-command.yaml @@ -11,7 +11,7 @@ content: | Run :method:`sh.status(true) ` to find the chunk labeled ``jumbo``. - .. code-block:: sh + .. code-block:: bash sh.status(true) diff --git a/source/includes/steps-clear-jumbo-flag-preferred.yaml b/source/includes/steps-clear-jumbo-flag-preferred.yaml index 6874673e16b..a46f2b60ad6 100644 --- a/source/includes/steps-clear-jumbo-flag-preferred.yaml +++ b/source/includes/steps-clear-jumbo-flag-preferred.yaml @@ -11,7 +11,7 @@ content: | Run :method:`sh.status(true) ` to find the chunk labeled ``jumbo``. - .. code-block:: sh + .. code-block:: bash sh.status(true) diff --git a/source/includes/steps-clear-jumbo-flag-refine-key.yaml b/source/includes/steps-clear-jumbo-flag-refine-key.yaml index c62533e2038..b429002e65b 100644 --- a/source/includes/steps-clear-jumbo-flag-refine-key.yaml +++ b/source/includes/steps-clear-jumbo-flag-refine-key.yaml @@ -11,7 +11,7 @@ content: | Run :method:`sh.status(true) ` to find the chunk labeled ``jumbo``. - .. code-block:: sh + .. code-block:: bash sh.status(true) diff --git a/source/includes/steps-create-admin-then-enable-authentication.yaml b/source/includes/steps-create-admin-then-enable-authentication.yaml index b2e25f1fe4b..2738411123b 100644 --- a/source/includes/steps-create-admin-then-enable-authentication.yaml +++ b/source/includes/steps-create-admin-then-enable-authentication.yaml @@ -90,7 +90,7 @@ content: | - If you start the :binary:`~bin.mongod` from the command line, add the :option:`--auth ` command line option: - .. code-block:: sh + .. code-block:: bash mongod --auth --port 27017 --dbpath /var/lib/mongodb @@ -98,7 +98,7 @@ content: | :ref:`configuration file `, add the :setting:`security.authorization` configuration file setting: - .. code-block:: sh + .. code-block:: bash security: authorization: enabled @@ -130,7 +130,7 @@ content: | :option:`--authenticationDatabase \ ` command line options: - .. code-block:: sh + .. code-block:: bash mongo --port 27017 --authenticationDatabase "admin" -u "myUserAdmin" -p @@ -143,7 +143,7 @@ content: | Connect the :binary:`~bin.mongo` shell to the :binary:`~bin.mongod`: - .. code-block:: sh + .. code-block:: bash mongo --port 27017 @@ -235,7 +235,7 @@ content: | :option:`--authenticationDatabase \ ` command line options: - .. code-block:: sh + .. code-block:: bash mongo --port 27017 -u "myTester" --authenticationDatabase "test" -p @@ -248,7 +248,7 @@ content: | Connect the :binary:`~bin.mongo` shell to the :binary:`~bin.mongod`: - .. code-block:: sh + .. code-block:: bash mongo --port 27017 diff --git a/source/includes/steps-deploy-geographically-distributed-replica-set-5member.yaml b/source/includes/steps-deploy-geographically-distributed-replica-set-5member.yaml index d9278fea776..e2d3f666638 100644 --- a/source/includes/steps-deploy-geographically-distributed-replica-set-5member.yaml +++ b/source/includes/steps-deploy-geographically-distributed-replica-set-5member.yaml @@ -45,7 +45,7 @@ content: | .. include:: /includes/warning-bind-ip-security-considerations.rst - .. code-block:: sh + .. code-block:: bash mongod --replSet "rs0" --bind_ip localhost, @@ -70,7 +70,7 @@ content: | configuration file's path with the :option:`--config ` option: - .. code-block:: sh + .. code-block:: bash mongod --config diff --git a/source/includes/steps-deploy-replica-set.yaml b/source/includes/steps-deploy-replica-set.yaml index 2747aef47e2..2537b107ffd 100644 --- a/source/includes/steps-deploy-replica-set.yaml +++ b/source/includes/steps-deploy-replica-set.yaml @@ -43,7 +43,7 @@ content: | .. include:: /includes/warning-bind-ip-security-considerations.rst - .. code-block:: sh + .. code-block:: bash mongod --replSet "rs0" --bind_ip localhost, @@ -68,7 +68,7 @@ content: | configuration file's path with the :option:`--config ` option: - .. code-block:: sh + .. code-block:: bash mongod --config diff --git a/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml b/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml index 96648ff4ac3..d6cb64c214a 100644 --- a/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml +++ b/source/includes/steps-deploy-sharded-cluster-config-server-noauth.yaml @@ -45,7 +45,7 @@ content: | Start the :binary:`~bin.mongod` with the ``--config`` option set to the configuration file path. - .. code-block:: sh + .. code-block:: bash mongod --config @@ -59,7 +59,7 @@ content: | .. include:: /includes/warning-bind-ip-security-considerations.rst - .. code-block:: sh + .. code-block:: bash mongod --configsvr --replSet --dbpath --bind_ip localhost, diff --git a/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml b/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml index cc21c3389bd..5cad2f647ce 100644 --- a/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml +++ b/source/includes/steps-deploy-sharded-cluster-shard-replica-noauth.yaml @@ -43,7 +43,7 @@ content: | Start the :binary:`~bin.mongod` with the ``--config`` option set to the configuration file path. - .. code-block:: sh + .. code-block:: bash mongod --config @@ -54,7 +54,7 @@ content: | the ``--replSet``, and ``--shardsvr``, ``--bind_ip`` options, and other options as appropriate to your deployment. For example: - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --replSet --dbpath --bind_ip localhost, diff --git a/source/includes/steps-disable-thp-in-initd.yaml b/source/includes/steps-disable-thp-in-initd.yaml index f5ded436b24..c077c4aa4fa 100644 --- a/source/includes/steps-disable-thp-in-initd.yaml +++ b/source/includes/steps-disable-thp-in-initd.yaml @@ -47,7 +47,7 @@ action: ``never`` by adding the following line to the ``init.d`` script, just before the ``unset thp_path`` statement: - .. code-block:: sh + .. code-block:: bash echo 'never' | tee ${thp_path}/defrag > /dev/null --- diff --git a/source/includes/steps-disable-thp-in-systemd.yaml b/source/includes/steps-disable-thp-in-systemd.yaml index ba9901008e3..0c19fdd709e 100644 --- a/source/includes/steps-disable-thp-in-systemd.yaml +++ b/source/includes/steps-disable-thp-in-systemd.yaml @@ -28,7 +28,7 @@ action: other Red Hat-based derivatives, use a different path for the THP ``enabled`` file: - .. code-block:: sh + .. code-block:: bash /sys/kernel/mm/redhat_transparent_hugepage/enabled @@ -47,7 +47,7 @@ action: ``systemd`` unit file, just after the existing ``ExecStart`` statement: - .. code-block:: sh + .. code-block:: bash ExecStart=/bin/sh -c 'echo never | tee /sys/kernel/mm/transparent_hugepage/defrag > /dev/null' diff --git a/source/includes/steps-enable-authentication-in-sharded-cluster.yaml b/source/includes/steps-enable-authentication-in-sharded-cluster.yaml index 48e46081df6..e4464a94d60 100644 --- a/source/includes/steps-enable-authentication-in-sharded-cluster.yaml +++ b/source/includes/steps-enable-authentication-in-sharded-cluster.yaml @@ -160,7 +160,7 @@ action: set, start the :binary:`~bin.mongod` with the ``-keyFile``, ``--configsvr``, and ``--replSet`` parameters. - .. code-block:: sh + .. code-block:: bash mongod --keyFile --configsvr --replSet --dbpath diff --git a/source/includes/steps-install-mongodb-enterprise-on-debian.yaml b/source/includes/steps-install-mongodb-enterprise-on-debian.yaml index 882310484d7..961a2452655 100644 --- a/source/includes/steps-install-mongodb-enterprise-on-debian.yaml +++ b/source/includes/steps-install-mongodb-enterprise-on-debian.yaml @@ -18,14 +18,14 @@ content: | .. tab:: Debian 10 "Buster" :tabid: debian-10-buster - .. code-block:: sh + .. code-block:: bash echo "deb http://repo.mongodb.com/apt/debian buster/mongodb-enterprise/{+version+} main" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list .. tab:: Debian 9 "Stretch" :tabid: debian-9-stretch - .. code-block:: sh + .. code-block:: bash echo "deb http://repo.mongodb.com/apt/debian stretch/mongodb-enterprise/{+version+} main" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list @@ -42,14 +42,14 @@ content: | .. tab:: Debian 10 "Buster" :tabid: debian-10-buster - .. code-block:: sh + .. code-block:: bash echo "deb http://repo.mongodb.com/apt/debian buster/mongodb-enterprise/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise-4.2.list .. tab:: Debian 9 "Stretch" :tabid: debian-9-stretch - .. code-block:: sh + .. code-block:: bash echo "deb http://repo.mongodb.com/apt/debian stretch/mongodb-enterprise/4.2 main" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise-4.2.list --- diff --git a/source/includes/steps-install-mongodb-enterprise-on-suse.yaml b/source/includes/steps-install-mongodb-enterprise-on-suse.yaml index e66fe27f530..150eec40b17 100644 --- a/source/includes/steps-install-mongodb-enterprise-on-suse.yaml +++ b/source/includes/steps-install-mongodb-enterprise-on-suse.yaml @@ -17,14 +17,14 @@ content: | .. tab:: SUSE 15 :tabid: suse-15 - .. code-block:: sh + .. code-block:: bash sudo zypper addrepo --gpgcheck "https://repo.mongodb.com/zypper/suse/15/mongodb-enterprise/{+version+}/x86_64/" mongodb .. tab:: SUSE 12 :tabid: suse-12 - .. code-block:: sh + .. code-block:: bash sudo zypper addrepo --gpgcheck "https://repo.mongodb.com/zypper/suse/12/mongodb-enterprise/{+version+}/x86_64/" mongodb @@ -34,7 +34,7 @@ content: | example, to restrict your SUSE 12 system to the 4.0 release series, use the following command: - .. code-block:: sh + .. code-block:: bash sudo zypper addrepo --no-gpgcheck "https://repo.mongodb.com/zypper/suse/12/mongodb-enterprise/4.0/x86_64/" mongodb --- diff --git a/source/includes/steps-install-mongodb-enterprise-on-ubuntu.yaml b/source/includes/steps-install-mongodb-enterprise-on-ubuntu.yaml index aa92cef694d..f0bd8bc917a 100644 --- a/source/includes/steps-install-mongodb-enterprise-on-ubuntu.yaml +++ b/source/includes/steps-install-mongodb-enterprise-on-ubuntu.yaml @@ -25,7 +25,7 @@ content: | Create the list file for Ubuntu 20.04 (Focal). - .. code-block:: sh + .. code-block:: bash echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.com/apt/ubuntu focal/mongodb-enterprise/{+version+} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list @@ -38,7 +38,7 @@ content: | Create the list file for Ubuntu 18.04 (Bionic). - .. code-block:: sh + .. code-block:: bash echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.com/apt/ubuntu bionic/mongodb-enterprise/{+version+} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list @@ -51,7 +51,7 @@ content: | Create the list file for Ubuntu 16.04 (Xenial). - .. code-block:: sh + .. code-block:: bash echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.com/apt/ubuntu xenial/mongodb-enterprise/{+version+} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list diff --git a/source/includes/steps-install-mongodb-enterprise-with-docker.yaml b/source/includes/steps-install-mongodb-enterprise-with-docker.yaml index be4c6cdec38..f43d707bcbf 100644 --- a/source/includes/steps-install-mongodb-enterprise-with-docker.yaml +++ b/source/includes/steps-install-mongodb-enterprise-with-docker.yaml @@ -17,7 +17,7 @@ pre: | The Docker Hub mongo project is *not* maintained by MongoDB. Any support requests should go to `Docker `__. - .. code-block:: sh + .. code-block:: bash export MONGODB_VERSION=4.0 curl -O --remote-name-all https://raw.githubusercontent.com/docker-library/mongo/master/$MONGODB_VERSION/{Dockerfile,docker-entrypoint.sh} @@ -31,7 +31,7 @@ pre: | Use the downloaded build files to create a Docker container image wrapped around MongoDB Enterprise. Set ``DOCKER_USERNAME`` to your Docker Hub username. - .. code-block:: sh + .. code-block:: bash export DOCKER_USERNAME=username chmod 755 ./docker-entrypoint.sh @@ -45,13 +45,13 @@ ref: verify-build pre: | Verify that the build was created. - .. code-block:: sh + .. code-block:: bash docker images $DOCKER_USERNAME/mongo-enterprise:$MONGODB_VERSION The output should resemble this: - .. code-block:: sh + .. code-block:: bash REPOSITORY TAG IMAGE ID CREATED SIZE username/mongo-enterprise 4.0 397f0a16010a 31 seconds ago 465MB @@ -63,7 +63,7 @@ pre: | The following commands run mongod locally in a Docker container and check the version. - .. code-block:: sh + .. code-block:: bash docker run --name mymongo -itd $DOCKER_USERNAME/mongo-enterprise:$MONGODB_VERSION docker exec -it mymongo /usr/bin/mongo --eval "db.version()" diff --git a/source/includes/steps-install-mongodb-on-debian.yaml b/source/includes/steps-install-mongodb-on-debian.yaml index 83e1df4d5aa..9a50f47032e 100644 --- a/source/includes/steps-install-mongodb-on-debian.yaml +++ b/source/includes/steps-install-mongodb-on-debian.yaml @@ -18,14 +18,14 @@ content: | .. tab:: Debian 10 "Buster" :tabid: debian-10-buster - .. code-block:: sh + .. code-block:: bash echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/{+version+} main" | sudo tee /etc/apt/sources.list.d/mongodb-org-{+version+}.list .. tab:: Debian 9 "Stretch" :tabid: debian-9-stretch - .. code-block:: sh + .. code-block:: bash echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/{+version+} main" | sudo tee /etc/apt/sources.list.d/mongodb-org-{+version+}.list --- diff --git a/source/includes/steps-install-mongodb-on-linux.yaml b/source/includes/steps-install-mongodb-on-linux.yaml index ca32f7244cb..3393839c0c2 100644 --- a/source/includes/steps-install-mongodb-on-linux.yaml +++ b/source/includes/steps-install-mongodb-on-linux.yaml @@ -27,7 +27,7 @@ ref: extract pre: | For example, from a system shell, you can extract using the ``tar`` command: - .. code-block:: sh + .. code-block:: bash tar -zxvf mongodb-linux-*-{+release+}.tgz --- @@ -44,7 +44,7 @@ content: | ``/path/to/the/mongodb-directory/`` with your installation directory as appropriate) - .. code-block:: sh + .. code-block:: bash sudo cp /path/to/the/mongodb-directory/bin/* /usr/local/bin/ @@ -53,7 +53,7 @@ content: | ``/path/to/the/mongodb-directory/`` with your installation directory as appropriate): - .. code-block:: sh + .. code-block:: bash sudo ln -s /path/to/the/mongodb-directory/bin/* /usr/local/bin/ diff --git a/source/includes/steps-install-mongodb-on-suse.yaml b/source/includes/steps-install-mongodb-on-suse.yaml index 747f946577d..8f3716685d1 100644 --- a/source/includes/steps-install-mongodb-on-suse.yaml +++ b/source/includes/steps-install-mongodb-on-suse.yaml @@ -20,14 +20,14 @@ content: | .. tab:: SUSE 15 :tabid: suse-15 - .. code-block:: sh + .. code-block:: bash sudo zypper addrepo --gpgcheck "https://repo.mongodb.org/zypper/suse/15/mongodb-org/{+version+}/x86_64/" mongodb .. tab:: SUSE 12 :tabid: suse-12 - .. code-block:: sh + .. code-block:: bash sudo zypper addrepo --gpgcheck "https://repo.mongodb.org/zypper/suse/12/mongodb-org/{+version+}/x86_64/" mongodb @@ -38,7 +38,7 @@ content: | For example, to restrict your SUSE 12 system to the 4.0 release series, use the following command: - .. code-block:: sh + .. code-block:: bash sudo zypper addrepo --no-gpgcheck "https://repo.mongodb.org/zypper/suse/12/mongodb-org/4.0/x86_64/" mongodb --- diff --git a/source/includes/steps-install-mongodb-on-ubuntu-tarball.yaml b/source/includes/steps-install-mongodb-on-ubuntu-tarball.yaml index 1f0329101ca..a55103144a9 100644 --- a/source/includes/steps-install-mongodb-on-ubuntu-tarball.yaml +++ b/source/includes/steps-install-mongodb-on-ubuntu-tarball.yaml @@ -23,7 +23,7 @@ pre: | be sure to modify the command to reflect the correct ``.tgz`` file name. - .. code-block:: sh + .. code-block:: bash tar -zxvf mongodb-linux-*-{+release+}.tgz @@ -41,7 +41,7 @@ content: | copy these binaries into a directory listed in your ``PATH`` variable such as ``/usr/local/bin``: - .. code-block:: sh + .. code-block:: bash sudo cp /bin/* /usr/local/bin/ diff --git a/source/includes/steps-install-mongodb-on-ubuntu.yaml b/source/includes/steps-install-mongodb-on-ubuntu.yaml index d10a184d328..a63add3ee06 100644 --- a/source/includes/steps-install-mongodb-on-ubuntu.yaml +++ b/source/includes/steps-install-mongodb-on-ubuntu.yaml @@ -6,7 +6,7 @@ content: | From a terminal, issue the following command to import the MongoDB public GPG Key from ``_: - .. code-block:: sh + .. code-block:: bash wget -qO - https://www.mongodb.org/static/pgp/server-{+pgp-version+}.asc | sudo apt-key add - @@ -17,13 +17,13 @@ content: | #. Install ``gnupg`` and its required libraries using the following command: - .. code-block:: sh + .. code-block:: bash sudo apt-get install gnupg #. Once installed, retry importing the key: - .. code-block:: sh + .. code-block:: bash wget -qO - https://www.mongodb.org/static/pgp/server-{+pgp-version+}.asc | sudo apt-key add - @@ -58,7 +58,7 @@ content: | ``/etc/apt/sources.list.d/mongodb-org-{+version+}.list`` file for Ubuntu 20.04 (Focal): - .. code-block:: sh + .. code-block:: bash echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/{+version+} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-{+version+}.list @@ -73,7 +73,7 @@ content: | ``/etc/apt/sources.list.d/mongodb-org-{+version+}.list`` file for Ubuntu 18.04 (Bionic): - .. code-block:: sh + .. code-block:: bash echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/{+version+} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-{+version+}.list @@ -88,7 +88,7 @@ content: | ``/etc/apt/sources.list.d/mongodb-org-{+version+}.list`` file for Ubuntu 16.04 (Xenial): - .. code-block:: sh + .. code-block:: bash echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/{+version+} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-{+version+}.list @@ -123,7 +123,7 @@ content: | To install the latest stable version, issue the following - .. code-block:: sh + .. code-block:: bash sudo apt-get install -y {+package-name-org+} - id: specific @@ -139,7 +139,7 @@ content: | available. To prevent unintended upgrades, you can pin the package at the currently installed version: - .. code-block:: sh + .. code-block:: bash echo "{+package-name-org+} hold" | sudo dpkg --set-selections echo "{+package-name-org+}-server hold" | sudo dpkg --set-selections diff --git a/source/includes/steps-monitor-with-snmp.yaml b/source/includes/steps-monitor-with-snmp.yaml index 19c55fa38f9..6ade54a70f1 100644 --- a/source/includes/steps-monitor-with-snmp.yaml +++ b/source/includes/steps-monitor-with-snmp.yaml @@ -14,13 +14,13 @@ content: | For example, if you installed the latest version of MongoDB via the ``yum`` package manager: - .. code-block:: sh + .. code-block:: bash cd /usr/share/doc/mongodb-enterprise-server-{+release+} #. Copy the two MongoDB SNMP files to their target directories: - .. code-block:: sh + .. code-block:: bash sudo cp MONGOD-MIB.txt /usr/share/snmp/mibs/ sudo cp mongod.conf.subagent /etc/snmp/mongod.conf @@ -32,21 +32,21 @@ content: | For example, if you installed MongoDB via the ``apt`` package manager: - .. code-block:: sh + .. code-block:: bash cd /usr/share/doc/mongodb-enterprise-server #. Copy the ``MONGOD-MIB.txt.gz`` file to its target directory, and unzip it: - .. code-block:: sh + .. code-block:: bash sudo cp MONGOD-MIB.txt.gz /usr/share/snmp/mibs/ sudo gunzip /usr/share/snmp/mibs/MONGOD-MIB.txt.gz #. Copy the ``mongod.conf.subagent`` file to its target directory: - .. code-block:: sh + .. code-block:: bash sudo cp mongod.conf.subagent /etc/snmp/mongod.conf @@ -57,13 +57,13 @@ content: | For example, if you installed the latest version of MongoDB via the ``zypper`` package manager: - .. code-block:: sh + .. code-block:: bash cd /usr/share/doc/packages/mongodb-enterprise-server #. Copy the two MongoDB SNMP files to their target directories: - .. code-block:: sh + .. code-block:: bash sudo cp MONGOD-MIB.txt /usr/share/snmp/mibs/ sudo cp mongod.conf.subagent /etc/snmp/mongod.conf @@ -81,7 +81,7 @@ content: | Edit the ``/etc/snmp/snmpd.conf`` file, and add the following: - .. code-block:: sh + .. code-block:: bash # sec.name source community com2sec local localhost mongodb @@ -102,13 +102,13 @@ content: | #. Install ``snmpd`` if it is not already installed: - .. code-block:: sh + .. code-block:: bash sudo apt-get install snmpd #. Edit the ``/etc/snmp/snmpd.conf`` file, and add the following: - .. code-block:: sh + .. code-block:: bash # sec.name source community com2sec local localhost mongodb @@ -127,7 +127,7 @@ content: | Edit the ``/etc/snmp/snmpd.conf`` file, and add the following: - .. code-block:: sh + .. code-block:: bash # sec.name source community com2sec local localhost mongodb @@ -170,13 +170,13 @@ content: | - For Linux systems using **systemd** (``systemctl`` command): - .. code-block:: sh + .. code-block:: bash sudo systemctl start snmpd - For Linux systems using **System V init** (``service`` command): - .. code-block:: sh + .. code-block:: bash sudo service snmpd start --- @@ -206,14 +206,14 @@ content: | #. Install ``snmpwalk`` on your system: - .. code-block:: sh + .. code-block:: bash sudo yum install net-snmp-utils #. Run ``snmpwalk`` with the following parameters to verify the ability to collect data from |mongod-program|: - .. code-block:: sh + .. code-block:: bash snmpwalk -m /usr/share/snmp/mibs/MONGOD-MIB.txt -v 2c -c mongodb 127.0.0.1:161 1.3.6.1.4.1.34601 @@ -225,7 +225,7 @@ content: | the ``snmp-mibs-downloader`` package. For example, on Debian 9 "Stretch", the primary repo entries might look like this: - .. code-block:: sh + .. code-block:: bash deb http://deb.debian.org/debian stretch main non-free deb-src http://deb.debian.org/debian stretch main non-free @@ -234,7 +234,7 @@ content: | package to supply necessary MIB files, then restart the ``snmpd`` service to reload the new MIB files: - .. code-block:: sh + .. code-block:: bash sudo apt-get update sudo apt-get -y install snmp-mibs-downloader @@ -244,14 +244,14 @@ content: | parameters to verify the ability to collect data from |mongod-program|: - .. code-block:: sh + .. code-block:: bash snmpwalk -m /usr/share/snmp/mibs/MONGOD-MIB.txt -v 2c -c mongodb 127.0.0.1:161 1.3.6.1.4.1.34601 .. tab:: SUSE :tabid: suse-linux - .. code-block:: sh + .. code-block:: bash snmpwalk -m /usr/share/snmp/mibs/MONGOD-MIB.txt -v 2c -c mongodb 127.0.0.1:161 1.3.6.1.4.1.34601 diff --git a/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml b/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml index b1ba0e3bb1b..fc78dd01cb7 100644 --- a/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml +++ b/source/includes/steps-perform-maintenance-task-on-replica-set-members.yaml @@ -91,13 +91,13 @@ content: | For example, to restart a replica set member that is not part of a sharded cluster: - .. code-block:: sh + .. code-block:: bash mongod --port 27218 --dbpath /srv/mongodb --bind_ip localhost, --setParameter disableLogicalSessionCacheRefresh=true For example, to restart a shard/config server replica set member for maintenance: - .. code-block:: sh + .. code-block:: bash mongod --port 27218 --dbpath /srv/mongodb --bind_ip localhost, --setParameter skipShardingConfigurationChecks=true --setParameter disableLogicalSessionCacheRefresh=true @@ -270,13 +270,13 @@ content: | For example, to restart a replica set member that is not part of a sharded cluster: - .. code-block:: sh + .. code-block:: bash mongod --port 27218 --dbpath /srv/mongodb --bind_ip localhost, --setParameter disableLogicalSessionCacheRefresh=true For example, to restart a shard/config server replica set member for maintenance: - .. code-block:: sh + .. code-block:: bash mongod --port 27218 --dbpath /srv/mongodb --bind_ip localhost, --setParameter skipShardingConfigurationChecks=true --setParameter disableLogicalSessionCacheRefresh=true diff --git a/source/includes/steps-restore-sharded-config-primary-from-backup.yaml b/source/includes/steps-restore-sharded-config-primary-from-backup.yaml index aa8b5085332..44ff06493db 100644 --- a/source/includes/steps-restore-sharded-config-primary-from-backup.yaml +++ b/source/includes/steps-restore-sharded-config-primary-from-backup.yaml @@ -34,7 +34,7 @@ content: | snapshot mount to the data directory created in :guilabel:`B. Prepare the Target Host for Restoration`: - .. code-block:: sh + .. code-block:: bash cp -a /snap/mongodb/path/to/mongodb /path/to/mongodb @@ -58,7 +58,7 @@ content: | :option:`--config ` option in the command line specifying the full path to the configuration file: - .. code-block:: sh + .. code-block:: bash mongod --config /path/to/mongodb/mongod.conf @@ -84,7 +84,7 @@ content: | backup data location to the data directory created in :guilabel:`B. Prepare the Target Host for Restoration`: - .. code-block:: sh + .. code-block:: bash cp -a /backup/mongodb/path/to/mongodb /path/to/mongodb @@ -107,7 +107,7 @@ content: | :option:`--config ` option in the command line specifying the full path to the configuration file: - .. code-block:: sh + .. code-block:: bash mongod --config /path/to/mongodb/mongod.conf @@ -119,7 +119,7 @@ content: | ``disableLogicalSessionCacheRefresh`` server parameter prior to startup. - .. code-block:: sh + .. code-block:: bash mongod --config /path/to/mongodb/mongod.conf \ --setParameter disableLogicalSessionCacheRefresh=true @@ -237,7 +237,7 @@ content: | Start the :binary:`mongod ` with the updated configuration file: - .. code-block:: sh + .. code-block:: bash mongod --config /path/to/mongodb/mongod.conf diff --git a/source/includes/steps-restore-sharded-shard-primary-from-backup.yaml b/source/includes/steps-restore-sharded-shard-primary-from-backup.yaml index 1378e525a77..2ef5e6dd394 100644 --- a/source/includes/steps-restore-sharded-shard-primary-from-backup.yaml +++ b/source/includes/steps-restore-sharded-shard-primary-from-backup.yaml @@ -35,7 +35,7 @@ content: | snapshot mount to the data directory created in :guilabel:`B. Prepare the Target Host for Restoration`: - .. code-block:: sh + .. code-block:: bash cp -a /snap/mongodb/path/to/mongodb /path/to/mongodb @@ -59,7 +59,7 @@ content: | :option:`--config ` option in the command line specifying the full path to the configuration file: - .. code-block:: sh + .. code-block:: bash mongod --config /path/to/mongodb/mongod.conf @@ -86,7 +86,7 @@ content: | backup data location to the data directory created in :guilabel:`B. Prepare the Target Host for Restoration`: - .. code-block:: sh + .. code-block:: bash cp -a /backup/mongodb/path/to/mongodb /path/to/mongodb @@ -109,7 +109,7 @@ content: | :option:`--config ` option in the command line specifying the full path to the configuration file: - .. code-block:: sh + .. code-block:: bash mongod --config /path/to/mongodb/mongod.conf @@ -121,7 +121,7 @@ content: | ``disableLogicalSessionCacheRefresh`` server parameter prior to startup: - .. code-block:: sh + .. code-block:: bash mongod --config /path/to/mongodb/mongod.conf \ --setParameter disableLogicalSessionCacheRefresh=true diff --git a/source/includes/steps-run-mongodb-on-linux-tarball.yaml b/source/includes/steps-run-mongodb-on-linux-tarball.yaml index ba01a506b1f..2c147f9b13f 100644 --- a/source/includes/steps-run-mongodb-on-linux-tarball.yaml +++ b/source/includes/steps-run-mongodb-on-linux-tarball.yaml @@ -5,13 +5,13 @@ content: | Create a directory where the MongoDB instance stores its data. For example: - .. code-block:: sh + .. code-block:: bash sudo mkdir -p /var/lib/mongo Create a directory where the MongoDB instance stores its log. For example: - .. code-block:: sh + .. code-block:: bash sudo mkdir -p /var/log/mongodb @@ -19,7 +19,7 @@ content: | permission to these directories. For example, if you intend to run MongoDB as yourself: - .. code-block:: sh + .. code-block:: bash sudo chown `whoami` /var/lib/mongo # Or substitute another user sudo chown `whoami` /var/log/mongodb # Or substitute another user @@ -30,7 +30,7 @@ ref: start-mdb content: | To run MongoDB, run the :binary:`~bin.mongod` process at the system prompt. - .. code-block:: sh + .. code-block:: bash mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork diff --git a/source/mongo.txt b/source/mongo.txt index 5b84517a9f0..412eb604bea 100644 --- a/source/mongo.txt +++ b/source/mongo.txt @@ -43,7 +43,7 @@ Prerequisites running, open a terminal window (or a command prompt for Windows) and go to your ```` directory: - .. code-block:: sh + .. code-block:: bash cd @@ -70,7 +70,7 @@ You can run :binary:`~bin.mongo` shell without any command-line options to connect to a :doc:`MongoDB ` instance running on your **localhost** with **default port** 27017: -.. code-block:: sh +.. code-block:: bash mongo @@ -81,7 +81,7 @@ To explicitly specify the port, include the :option:`--port ` command-line option. For example, to connect to a MongoDB instance running on localhost with a non-default port 28015: -.. code-block:: sh +.. code-block:: bash mongo --port 28015 @@ -94,7 +94,7 @@ To explicitly specify the hostname and/or port, `. For example, to connect to a MongoDB instance running on a remote host machine: - .. code-block:: sh + .. code-block:: bash mongo "mongodb://mongodb0.example.com:28015" @@ -102,7 +102,7 @@ To explicitly specify the hostname and/or port, `. For example, to connect to a MongoDB instance running on a remote host machine: - .. code-block:: sh + .. code-block:: bash mongo --host mongodb0.example.com:28015 @@ -111,7 +111,7 @@ To explicitly specify the hostname and/or port, example, to connect to a MongoDB instance running on a remote host machine: - .. code-block:: sh + .. code-block:: bash mongo --host mongodb0.example.com --port 28015 @@ -130,7 +130,7 @@ To connect to a MongoDB instance requires authentication: If you do not specify the password in the connection string, the shell will prompt for the password. - .. code-block:: sh + .. code-block:: bash mongo "mongodb://alice@mongodb0.examples.com:28015/?authSource=admin" @@ -146,7 +146,7 @@ To connect to a MongoDB instance requires authentication: If you specify ``--password`` without the user's password, the shell will prompt for the password. - .. code-block:: sh + .. code-block:: bash mongo --username alice --password --authenticationDatabase admin --host mongodb0.examples.com --port 28015 @@ -158,14 +158,14 @@ To connect to a replica set: - You can specify the replica set name and members in the :doc:`connection string `. - .. code-block:: sh + .. code-block:: bash mongo "mongodb://mongodb0.example.com.local:27017,mongodb1.example.com.local:27017,mongodb2.example.com.local:27017/?replicaSet=replA" - If using the :ref:`connections-dns-seedlist`, you can specify the connection string: - .. code-block:: sh + .. code-block:: bash mongo "mongodb+srv://server.example.com/" @@ -180,7 +180,7 @@ To connect to a replica set: command-line option. For example, to connect to replica set named ``replA``: - .. code-block:: sh + .. code-block:: bash mongo --host replA/mongodb0.example.com.local:27017,mongodb1.example.com.local:27017,mongodb2.example.com.local:27017 @@ -192,14 +192,14 @@ For TLS/SSL connections, - You can specify the ``ssl=true`` option in the :doc:`connection string `. - .. code-block:: sh + .. code-block:: bash mongo "mongodb://mongodb0.example.com.local:27017,mongodb1.example.com.local:27017,mongodb2.example.com.local:27017/?replicaSet=replA&ssl=true" - If using the :ref:`connections-dns-seedlist`, you can include the ``+srv`` connection string modifier: - .. code-block:: sh + .. code-block:: bash mongo "mongodb+srv://server.example.com/" @@ -211,7 +211,7 @@ For TLS/SSL connections, - You can specify :option:`--ssl ` command-line option. For example, to connect to replica set named ``replA``: - .. code-block:: sh + .. code-block:: bash mongo --ssl --host replA/mongodb0.example.com.local:27017,mongodb1.example.com.local:27017,mongodb2.example.com.local:27017 @@ -230,7 +230,7 @@ Working with the ``mongo`` Shell To display the database you are using, type ``db``: -.. code-block:: sh +.. code-block:: bash db diff --git a/source/reference/command/addShard.txt b/source/reference/command/addShard.txt index 01110c255c9..66ef649d40b 100644 --- a/source/reference/command/addShard.txt +++ b/source/reference/command/addShard.txt @@ -46,7 +46,7 @@ Definition the shard's replica set. Any additional replica set member hostnames must be comma separated. For example: - .. code-block:: sh + .. code-block:: bash /<:port>,<:port>, ... diff --git a/source/reference/command/collMod.txt b/source/reference/command/collMod.txt index 93ba11c5e2d..576a24172e7 100644 --- a/source/reference/command/collMod.txt +++ b/source/reference/command/collMod.txt @@ -402,7 +402,7 @@ However, since the ``validationAction`` is ``warn`` only, MongoDB only logs the validation violation message and allows the operation to proceed: -.. code-block:: sh +.. code-block:: bash 2017-12-01T12:31:23.738-05:00 W STORAGE [conn1] Document would fail validation collection: example.contacts doc: { _id: ObjectId('5a2191ebacbbfc2bdc4dcffc'), name: "Amanda", status: "Updated" } diff --git a/source/reference/command/findAndModify.txt b/source/reference/command/findAndModify.txt index c3d6816b168..486419f16d2 100644 --- a/source/reference/command/findAndModify.txt +++ b/source/reference/command/findAndModify.txt @@ -644,7 +644,7 @@ and returns a document with the following fields: - The ``value`` field containing ``null``. -.. code-block:: sh +.. code-block:: bash { "value" : null, @@ -683,7 +683,7 @@ matches the ``query`` condition: The command returns the newly inserted document in the ``value`` field: -.. code-block:: sh +.. code-block:: bash { "lastErrorObject" : { @@ -727,7 +727,7 @@ document with the ``state`` value of ``active`` and the lowest The command returns the deleted document: -.. code-block:: sh +.. code-block:: bash { "lastErrorObject" : { diff --git a/source/reference/command/logRotate.txt b/source/reference/command/logRotate.txt index 553cecb59e6..dc34f7ff357 100644 --- a/source/reference/command/logRotate.txt +++ b/source/reference/command/logRotate.txt @@ -44,7 +44,7 @@ Definition process ID (PID) of ``2200``, the following command rotates the log file for that instance on Linux: - .. code-block:: sh + .. code-block:: bash kill -SIGUSR1 2200 diff --git a/source/reference/configuration-options.txt b/source/reference/configuration-options.txt index da6c8cf83db..2b76d505fdd 100644 --- a/source/reference/configuration-options.txt +++ b/source/reference/configuration-options.txt @@ -113,7 +113,7 @@ For example, the following uses :option:`mongod --config \ ` :option:`mongos --config \ `: -.. code-block:: sh +.. code-block:: bash mongod --config /etc/mongod.conf @@ -122,7 +122,7 @@ For example, the following uses :option:`mongod --config You can also use the ``-f`` alias to specify the configuration file, as in the following: -.. code-block:: sh +.. code-block:: bash mongod -f /etc/mongod.conf @@ -140,7 +140,7 @@ in the configuration file, you must include the :option:`--configExpand ` option when starting the :binary:`~bin.mongod` or :binary:`~bin.mongos`. For example: -.. code-block:: sh +.. code-block:: bash mongod --config /etc/mongod.conf --configExpand "rest,exec" mongos --config /etc/mongos.conf --configExpand "rest,exec" diff --git a/source/reference/connection-string.txt b/source/reference/connection-string.txt index 702f19bea28..9292f9defa0 100644 --- a/source/reference/connection-string.txt +++ b/source/reference/connection-string.txt @@ -57,14 +57,14 @@ Examples - For a standalone: - .. code-block:: sh + .. code-block:: bash mongodb://mongodb0.example.com:27017 - For a standalone that :doc:`enforces access control `: - .. code-block:: sh + .. code-block:: bash mongodb://myDBReader:D1fficultP%40ssw0rd@mongodb0.example.com:27017/?authSource=admin @@ -83,7 +83,7 @@ Examples - For a replica set: - .. code-block:: sh + .. code-block:: bash mongodb://mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?replicaSet=myRepl @@ -91,7 +91,7 @@ Examples `, include user credentials: - .. code-block:: sh + .. code-block:: bash mongodb://myDBReader:D1fficultP%40ssw0rd@mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?authSource=admin&replicaSet=myRepl @@ -108,7 +108,7 @@ Examples - For a sharded cluster: - .. code-block:: sh + .. code-block:: bash mongodb://mongos0.example.com:27017,mongos1.example.com:27017,mongos2.example.com:27017 @@ -116,7 +116,7 @@ Examples control `, include user credentials: - .. code-block:: sh + .. code-block:: bash mongodb://myDBReader:D1fficultP%40ssw0rd@mongos0.example.com:27017,mongos1.example.com:27017,mongos2.example.com:27017/?authSource=admin @@ -359,7 +359,7 @@ Replica Set Option The following connection string to a replica set named ``myRepl`` with members running on the specified hosts: -.. code-block:: sh +.. code-block:: bash mongodb://db0.example.com:27017,db1.example.com:27017,db2.example.com:27017/?replicaSet=myRepl @@ -961,7 +961,7 @@ The following connection string to a replica set specifies the :urioption:`authSource` to the ``admin`` database. That is, the user credentials are authenticated against the ``admin`` database. -.. code-block:: sh +.. code-block:: bash mongodb://myDBReader:D1fficultP%40ssw0rd@mongodb0.example.com:27017,mongodb1.example.com:27017,mongodb2.example.com:27017/?replicaSet=myRepl&authSource=admin diff --git a/source/reference/method/db.auth.txt b/source/reference/method/db.auth.txt index c7047fa9497..abb05102142 100644 --- a/source/reference/method/db.auth.txt +++ b/source/reference/method/db.auth.txt @@ -232,6 +232,6 @@ and :option:`--authenticationMechanism ` to specify authentication credentials when connecting the :binary:`~bin.mongo` shell: -.. code-block:: sh +.. code-block:: bash mongo --username "myTestDBUser" --password --authenticationDatabase test --authenticationMechanism SCRAM-SHA-256 diff --git a/source/reference/method/db.collection.createIndexes.txt b/source/reference/method/db.collection.createIndexes.txt index c3313e5b525..9676e260f76 100644 --- a/source/reference/method/db.collection.createIndexes.txt +++ b/source/reference/method/db.collection.createIndexes.txt @@ -791,7 +791,7 @@ The following example creates two indexes on the ``restaurants`` collection: an ascending index on the ``borough`` field and a :doc:`2dsphere ` index on the ``location`` field. -.. code-block:: sh +.. code-block:: bash db.restaurants.createIndexes([{"borough": 1}, {"location": "2dsphere"}]) diff --git a/source/reference/method/db.collection.getShardDistribution.txt b/source/reference/method/db.collection.getShardDistribution.txt index 2bc6df6d1db..3d3007ab305 100644 --- a/source/reference/method/db.collection.getShardDistribution.txt +++ b/source/reference/method/db.collection.getShardDistribution.txt @@ -124,7 +124,7 @@ The output information displays: - ```` is a calculated number that reports the number of chunks from all shards, for example: - .. code-block:: sh + .. code-block:: bash = + @@ -132,7 +132,7 @@ The output information displays: reflects, for each shard, the data size as the percentage of the collection's total data size, for example: - .. code-block:: sh + .. code-block:: bash = / @@ -141,7 +141,7 @@ The output information displays: percentage of the total number of documents for the collection, for example: - .. code-block:: sh + .. code-block:: bash = / diff --git a/source/reference/method/isInteractive.txt b/source/reference/method/isInteractive.txt index b53fbb7372c..792bc80a537 100644 --- a/source/reference/method/isInteractive.txt +++ b/source/reference/method/isInteractive.txt @@ -77,7 +77,7 @@ From a terminal/command-line prompt (i.e. not inside the :binary:`~bin.mongo` shell), specify the javascript file to the :binary:`~bin.mongo` shell to execute the file: -.. code-block:: sh +.. code-block:: bash mongo localhost:27017/test testExample.js diff --git a/source/reference/method/setVerboseShell.txt b/source/reference/method/setVerboseShell.txt index c455e78ec18..1e1888d24e2 100644 --- a/source/reference/method/setVerboseShell.txt +++ b/source/reference/method/setVerboseShell.txt @@ -32,13 +32,13 @@ The following example demonstrates the behavior of the verbose shell: #. From the :binary:`~bin.mongo` shell, set verbose shell to ``true``: - .. code-block:: sh + .. code-block:: bash setVerboseShell(true) #. With verbose shell set to ``true``, run :method:`db.collection.aggregate()`: - .. code-block:: sh + .. code-block:: bash db.restaurants.aggregate( [ @@ -51,7 +51,7 @@ The following example demonstrates the behavior of the verbose shell: :binary:`~bin.mongo` shell now displays information about the duration of the operation: - .. code-block:: sh + .. code-block:: bash { "_id" : "11377", "count" : 1 } { "_id" : "11368", "count" : 1 } diff --git a/source/reference/method/sh.addShard.txt b/source/reference/method/sh.addShard.txt index 72315efa239..cee7acb283d 100644 --- a/source/reference/method/sh.addShard.txt +++ b/source/reference/method/sh.addShard.txt @@ -39,7 +39,7 @@ Definition the shard's replica set. Any additional replica set member hostnames must be comma separated. For example: - .. code-block:: sh + .. code-block:: bash /<:port>,<:port>, ... diff --git a/source/reference/method/sh.status.txt b/source/reference/method/sh.status.txt index 4df54dc2450..3875f236dff 100644 --- a/source/reference/method/sh.status.txt +++ b/source/reference/method/sh.status.txt @@ -370,7 +370,7 @@ Databases The :data:`~sh.status.databases.version` displays the version information for the database: - .. code-block:: sh + .. code-block:: bash { "uuid" : UUID("cc250b66-8638-49f7-a2e8-c6f1220b9d7a"), "lastMod" : 1 } diff --git a/source/reference/mongodb-extended-json-v1.txt b/source/reference/mongodb-extended-json-v1.txt index e0c7fa4e654..9d528db60d8 100644 --- a/source/reference/mongodb-extended-json-v1.txt +++ b/source/reference/mongodb-extended-json-v1.txt @@ -303,13 +303,13 @@ Undefined Type You *cannot* use ``undefined`` in query documents. Consider the following document inserted into the ``people`` collection: - .. code-block:: sh + .. code-block:: bash db.people.insert( { name : "Sally", age : undefined } ) The following queries return an error: - .. code-block:: sh + .. code-block:: bash db.people.find( { age : undefined } ) db.people.find( { age : { $gte : undefined } } ) @@ -317,7 +317,7 @@ Undefined Type However, you can query for undefined values using :query:`$type`, as in: - .. code-block:: sh + .. code-block:: bash db.people.find( { age : { $type : 6 } } ) @@ -407,7 +407,7 @@ NumberLong For example, the following commands insert ``9223372036854775807`` as a ``NumberLong`` with and without quotation marks around the integer value: - .. code-block:: sh + .. code-block:: bash db.json.insert( { longQuoted : NumberLong("9223372036854775807") } ) db.json.insert( { longUnQuoted : NumberLong(9223372036854775807) } ) @@ -415,7 +415,7 @@ NumberLong When you retrieve the documents, the value of ``longUnQuoted`` has changed, while ``longQuoted`` retains its accuracy: - .. code-block:: sh + .. code-block:: bash db.json.find() { "_id" : ObjectId("54ee1f2d33335326d70987df"), "longQuoted" : NumberLong("9223372036854775807") } @@ -453,7 +453,7 @@ NumberDecimal For example, the following commands insert ``123.40`` as a ``NumberDecimal`` with and without quotation marks around the value: - .. code-block:: sh + .. code-block:: bash db.json.insert( { decimalQuoted : NumberDecimal("123.40") } ) db.json.insert( { decimalUnQuoted : NumberDecimal(123.40) } ) @@ -461,7 +461,7 @@ NumberDecimal When you retrieve the documents, the value of ``decimalUnQuoted`` has changed, while ``decimalQuoted`` retains its specified precision: - .. code-block:: sh + .. code-block:: bash db.json.find() { "_id" : ObjectId("596f88b7b613bb04f80a1ea9"), "decimalQuoted" : NumberDecimal("123.40") } diff --git a/source/reference/mongodb-wire-protocol.txt b/source/reference/mongodb-wire-protocol.txt index b06cc727c77..6738cd8e70b 100644 --- a/source/reference/mongodb-wire-protocol.txt +++ b/source/reference/mongodb-wire-protocol.txt @@ -574,7 +574,7 @@ database. This is necessary to ensure that database resources are reclaimed at the end of the query. The format of the OP_KILL_CURSORS message is: -.. code-block:: sh +.. code-block:: bash struct { MsgHeader header; // standard message header @@ -804,7 +804,7 @@ The ``OP_REPLY`` message is sent by the database in response to an :ref:`OP_QUERY ` or :ref:`OP_GET_MORE ` message. The format of an OP_REPLY message is: -.. code-block:: sh +.. code-block:: bash struct { MsgHeader header; // standard message header diff --git a/source/reference/operator/query/where.txt b/source/reference/operator/query/where.txt index 7d3e32a5a23..00f48cdf647 100644 --- a/source/reference/operator/query/where.txt +++ b/source/reference/operator/query/where.txt @@ -143,7 +143,7 @@ The following example uses :query:`$where` and the ``hex_md5()`` JavaScript function to compare the value of the ``name`` field to an MD5 hash and returns any matching document. -.. code-block:: sh +.. code-block:: bash db.players.find( { $where: function() { return (hex_md5(this.name) == "9b53e667f30cd329dca1ec9e6a83e994") @@ -151,7 +151,7 @@ MD5 hash and returns any matching document. The operation returns the following result: -.. code-block:: sh +.. code-block:: bash { "_id" : 2, diff --git a/source/reference/parameters.txt b/source/reference/parameters.txt index c8bd295de86..cce418988ba 100644 --- a/source/reference/parameters.txt +++ b/source/reference/parameters.txt @@ -33,7 +33,7 @@ using: - the ``--setParameter`` command-line option for :option:`mongod ` and :option:`mongos `: - .. code-block:: sh + .. code-block:: bash mongod --setParameter = mongos --setParameter = @@ -74,7 +74,7 @@ Authentication Parameters For example, to specify both ``PLAIN`` and ``SCRAM-SHA-256`` as the authentication mechanisms, use the following command: - .. code-block:: sh + .. code-block:: bash mongod --setParameter authenticationMechanisms=PLAIN,SCRAM-SHA-256 --auth @@ -89,7 +89,7 @@ Authentication Parameters .. include:: /includes/extracts/ssl-facts-see-more.rst - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, clusterAuthMode: "sendX509" } ) @@ -281,7 +281,7 @@ Authentication Parameters ``--setParameter`` option on the command line. For example, the following disables OCSP: - .. code-block:: sh + .. code-block:: bash mongod --setParameter ocspEnabled=false ... @@ -305,7 +305,7 @@ Authentication Parameters the ``--setParameter`` option on the command line. For example, the following sets the parameter to 3600 seconds: - .. code-block:: sh + .. code-block:: bash mongod --setParameter ocspValidationRefreshPeriodSecs=3600 ... @@ -349,13 +349,13 @@ Authentication Parameters :binary:`~bin.mongod` with a :parameter:`opensslCipherConfig` cipher string of ``'HIGH:!EXPORT:!aNULL@STRENGTH'`` in MongoDB 4.2: - .. code-block:: sh + .. code-block:: bash mongod --setParameter opensslCipherConfig='HIGH:!EXPORT:!aNULL@STRENGTH' --tlsMode requireTLS --tlsCertificateKeyFile Certs/server.pem For versions 4.0 and earlier: - .. code-block:: sh + .. code-block:: bash mongod --setParameter opensslCipherConfig='HIGH:!EXPORT:!aNULL@STRENGTH' --sslMode requireSSL --sslPEMKeyFile Certs/server.pem @@ -385,7 +385,7 @@ Authentication Parameters :parameter:`opensslCipherSuiteConfig` cipher suite of ``'TLS_AES_256_GCM_SHA384'`` for use with TLS 1.3: - .. code-block:: sh + .. code-block:: bash mongod --setParameter opensslCipherSuiteConfig='TLS_AES_256_GCM_SHA384' --tlsMode requireTLS --tlsCertificateKeyFile Certs/server.pem @@ -428,7 +428,7 @@ Authentication Parameters If for performance reasons, you need to disable support for DHE cipher suites, use the :parameter:`opensslCipherConfig` parameter: - .. code-block:: sh + .. code-block:: bash mongod --setParameter opensslCipherConfig='HIGH:!EXPORT:!aNULL:!DHE:!kDHE@STRENGTH' ... @@ -509,7 +509,7 @@ Authentication Parameters For example, the following sets the :parameter:`scramIterationCount` to ``12000``. - .. code-block:: sh + .. code-block:: bash mongod --setParameter scramIterationCount=12000 @@ -547,7 +547,7 @@ Authentication Parameters For example, the following sets the :parameter:`scramSHA256IterationCount` to ``20000``. - .. code-block:: sh + .. code-block:: bash mongod --setParameter scramSHA256IterationCount=20000 @@ -574,7 +574,7 @@ Authentication Parameters .. include:: /includes/extracts/ssl-facts-see-more.rst - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, sslMode: "preferSSL" } ) @@ -598,7 +598,7 @@ Authentication Parameters upgrade to TLS/SSL ` to minimize downtime. - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, tlsMode: "preferTLS" } ) @@ -628,7 +628,7 @@ Authentication Parameters following sets the :parameter:`tlsOCSPStaplingTimeoutSecs` to 20 seconds: - .. code-block:: sh + .. code-block:: bash mongod --setParameter tlsOCSPStaplingTimeoutSecs=20 ... @@ -658,7 +658,7 @@ Authentication Parameters following sets the :parameter:`tlsOCSPVerifyTimeoutSecs` to 20 seconds: - .. code-block:: sh + .. code-block:: bash mongod --setParameter tlsOCSPVerifyTimeoutSecs=20 ... @@ -874,7 +874,7 @@ General Parameters You can only set :parameter:`connPoolMaxShardedConnsPerHost` during startup in the config file or on the command line. For example: - .. code-block:: sh + .. code-block:: bash mongos --setParameter connPoolMaxShardedConnsPerHost=250 @@ -893,7 +893,7 @@ General Parameters You can only set :parameter:`connPoolMaxShardedConnsPerHost` during startup in the config file or on the command line. For example: - .. code-block:: sh + .. code-block:: bash mongos --setParameter connPoolMaxShardedInUseConnsPerHost=100 @@ -915,7 +915,7 @@ General Parameters You can only set :parameter:`shardedConnPoolIdleTimeoutMinutes` during startup in the config file or on the command line. For example: - .. code-block:: sh + .. code-block:: bash mongos --setParameter shardedConnPoolIdleTimeoutMinutes=10 @@ -946,7 +946,7 @@ General Parameters You can only set :parameter:`connPoolMaxConnsPerHost` during startup in the config file or on the command line. For example: - .. code-block:: sh + .. code-block:: bash mongod --setParameter connPoolMaxConnsPerHost=250 @@ -965,7 +965,7 @@ General Parameters You can only set :parameter:`connPoolMaxInUseConnsPerHost` during startup in the config file or on the command line. For example: - .. code-block:: sh + .. code-block:: bash mongod --setParameter connPoolMaxInUseConnsPerHost=100 @@ -988,7 +988,7 @@ General Parameters during startup in the config file or on the command line. For example: - .. code-block:: sh + .. code-block:: bash mongos --setParameter globalConnPoolIdleTimeoutMinutes=10 @@ -1009,7 +1009,7 @@ General Parameters For example, the following sets the :parameter:`cursorTimeoutMillis` to ``300000`` milliseconds (5 minutes). - .. code-block:: sh + .. code-block:: bash mongod --setParameter cursorTimeoutMillis=300000 @@ -1077,7 +1077,7 @@ General Parameters You can also set :parameter:`failIndexKeyTooLong` at startup with the following option: - .. code-block:: sh + .. code-block:: bash mongod --setParameter failIndexKeyTooLong=false @@ -1132,7 +1132,7 @@ General Parameters Alternately, you may disable the thread at startup time by starting the :binary:`~bin.mongod` instance with the following option: - .. code-block:: sh + .. code-block:: bash mongod --setParameter ttlMonitorEnabled=false @@ -1300,7 +1300,7 @@ General Parameters Alternately, you may enable the JIT at startup time by starting the :binary:`~bin.mongod` instance with the following option: - .. code-block:: sh + .. code-block:: bash mongod --setParameter disableJavaScriptJIT=false @@ -1343,7 +1343,7 @@ General Parameters :parameter:`reportOpWriteConcernCountersInServerStatus` during startup in the config file or on the command line. For example: - .. code-block:: sh + .. code-block:: bash mongod --setParameter reportOpWriteConcernCountersInServerStatus=true @@ -1407,7 +1407,7 @@ General Parameters To enable :ref:`Storage Node Watchdog `, :parameter:`watchdogPeriodSeconds` must be set during startup. - .. code-block:: sh + .. code-block:: bash mongod --setParameter watchdogPeriodSeconds=60 @@ -1468,7 +1468,7 @@ General Parameters You can also set :parameter:`tcmallocReleaseRate` at startup time; for example: - .. code-block:: sh + .. code-block:: bash mongod --setParameter "tcmallocReleaseRate=5.0" @@ -1600,7 +1600,7 @@ Logging Parameters You can also set parameter :parameter:`logComponentVerbosity` at startup time, passing the verbosity level document as a string. - .. code-block:: sh + .. code-block:: bash mongod --setParameter "logComponentVerbosity={command: 3}" @@ -1647,7 +1647,7 @@ Logging Parameters The following example sets the maximum log line size to ``20`` kilobytes: - .. code-block:: sh + .. code-block:: bash mongod --setParameter maxLogSizeKB=20 @@ -1752,7 +1752,7 @@ Logging Parameters The following operation sets ``suppressNoTLSPeerCertificateWarning`` to ``true``: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, suppressNoTLSPeerCertificateWarning: true} ) @@ -1810,7 +1810,7 @@ The following parameters support diagnostic data capture (FTDC): For example, the following disables the diagnostic collection: - .. code-block:: sh + .. code-block:: bash mongod --setParameter diagnosticDataCollectionEnabled=false @@ -1869,7 +1869,7 @@ The following parameters support diagnostic data capture (FTDC): For example, the following sets the maximum size of the directory to ``250`` megabytes: - .. code-block:: sh + .. code-block:: bash mongod --setParameter diagnosticDataCollectionDirectorySizeMB=250 @@ -1899,7 +1899,7 @@ The following parameters support diagnostic data capture (FTDC): For example, the following sets the maximum size of each diagnostic file to ``20`` megabytes: - .. code-block:: sh + .. code-block:: bash mongod --setParameter diagnosticDataCollectionFileSizeMB=20 @@ -1924,7 +1924,7 @@ The following parameters support diagnostic data capture (FTDC): For example, the following sets the interval to ``5000`` milliseconds or 5 seconds: - .. code-block:: sh + .. code-block:: bash mongod --setParameter diagnosticDataCollectionPeriodMillis=5000 @@ -1958,7 +1958,7 @@ Logical Session For example, to set the :parameter:`logicalSessionRefreshMillis` for a :binary:`~bin.mongod` instance to 10 minutes: - .. code-block:: sh + .. code-block:: bash mongod --setParameter logicalSessionRefreshMillis=600000 @@ -1993,7 +1993,7 @@ Logical Session For example, to set the :parameter:`localLogicalSessionTimeoutMinutes` for a test :binary:`~bin.mongod` instance to 20 minutes: - .. code-block:: sh + .. code-block:: bash mongod --setParameter localLogicalSessionTimeoutMinutes=20 @@ -2024,7 +2024,7 @@ Logical Session For example, to set the :parameter:`maxAcceptableLogicalClockDriftSecs` for a :binary:`~bin.mongod` instance to 15 minutes: - .. code-block:: sh + .. code-block:: bash mongod --setParameter maxAcceptableLogicalClockDriftSecs=900 @@ -2045,7 +2045,7 @@ Logical Session For example, to set the :parameter:`maxSessions` for a :binary:`~bin.mongod` instance to 1000: - .. code-block:: sh + .. code-block:: bash mongod --setParameter maxSessions=1000 @@ -2070,7 +2070,7 @@ Logical Session For example, to set the :parameter:`TransactionRecordMinimumLifetimeMinutes` for a :binary:`~bin.mongod` instance to 20 minutes: - .. code-block:: sh + .. code-block:: bash mongod --setParameter TransactionRecordMinimumLifetimeMinutes=20 @@ -2288,7 +2288,7 @@ Logical Session The following example sets the :parameter:`waitForSecondaryBeforeNoopWriteMS` to 20 milliseconds: - .. code-block:: sh + .. code-block:: bash mongod --setParameter waitForSecondaryBeforeNoopWriteMS=20 @@ -2326,7 +2326,7 @@ Logical Session During runtime, you can also set the parameter with the :dbcommand:`setParameter` command: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, createRollbackDataFiles: false } ) @@ -2384,7 +2384,7 @@ Logical Session During runtime, you can also set the parameter with the :dbcommand:`setParameter` command: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, replBatchLimitBytes: 64 * 1024 * 1024 } ) @@ -2472,7 +2472,7 @@ Logical Session For example, the following sets the mirror reads sampling rate to ``0.10`` from the command line: - .. code-block:: sh + .. code-block:: bash mongod --setParameter mirrorReads='{ samplingRate: 0.10 }' @@ -2569,7 +2569,7 @@ Sharding Parameters During runtime, you can also set the parameter with the :dbcommand:`setParameter` command: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, enableShardedIndexConsistencyCheck: false } ) @@ -2629,7 +2629,7 @@ Sharding Parameters You can only set this parameter during start-up and cannot change this setting using the :dbcommand:`setParameter` database command. - .. code-block:: sh + .. code-block:: bash mongod --setParameter enableFinerGrainedCatalogCacheRefresh=true mongos --setParameter enableFinerGrainedCatalogCacheRefresh=true @@ -2659,7 +2659,7 @@ Sharding Parameters For example, to set the limit to 200 milliseconds, you can issue the following during startup: - .. code-block:: sh + .. code-block:: bash mongos --setParameter maxTimeMSForHedgedReads=200 @@ -2716,7 +2716,7 @@ Sharding Parameters :binary:`~bin.mongos` instance, you can issue the following during startup: - .. code-block:: sh + .. code-block:: bash mongos --setParameter readHedgingMode=off @@ -2750,7 +2750,7 @@ Sharding Parameters For example, to set the time to 250 milliseconds, you can issue the following during startup: - .. code-block:: sh + .. code-block:: bash mongod --setParameter shutdownTimeoutMillisForSignaledShutdown=250 @@ -2779,7 +2779,7 @@ Sharding Parameters For example, to set the time to 250 milliseconds, you can issue the following during startup: - .. code-block:: sh + .. code-block:: bash mongos --setParameter mongosShutdownTimeoutMillisForSignaledShutdown=250 @@ -2862,7 +2862,7 @@ Sharding Parameters :parameter:`ShardingTaskExecutorPoolHostTimeoutMS` to be greater than the sum. - .. code-block:: sh + .. code-block:: bash mongos --setParameter ShardingTaskExecutorPoolHostTimeoutMS=120000 @@ -2890,7 +2890,7 @@ Sharding Parameters You can only set this parameter during start-up and cannot change this setting using the :dbcommand:`setParameter` database command. - .. code-block:: sh + .. code-block:: bash mongos --setParameter ShardingTaskExecutorPoolMaxConnecting=20 @@ -2914,7 +2914,7 @@ Sharding Parameters You can only set this parameter during start-up and cannot change this setting using the :dbcommand:`setParameter` database command. - .. code-block:: sh + .. code-block:: bash mongos --setParameter ShardingTaskExecutorPoolMaxSize=4 @@ -2959,7 +2959,7 @@ Sharding Parameters You can only set this parameter during start-up and cannot change this setting using the :dbcommand:`setParameter` database command. - .. code-block:: sh + .. code-block:: bash mongos --setParameter ShardingTaskExecutorPoolMinSize=2 @@ -2992,7 +2992,7 @@ Sharding Parameters :parameter:`ShardingTaskExecutorPoolRefreshTimeoutMS` to be less than :parameter:`ShardingTaskExecutorPoolRefreshRequirementMS`. - .. code-block:: sh + .. code-block:: bash mongos --setParameter ShardingTaskExecutorPoolRefreshRequirementMS=90000 @@ -3016,7 +3016,7 @@ Sharding Parameters :parameter:`ShardingTaskExecutorPoolRefreshTimeoutMS` to be less than :parameter:`ShardingTaskExecutorPoolRefreshRequirementMS`. - .. code-block:: sh + .. code-block:: bash mongos --setParameter ShardingTaskExecutorPoolRefreshTimeoutMS=30000 @@ -3139,7 +3139,7 @@ Sharding Parameters :parameter:`ShardingTaskExecutorPoolReplicaSetMatching` to ``"automatic"`` during startup: - .. code-block:: sh + .. code-block:: bash mongod --setParameter ShardingTaskExecutorPoolReplicaSetMatching="automatic" @@ -3190,7 +3190,7 @@ Sharding Parameters You can only set this parameter during start-up and cannot change this setting using the :dbcommand:`setParameter` database command. - .. code-block:: sh + .. code-block:: bash mongos --setParameter taskExecutorPoolSize=6 @@ -3318,7 +3318,7 @@ Sharding Parameters The following sets the :parameter:`migrateCloneInsertionBatchDelayMS` to 200 milliseconds: - .. code-block:: sh + .. code-block:: bash mongod --setParameter migrateCloneInsertionBatchDelayMS=200 @@ -3351,7 +3351,7 @@ Sharding Parameters The following sets the :parameter:`migrateCloneInsertionBatchSize` to 100 documents: - .. code-block:: sh + .. code-block:: bash mongod --setParameter migrateCloneInsertionBatchSize=100 @@ -3395,7 +3395,7 @@ Sharding Parameters The following sets the :parameter:`orphanCleanupDelaySecs` to 20 minutes: - .. code-block:: sh + .. code-block:: bash mongod --setParameter orphanCleanupDelaySecs=1200 @@ -3435,7 +3435,7 @@ Sharding Parameters The following sets the :parameter:`rangeDeleterBatchDelayMS` to 200 milliseconds: - .. code-block:: sh + .. code-block:: bash mongod --setParameter rangeDeleterBatchDelayMS=200 @@ -3467,7 +3467,7 @@ Sharding Parameters The following example sets :parameter:`rangeDeleterBatchSize` to 32 documents: - .. code-block:: sh + .. code-block:: bash mongod --setParameter rangeDeleterBatchSize=32 @@ -3496,7 +3496,7 @@ Sharding Parameters You can only set this parameter during start-up and cannot change this setting using the :dbcommand:`setParameter` database command. - .. code-block:: sh + .. code-block:: bash mongod --setParameter skipShardingConfigurationChecks=true @@ -3538,7 +3538,7 @@ Storage Parameters You can only set this parameter during start-up and cannot change this setting using the :dbcommand:`setParameter` database command. - .. code-block:: sh + .. code-block:: bash mongod --setParameter honorSystemUmask=true @@ -3615,7 +3615,7 @@ Storage Parameters and other users to read/write only and retains the system ``umask`` settings for the owner: - .. code-block:: sh + .. code-block:: bash mongod --setParameter processUmask=011 @@ -3832,7 +3832,7 @@ Transaction Parameters During runtime, you can also set the parameter with the :dbcommand:`setParameter` command: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, coordinateCommitReturnImmediatelyAfterPersistingDecision: false } ) @@ -3867,7 +3867,7 @@ Transaction Parameters You can also set parameter :parameter:`transactionLifetimeLimitSeconds` at startup time. - .. code-block:: sh + .. code-block:: bash mongod --setParameter "transactionLifetimeLimitSeconds=30" @@ -3922,7 +3922,7 @@ Transaction Parameters You can also set this parameter during start-up: - .. code-block:: sh + .. code-block:: bash mongod --setParameter maxTransactionLockRequestTimeoutMillis=20 @@ -3953,7 +3953,7 @@ Transaction Parameters :setting:`configuration file ` or with the ``--setParameter`` option on the command line. For example: - .. code-block:: sh + .. code-block:: bash mongod --setParameter shouldMultiDocTxnCreateCollectionAndIndexes=false diff --git a/source/reference/program/install_compass.txt b/source/reference/program/install_compass.txt index 53e5705dd89..92277c0102b 100644 --- a/source/reference/program/install_compass.txt +++ b/source/reference/program/install_compass.txt @@ -58,14 +58,14 @@ is packaged with the download for each platform. download directory: - .. code-block:: sh + .. code-block:: bash cd /bin 2. Install |compass| using the ``install_compass`` script: - .. code-block:: sh + .. code-block:: bash ./install_compass diff --git a/source/reference/program/mongo.txt b/source/reference/program/mongo.txt index ae18a11c8d5..97c86392999 100644 --- a/source/reference/program/mongo.txt +++ b/source/reference/program/mongo.txt @@ -46,7 +46,7 @@ Syntax - You can run :binary:`~bin.mongo` shell without any command-line options use the default settings: - .. code-block:: sh + .. code-block:: bash mongo @@ -55,7 +55,7 @@ Syntax other connection options. For example, the following includes the :urioption:`tls`: - .. code-block:: sh + .. code-block:: bash mongo "mongodb://mongodb0.example.com:27017/testdb?tls=true" @@ -66,7 +66,7 @@ Syntax specify in the :doc:`connection string ` the replica set members and name: - .. code-block:: sh + .. code-block:: bash mongo "mongodb://mongodb0.example.com.local:27017,mongodb1.example.com.local:27017,mongodb2.example.com.local:27017/?replicaSet=replA" @@ -76,7 +76,7 @@ Syntax - You can run :binary:`~bin.mongo` shell with various command-line options. For example: - .. code-block:: sh + .. code-block:: bash mongo --host mongodb0.example.com:27017 [additional options] @@ -291,7 +291,7 @@ Core Options Specifies the name of the database to connect to. For example: - .. code-block:: sh + .. code-block:: bash mongo admin @@ -395,7 +395,7 @@ Core Options :option:`--username` and :option:`--password` as the last options, as in the following: - .. code-block:: sh + .. code-block:: bash mongo file.js --username username --password @@ -1218,13 +1218,13 @@ Connect to a :binary:`~bin.mongod` Instance with Access Control To connect to a database on a remote host using authentication and a non-standard port, use the following form: -.. code-block:: sh +.. code-block:: bash mongo --username --password --host --port 28015 Alternatively, consider the following short form: -.. code-block:: sh +.. code-block:: bash mongo -u -p --host --port 28015 @@ -1378,14 +1378,14 @@ Execute JavaScript Against the :binary:`~bin.mongo` Shell To execute a JavaScript file without evaluating the :file:`~/.mongorc.js` file before starting a shell session, use the following form: -.. code-block:: sh +.. code-block:: bash mongo --shell --norc alternate-environment.js To execute a JavaScript file with authentication, with password prompted rather than provided on the command-line, use the following form: -.. code-block:: sh +.. code-block:: bash mongo script-file.js -u -p @@ -1405,14 +1405,14 @@ which queries a collection and prints the results as JSON. On Linux and macOS, you will need to use single quotes (e.g. ``'``) to enclose the JavaScript, using the following form: -.. code-block:: sh +.. code-block:: bash mongo --eval 'db.collection.find().forEach(printjson)' On Windows, you will need to use double quotes (e.g. ``"``) to enclose the JavaScript, using the following form: -.. code-block:: sh +.. code-block:: bash mongo --eval "db.collection.find().forEach(printjson)" diff --git a/source/reference/program/mongod.txt b/source/reference/program/mongod.txt index 0748ed67d0c..4d9c0016d0d 100644 --- a/source/reference/program/mongod.txt +++ b/source/reference/program/mongod.txt @@ -775,7 +775,7 @@ Core Options .. include:: /includes/fact-timeZoneInfo.rst - .. code-block:: sh + .. code-block:: bash wget https://downloads.mongodb.org/olson_tz_db/timezonedb-latest.zip unzip timezonedb-latest.zip diff --git a/source/reference/program/mongos.txt b/source/reference/program/mongos.txt index b128a63a08b..7be2ee2475b 100644 --- a/source/reference/program/mongos.txt +++ b/source/reference/program/mongos.txt @@ -605,7 +605,7 @@ Core Options .. include:: /includes/fact-timeZoneInfo.rst - .. code-block:: sh + .. code-block:: bash wget https://downloads.mongodb.org/olson_tz_db/timezonedb-latest.zip unzip timezonedb-latest.zip diff --git a/source/reference/replica-set-protocol-versions.txt b/source/reference/replica-set-protocol-versions.txt index c49dff170f7..16e6f4fe6aa 100644 --- a/source/reference/replica-set-protocol-versions.txt +++ b/source/reference/replica-set-protocol-versions.txt @@ -120,7 +120,7 @@ To change the replica set protocol version, reconfigure a :binary:`~bin.mongo` shell to the current primary and perform the following sequence of operations: -.. code-block:: sh +.. code-block:: bash cfg = rs.conf(); cfg.protocolVersion=1; diff --git a/source/reference/ulimit.txt b/source/reference/ulimit.txt index 8e805398965..c2eb8b0073c 100644 --- a/source/reference/ulimit.txt +++ b/source/reference/ulimit.txt @@ -84,7 +84,7 @@ Review and Set Resource Limits You can use the ``ulimit`` command at the system prompt to check system limits, as in the following example: -.. code-block:: sh +.. code-block:: bash $ ulimit -a -t: cpu time (seconds) unlimited @@ -115,7 +115,7 @@ threads. On Linux, you can change ``ulimit`` settings by issuing a command in the following form: -.. code-block:: sh +.. code-block:: bash ulimit -n @@ -234,7 +234,7 @@ using ``limit`` `stanzas `_. Specify the :ref:`recommended-ulimit-settings`, as in the following example: -.. code-block:: sh +.. code-block:: bash limit fsize unlimited unlimited # (file size) limit cpu unlimited unlimited # (cpu time) @@ -250,7 +250,7 @@ After changing ``limit`` stanzas, ensure that the changes take effect by restarting the application services, using the following form: -.. code-block:: sh +.. code-block:: bash restart @@ -267,7 +267,7 @@ by using `resource limit directives Specify the :ref:`recommended-ulimit-settings`, as in the following example: -.. code-block:: sh +.. code-block:: bash [Service] # Other directives omitted @@ -291,7 +291,7 @@ After changing ``limit`` stanzas, ensure that the changes take effect by restarting the application services, using the following form: -.. code-block:: sh +.. code-block:: bash systemctl restart @@ -316,7 +316,7 @@ is the process's :term:`PID` or process identifier. You can use the following ``bash`` function to return the content of the ``limits`` object for a process or processes with a given name: -.. code-block:: sh +.. code-block:: bash return-limits(){ @@ -340,7 +340,7 @@ You can copy and paste this function into a current shell session or load it as part of a script. Call the function with one the following invocations: -.. code-block:: sh +.. code-block:: bash return-limits mongod return-limits mongos diff --git a/source/release-notes/2.2.txt b/source/release-notes/2.2.txt index 9c3e6ff1694..ab2131f2ab2 100644 --- a/source/release-notes/2.2.txt +++ b/source/release-notes/2.2.txt @@ -526,7 +526,7 @@ This permits tools like ``mongooplog`` and :binary:`~bin.mongodump` to query for specific timestamps. Consider the following :binary:`~bin.mongodump` operation: -.. code-block:: sh +.. code-block:: bash mongodump --db local --collection oplog.rs --query '{"ts":{"$gt":{"$timestamp" : {"t": 1344969612000, "i": 1 }}}}' --out oplog-dump @@ -610,7 +610,7 @@ code base. If you want to build MongoDB binaries using system Boost libraries, you can pass ``scons`` using the ``--use-system-boost`` flag, as follows: -.. code-block:: sh +.. code-block:: bash scons --use-system-boost @@ -618,7 +618,7 @@ When building MongoDB, you can also pass ``scons`` a flag to compile MongoDB using only system libraries rather than the included versions of the libraries. For example: -.. code-block:: sh +.. code-block:: bash scons --use-system-all diff --git a/source/release-notes/2.4-upgrade.txt b/source/release-notes/2.4-upgrade.txt index 3ec81e7547a..5e4f50a00ee 100644 --- a/source/release-notes/2.4-upgrade.txt +++ b/source/release-notes/2.4-upgrade.txt @@ -238,7 +238,7 @@ operations. Start the :binary:`~bin.mongos` with a command that resembles the following: - .. code-block:: sh + .. code-block:: bash mongos --configdb --upgrade @@ -275,7 +275,7 @@ operations. connect to a 2.2 :binary:`~bin.mongos` process and force the lock manually: - .. code-block:: sh + .. code-block:: bash mongo @@ -386,7 +386,7 @@ To resync the config servers: connecting to the 2.2 :binary:`~bin.mongos` with the :binary:`~bin.mongo` shell: - .. code-block:: sh + .. code-block:: bash mongo @@ -544,7 +544,7 @@ replacement: - stop the existing :binary:`~bin.mongod`, using the :option:`--shutdown ` option as follows: - .. code-block:: sh + .. code-block:: bash mongod --dbpath /var/mongod/data --shutdown @@ -553,7 +553,7 @@ replacement: - start the new :binary:`~bin.mongod` processes with the same :setting:`~storage.dbPath` setting, for example: - .. code-block:: sh + .. code-block:: bash mongod --dbpath /var/mongod/data @@ -569,7 +569,7 @@ If you have created ``2dsphere`` or ``text`` indexes while running a starting the ``2.2`` :binary:`~bin.mongod` with the :option:`--upgrade ` option as follows: -.. code-block:: sh +.. code-block:: bash mongod --dbpath /var/mongod/data/ --upgrade diff --git a/source/release-notes/3.2-compatibility.txt b/source/release-notes/3.2-compatibility.txt index c4f2f9073d6..077353633d7 100644 --- a/source/release-notes/3.2-compatibility.txt +++ b/source/release-notes/3.2-compatibility.txt @@ -34,7 +34,7 @@ storage engine setting either: - On the command line with the ``--storageEngine`` option: - .. code-block:: sh + .. code-block:: bash mongod --storageEngine mmapv1 diff --git a/source/release-notes/3.2.txt b/source/release-notes/3.2.txt index e25c012dcb6..0af342e0578 100644 --- a/source/release-notes/3.2.txt +++ b/source/release-notes/3.2.txt @@ -460,7 +460,7 @@ engine setting either: - On the command line with the ``--storageEngine`` option: - .. code-block:: sh + .. code-block:: bash mongod --storageEngine mmapv1 diff --git a/source/release-notes/4.0.txt b/source/release-notes/4.0.txt index 557579762d8..f4612aec254 100644 --- a/source/release-notes/4.0.txt +++ b/source/release-notes/4.0.txt @@ -1017,7 +1017,7 @@ Before upgrading to MongoDB 4.0, you must upgrade to :rsconf:`pv1 To upgrade to ``pv1``, connect a :binary:`~bin.mongo` shell to the replica set primary and perform the following sequence of operations: -.. code-block:: sh +.. code-block:: bash cfg = rs.conf(); cfg.protocolVersion=1; @@ -1315,14 +1315,14 @@ you can specify the connection string in: - The ``MONGOREPLAY_HOST`` environment variable: - .. code-block:: sh + .. code-block:: bash export MONGOREPLAY_HOST="mongodb://myUserName:s0meD1fficultPassw0rd@mongodb1.example.net:27017/?authSource=admin" mongoreplay play -p /some/path/to/my/recording.bson - The ``--host`` command-line option: - .. code-block:: sh + .. code-block:: bash mongoreplay play -p /some/path/to/my/recording.bson --host "mongodb://myUserName:s0meD1fficultPassw0rd@mongodb1.example.net:27017/?authSource=admin" diff --git a/source/release-notes/4.2-downgrade-replica-set.txt b/source/release-notes/4.2-downgrade-replica-set.txt index a4a0d2a0ba0..cfa83735b29 100644 --- a/source/release-notes/4.2-downgrade-replica-set.txt +++ b/source/release-notes/4.2-downgrade-replica-set.txt @@ -233,7 +233,7 @@ If the member uses ``zstd`` for journal compression only, - If you are using a configuration file: - .. code-block:: sh + .. code-block:: bash mongod -f @@ -251,7 +251,7 @@ If the member uses ``zstd`` for journal compression only, to ``true`` in the :option:`--setParameter ` option. - .. code-block:: sh + .. code-block:: bash mongod --nojournal --setParameter disableLogicalSessionCacheRefresh=true ... @@ -297,7 +297,7 @@ If the member uses ``zstd`` for journal compression only, - If you are using a configuration file: - .. code-block:: sh + .. code-block:: bash mongod -f @@ -316,7 +316,7 @@ If the member uses ``zstd`` for journal compression only, - Remove the ``disableLogicalSessionCacheRefresh`` parameter. - .. code-block:: sh + .. code-block:: bash mongod --wiredTigerJournalCompressor --replSet ... diff --git a/source/release-notes/4.2-downgrade-sharded-cluster.txt b/source/release-notes/4.2-downgrade-sharded-cluster.txt index 5c67d84f617..1cc38f86112 100644 --- a/source/release-notes/4.2-downgrade-sharded-cluster.txt +++ b/source/release-notes/4.2-downgrade-sharded-cluster.txt @@ -216,7 +216,7 @@ If the member only uses ``zstd`` for journal compression only, - If you are using a configuration file: - .. code-block:: sh + .. code-block:: bash mongod -f @@ -242,7 +242,7 @@ If the member only uses ``zstd`` for journal compression only, - Explicitly include :option:`--port ` set to the instance's current port. - .. code-block:: sh + .. code-block:: bash mongod --nojournal --setParameter skipShardingConfigurationChecks=true --setParameter disableLogicalSessionCacheRefresh=true --port ... @@ -296,7 +296,7 @@ If the member only uses ``zstd`` for journal compression only, - If you are using a configuration file: - .. code-block:: sh + .. code-block:: bash mongod -f @@ -321,7 +321,7 @@ If the member only uses ``zstd`` for journal compression only, ` as well as any additional options for your replica set member. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --wiredTigerJournalCompressor --replSet ... diff --git a/source/release-notes/4.2-downgrade-standalone.txt b/source/release-notes/4.2-downgrade-standalone.txt index b1bd06e0cd3..bc2691f9025 100644 --- a/source/release-notes/4.2-downgrade-standalone.txt +++ b/source/release-notes/4.2-downgrade-standalone.txt @@ -137,7 +137,7 @@ If your standalone has any data using :term:`zstd` compression: starting the downgrade; :binary:`~bin.mongodump` outputs uncompressed data. - .. code-block:: sh + .. code-block:: bash mongodump --host= --port= --out=mystandalone.uncompressed.fcv4.0 diff --git a/source/tutorial/access-mongo-shell-help.txt b/source/tutorial/access-mongo-shell-help.txt index 6eac2818d86..1486ac76d91 100644 --- a/source/tutorial/access-mongo-shell-help.txt +++ b/source/tutorial/access-mongo-shell-help.txt @@ -27,7 +27,7 @@ Command Line Help To see the list of options and help for starting the :binary:`~bin.mongo` shell, use the :option:`--help ` option from the command line: -.. code-block:: sh +.. code-block:: bash mongo --help diff --git a/source/tutorial/add-replica-set-arbiter.txt b/source/tutorial/add-replica-set-arbiter.txt index c80f27545b8..5201952c5f9 100644 --- a/source/tutorial/add-replica-set-arbiter.txt +++ b/source/tutorial/add-replica-set-arbiter.txt @@ -85,7 +85,7 @@ Add an Arbiter configuration data. The directory *will not* hold the data set. For example, create the ``/var/lib/mongodb/arb`` directory: - .. code-block:: sh + .. code-block:: bash mkdir /var/lib/mongodb/arb @@ -95,7 +95,7 @@ Add an Arbiter .. include:: /includes/warning-bind-ip-security-considerations.rst - .. code-block:: sh + .. code-block:: bash mongod --port 27017 --dbpath /var/lib/mongodb/arb --replSet rs --bind_ip localhost, diff --git a/source/tutorial/add-shards-to-shard-cluster.txt b/source/tutorial/add-shards-to-shard-cluster.txt index a2baf7378f1..85d437da747 100644 --- a/source/tutorial/add-shards-to-shard-cluster.txt +++ b/source/tutorial/add-shards-to-shard-cluster.txt @@ -45,7 +45,7 @@ instance. ``mongos0.example.net`` on port ``27017``, issue the following command: - .. code-block:: sh + .. code-block:: bash mongo --host mongos0.example.net --port 27017 diff --git a/source/tutorial/backup-and-restore-tools.txt b/source/tutorial/backup-and-restore-tools.txt index a474d5c5614..7fdf1ca3184 100644 --- a/source/tutorial/backup-and-restore-tools.txt +++ b/source/tutorial/backup-and-restore-tools.txt @@ -112,7 +112,7 @@ To backup data from a :binary:`~bin.mongod` instance running on the same machine and on the default port of ``27017``, use the following command: -.. code-block:: sh +.. code-block:: bash mongodump @@ -120,7 +120,7 @@ You can also specify the :option:`--host ` and :option:`--port ` of the MongoDB instance that the :binary:`~bin.mongodump` should connect to. For example: -.. code-block:: sh +.. code-block:: bash mongodump --host=mongodb.example.net --port=27017 @@ -132,7 +132,7 @@ information. To specify a different output directory, you can use the :option:`--out or -o ` option: -.. code-block:: sh +.. code-block:: bash mongodump --out=/data/backup/ @@ -175,7 +175,7 @@ The :option:`--host ` and :binary:`~bin.mongodump` allow you to connect to and backup from a remote host. Consider the following example: -.. code-block:: sh +.. code-block:: bash mongodump --host=mongodb1.example.net --port=3017 --username=user --password="pass" --out=/opt/backup/mongodump-2013-10-24 @@ -221,14 +221,14 @@ or a subset of the backup. To use :binary:`~bin.mongorestore` to connect to an active :binary:`~bin.mongod`, use a command with the following prototype form: -.. code-block:: sh +.. code-block:: bash mongorestore --port= Consider the following example: -.. code-block:: sh +.. code-block:: bash mongorestore dump-2013-10-25/ @@ -247,7 +247,7 @@ If you created your database dump using the :option:`--oplog :option:`--oplogReplay ` option, as in the following example: -.. code-block:: sh +.. code-block:: bash mongorestore --oplogReplay @@ -270,7 +270,7 @@ The following example that specifies the :option:`--host ` and :option:`--port ` options: -.. code-block:: sh +.. code-block:: bash mongorestore --host=mongodb1.example.net --port=3017 @@ -281,7 +281,7 @@ If restoring to an instance that enforces access control, include the :option:`--password ` option to have :binary:`~bin.mongorestore` prompt for the password: -.. code-block:: sh +.. code-block:: bash mongorestore --host=mongodb1.example.net --port=3017 --username=user --authenticationDatabase=admin /opt/backup/mongodump-2013-10-24 diff --git a/source/tutorial/backup-with-filesystem-snapshots.txt b/source/tutorial/backup-with-filesystem-snapshots.txt index 03e97fe5992..15f6a84f5dd 100644 --- a/source/tutorial/backup-with-filesystem-snapshots.txt +++ b/source/tutorial/backup-with-filesystem-snapshots.txt @@ -172,7 +172,7 @@ Create a Snapshot To create a snapshot with :term:`LVM`, issue a command as root in the following format: -.. code-block:: sh +.. code-block:: bash lvcreate --size 100M --snapshot --name mdb-snap01 /dev/vg0/mongodb @@ -218,7 +218,7 @@ separate storage. Your system might try to compress the backup images as you move them offline. Alternatively, take a block level copy of the snapshot image, such as with the following procedure: -.. code-block:: sh +.. code-block:: bash umount /dev/vg0/mdb-snap01 dd if=/dev/vg0/mdb-snap01 | gzip > mdb-snap01.gz @@ -247,7 +247,7 @@ Restore a Snapshot To restore a snapshot created with :term:`LVM`, issue the following sequence of commands: -.. code-block:: sh +.. code-block:: bash lvcreate --size 1G --name mdb-new vg0 gzip -d -c mdb-snap01.gz | dd of=/dev/vg0/mdb-new @@ -291,7 +291,7 @@ Restore Directly from a Snapshot To restore a backup without writing to a compressed ``gz`` file, use the following sequence of commands: -.. code-block:: sh +.. code-block:: bash umount /dev/vg0/mdb-snap01 lvcreate --size 1G --name mdb-new vg0 @@ -311,7 +311,7 @@ archives and compresses the backup on a remote system using SSH. Consider the following procedure: -.. code-block:: sh +.. code-block:: bash umount /dev/vg0/mdb-snap01 dd if=/dev/vg0/mdb-snap01 | ssh username@example.com gzip > /opt/backup/mdb-snap01.gz diff --git a/source/tutorial/build-indexes-on-replica-sets.txt b/source/tutorial/build-indexes-on-replica-sets.txt index e7d17b08f07..2751e150778 100644 --- a/source/tutorial/build-indexes-on-replica-sets.txt +++ b/source/tutorial/build-indexes-on-replica-sets.txt @@ -118,7 +118,7 @@ Restart after making the following configuration updates: And restart: - .. code-block:: sh + .. code-block:: bash mongod --config @@ -144,7 +144,7 @@ Restart after making the following configuration updates: and set ``disableLogicalSessionCacheRefresh`` parameter to true: - .. code-block:: sh + .. code-block:: bash mongod --port 27217 --setParameter disableLogicalSessionCacheRefresh=true @@ -168,7 +168,7 @@ For example, connect a :binary:`~bin.mongo` shell to the instance, and use the :method:`~db.collection.createIndex()` to create an ascending index on the ``username`` field of the ``records`` collection: -.. code-block:: sh +.. code-block:: bash db.records.createIndex( { username: 1 } ) @@ -219,7 +219,7 @@ For example, to restart your replica set member: And restart: - .. code-block:: sh + .. code-block:: bash mongod --config @@ -238,7 +238,7 @@ For example, to restart your replica set member: For example: - .. code-block:: sh + .. code-block:: bash mongod --port 27017 --replSet myRepl diff --git a/source/tutorial/build-indexes-on-sharded-clusters.txt b/source/tutorial/build-indexes-on-sharded-clusters.txt index 15689005286..c078a694d9e 100644 --- a/source/tutorial/build-indexes-on-sharded-clusters.txt +++ b/source/tutorial/build-indexes-on-sharded-clusters.txt @@ -221,7 +221,7 @@ configuration updates: And restart: - .. code-block:: sh + .. code-block:: bash mongod --config @@ -260,7 +260,7 @@ configuration updates: ``disableLogicalSessionCacheRefresh`` parameters to true: - .. code-block:: sh + .. code-block:: bash mongod --port 27218 --setParameter skipShardingConfigurationChecks=true --setParameter disableLogicalSessionCacheRefresh=true @@ -285,7 +285,7 @@ and use the :method:`db.collection.createIndex()` method to create an ascending index on the ``username`` field of the ``records`` collection: -.. code-block:: sh +.. code-block:: bash db.records.createIndex( { username: 1 } ) @@ -341,7 +341,7 @@ For example, to restart your replica set shard member: And restart: - .. code-block:: sh + .. code-block:: bash mongod --config @@ -366,7 +366,7 @@ For example, to restart your replica set shard member: For example: - .. code-block:: sh + .. code-block:: bash mongod --port 27018 --replSet shardA --shardsvr diff --git a/source/tutorial/change-hostnames-in-a-replica-set.txt b/source/tutorial/change-hostnames-in-a-replica-set.txt index 0420078c369..a2b64f61fa3 100644 --- a/source/tutorial/change-hostnames-in-a-replica-set.txt +++ b/source/tutorial/change-hostnames-in-a-replica-set.txt @@ -116,7 +116,7 @@ This procedure uses the above :ref:`assumptions @@ -281,7 +281,7 @@ Procedure running on a temporary port of ``37017``, you would issue this command: - .. code-block:: sh + .. code-block:: bash mongo --port 37017 @@ -289,7 +289,7 @@ Procedure appropriate privileges. See :ref:`repl-set-change-hostname-prereq`. - .. code-block:: sh + .. code-block:: bash mongo --port 37017 -u userPerformingRename --authenticationDatabase=admin -p @@ -323,14 +323,14 @@ Procedure .. include:: /includes/warning-bind-ip-security-considerations.rst - .. code-block:: sh + .. code-block:: bash mongod --dbpath /data/db1/ --port 27017 --replSet rs --bind_ip localhost, #. Connect to one of the :binary:`~bin.mongod` instances using the :binary:`~bin.mongo` shell. For example: - .. code-block:: sh + .. code-block:: bash mongo --port 27017 diff --git a/source/tutorial/change-own-password-and-custom-data.txt b/source/tutorial/change-own-password-and-custom-data.txt index 0e655af3634..635acbd9ab3 100644 --- a/source/tutorial/change-own-password-and-custom-data.txt +++ b/source/tutorial/change-own-password-and-custom-data.txt @@ -25,7 +25,7 @@ To generate a strong password for use in this procedure, you can use the rand`` with the following options to create a base64-encoded string of 48 pseudo-random bytes: -.. code-block:: sh +.. code-block:: bash openssl rand -base64 48 diff --git a/source/tutorial/configure-audit-filters.txt b/source/tutorial/configure-audit-filters.txt index f7a8eda7271..8b02711c5fa 100644 --- a/source/tutorial/configure-audit-filters.txt +++ b/source/tutorial/configure-audit-filters.txt @@ -69,7 +69,7 @@ Filter for Multiple Operation Types The following example audits only the :authaction:`createCollection` and :authaction:`dropCollection` actions by using the filter: -.. code-block:: sh +.. code-block:: bash { atype: { $in: [ "createCollection", "dropCollection" ] } } @@ -104,7 +104,7 @@ in the ``param`` document. The following example audits only the ``authenticate`` operations that occur against the ``test`` database by using the filter: -.. code-block:: sh +.. code-block:: bash { atype: "authenticate", "param.db": "test" } @@ -150,7 +150,7 @@ by using the filter: The regular expression requires two backslashes (``\\``) to escape the dot (``.``). -.. code-block:: sh +.. code-block:: bash { atype: { $in: [ "createCollection", "dropCollection" ] }, "param.ns": /^test\\./ } } @@ -183,7 +183,7 @@ The following example audits operations by users with :authrole:`readWrite` role on the ``test`` database, including users with roles that inherit from :authrole:`readWrite`, by using the filter: -.. code-block:: sh +.. code-block:: bash { roles: { role: "readWrite", db: "test" } } @@ -226,7 +226,7 @@ The following example audits the :method:`~db.collection.find()`, :method:`~db.collection.update()`, :method:`~db.collection.save()`, and :method:`~db.collection.findAndModify()` operations by using the filter: -.. code-block:: sh +.. code-block:: bash { atype: "authCheck", "param.command": { $in: [ "find", "insert", "delete", "update", "findandmodify" ] } } @@ -272,7 +272,7 @@ The following example audits the :method:`~db.collection.find()`, :method:`~db.collection.findAndModify()` operations for the collection ``orders`` in the database ``test`` by using the filter: -.. code-block:: sh +.. code-block:: bash { atype: "authCheck", "param.ns": "test.orders", "param.command": { $in: [ "find", "insert", "delete", "update", "findandmodify" ] } } diff --git a/source/tutorial/configure-auditing.txt b/source/tutorial/configure-auditing.txt index 5baf93f90af..1848728a63f 100644 --- a/source/tutorial/configure-auditing.txt +++ b/source/tutorial/configure-auditing.txt @@ -52,7 +52,7 @@ is unavailable on Windows) in JSON format, specify ``syslog`` for the :option:`--auditDestination ` setting. For example: -.. code-block:: sh +.. code-block:: bash mongod --dbpath data/db --auditDestination syslog @@ -89,7 +89,7 @@ output (i.e. ``stdout``), specify ``console`` for the :option:`--auditDestination ` setting. For example: -.. code-block:: sh +.. code-block:: bash mongod --dbpath data/db --auditDestination console @@ -138,7 +138,7 @@ format, specify the following options: For example, the following enables auditing and records audit events to a file with the relative path name of ``data/db/auditLog.json``: -.. code-block:: sh +.. code-block:: bash mongod --dbpath data/db --auditDestination file --auditFormat JSON --auditPath data/db/auditLog.json @@ -197,7 +197,7 @@ format, specify the following options: For example, the following enables auditing and records audit events to a BSON file with the relative path name of ``data/db/auditLog.bson``: -.. code-block:: sh +.. code-block:: bash mongod --dbpath data/db --auditDestination file --auditFormat BSON --auditPath data/db/auditLog.bson @@ -231,7 +231,7 @@ To view the contents of the file, pass the file to the MongoDB utility :binary:`~bin.bsondump`. For example, the following converts the audit log into a human-readable form and output to the terminal: -.. code-block:: sh +.. code-block:: bash bsondump data/db/auditLog.bson diff --git a/source/tutorial/configure-encryption.txt b/source/tutorial/configure-encryption.txt index 2b5043fef99..caba6a34297 100644 --- a/source/tutorial/configure-encryption.txt +++ b/source/tutorial/configure-encryption.txt @@ -90,7 +90,7 @@ The following operation creates a new master key in your key manager which :binary:`~bin.mongod` uses to encrypt the keys :binary:`~bin.mongod` generates for each database. -.. code-block:: sh +.. code-block:: bash mongod --enableEncryption --kmipServerName \ --kmipPort --kmipServerCAFile ca.pem \ @@ -107,7 +107,7 @@ not match against the ``CN``. If the hostname does not match the To verify that the key creation and usage was successful, check the log file. If successful, the process will log the following messages: -.. code-block:: sh +.. code-block:: bash [initandlisten] Created KMIP key with id: [initandlisten] Encryption key manager initialized using master key with id: @@ -135,7 +135,7 @@ key manager by starting :binary:`~bin.mongod` with the following options: .. include:: /includes/extracts/default-bind-ip-security-additional-command-line.rst -.. code-block:: sh +.. code-block:: bash mongod --enableEncryption --kmipServerName \ --kmipPort --kmipServerCAFile ca.pem \ @@ -178,13 +178,13 @@ accessible by the owner of the :binary:`~bin.mongod` process. string. You can generate the encoded keyfile using any method you prefer. For example, - .. code-block:: sh + .. code-block:: bash openssl rand -base64 32 > mongodb-keyfile #. Update the file permissions. - .. code-block:: sh + .. code-block:: bash chmod 600 mongodb-keyfile @@ -195,7 +195,7 @@ accessible by the owner of the :binary:`~bin.mongod` process. - ``--encryptionKeyFile ``, - .. code-block:: sh + .. code-block:: bash mongod --enableEncryption --encryptionKeyFile mongodb-keyfile @@ -205,7 +205,7 @@ accessible by the owner of the :binary:`~bin.mongod` process. the keyfile. If the operation was successful, the process will log the following message: - .. code-block:: sh + .. code-block:: bash [initandlisten] Encryption key manager initialized with key file: diff --git a/source/tutorial/configure-fips.txt b/source/tutorial/configure-fips.txt index 52a095341d9..98769b54002 100644 --- a/source/tutorial/configure-fips.txt +++ b/source/tutorial/configure-fips.txt @@ -88,7 +88,7 @@ Select the tab below for your platform: - Verify that your OpenSSL software includes FIPS support by running the following command: - .. code-block:: sh + .. code-block:: bash openssl version @@ -97,7 +97,7 @@ Select the tab below for your platform: ``openssl-1.0.1e-16.el6_5`` to use FIPS mode. To upgrade the OpenSSL library on these platforms, run the following command: - .. code-block:: sh + .. code-block:: bash sudo yum update openssl @@ -111,7 +111,7 @@ Select the tab below for your platform: To configure the Linux prelink process to not prelink ``libcrypto``, run the following command: - .. code-block:: sh + .. code-block:: bash sudo bash -c "echo '-b /usr/lib64/libcrypto.so.*' >>/etc/prelink.conf.d/openssl-prelink.conf" @@ -142,7 +142,7 @@ Select the tab below for your platform: Check the server log file for a message that FIPS is active: - .. code-block:: sh + .. code-block:: bash FIPS 140-2 mode activated @@ -187,7 +187,7 @@ Select the tab below for your platform: Check the server log file for a message that FIPS is active: - .. code-block:: sh + .. code-block:: bash FIPS 140-2 mode activated @@ -232,7 +232,7 @@ Select the tab below for your platform: Check the server log file for a message that FIPS is active: - .. code-block:: sh + .. code-block:: bash FIPS 140-2 mode activated diff --git a/source/tutorial/configure-linux-iptables-firewall.txt b/source/tutorial/configure-linux-iptables-firewall.txt index d75539e0cb4..44b1eb87259 100644 --- a/source/tutorial/configure-linux-iptables-firewall.txt +++ b/source/tutorial/configure-linux-iptables-firewall.txt @@ -72,7 +72,7 @@ The goal of this pattern is to explicitly allow traffic to the following examples, replace ```` with the IP address of the application server: -.. code-block:: sh +.. code-block:: bash iptables -A INPUT -s -p tcp --destination-port 27017 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -d -p tcp --source-port 27017 -m state --state ESTABLISHED -j ACCEPT @@ -92,7 +92,7 @@ from the :binary:`~bin.mongod` to reach the application server. one of the following specifications for the ````, as follows: - .. code-block:: sh + .. code-block:: bash 10.10.10.10/24 10.10.10.10/255.255.255.0 @@ -121,7 +121,7 @@ for sharded clusters. Config servers listen for connections on port config server to allow incoming and outgoing connection on port ``27019``, for connection to the other config servers. -.. code-block:: sh +.. code-block:: bash iptables -A INPUT -s -p tcp --destination-port 27019 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -d -p tcp --source-port 27019 -m state --state ESTABLISHED -j ACCEPT @@ -134,7 +134,7 @@ all of the :binary:`~bin.mongos` instances in the cluster *and* all :binary:`~bin.mongod` instances in the cluster. Add rules that resemble the following: -.. code-block:: sh +.. code-block:: bash iptables -A INPUT -s -p tcp --destination-port 27019 -m state --state NEW,ESTABLISHED -j ACCEPT @@ -149,7 +149,7 @@ Traffic to and from a MongoDB Shard Server ``27018``. You must configure the following ``iptables`` rules to allow traffic to and from each shard: -.. code-block:: sh +.. code-block:: bash iptables -A INPUT -s -p tcp --destination-port 27018 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A OUTPUT -d -p tcp --source-port 27018 -m state --state ESTABLISHED -j ACCEPT @@ -171,7 +171,7 @@ Create a rule that resembles the following, and replace the ```` with the address of the config servers and the :binary:`~bin.mongos` instances: -.. code-block:: sh +.. code-block:: bash iptables -A OUTPUT -d -p tcp --source-port 27018 -m state --state ESTABLISHED -j ACCEPT @@ -201,7 +201,7 @@ isn't explicitly allowed as above will not be able to reach components of the MongoDB deployment. Issue the following commands to change this policy: -.. code-block:: sh +.. code-block:: bash iptables -P INPUT DROP @@ -229,7 +229,7 @@ you should make the rule set persistent. On Red Hat Enterprise Linux, Fedora Linux, and related distributions you can issue the following command: -.. code-block:: sh +.. code-block:: bash service iptables save @@ -237,13 +237,13 @@ On Debian, Ubuntu, and related distributions, you can use the following command to dump the ``iptables`` rules to the ``/etc/iptables.conf`` file: -.. code-block:: sh +.. code-block:: bash iptables-save > /etc/iptables.conf Run the following operation to restore the network rules: -.. code-block:: sh +.. code-block:: bash iptables-restore < /etc/iptables.conf @@ -256,7 +256,7 @@ List all ``iptables`` Rules To list all of currently applied ``iptables`` rules, use the following operation at the system shell. -.. code-block:: sh +.. code-block:: bash iptables -L @@ -267,7 +267,7 @@ If you make a configuration mistake when entering ``iptables`` rules or simply need to revert to the default rule set, you can use the following operation at the system shell to flush all rules: -.. code-block:: sh +.. code-block:: bash iptables -F diff --git a/source/tutorial/configure-ssl-clients.txt b/source/tutorial/configure-ssl-clients.txt index 00d97d45e06..54b04a68ffe 100644 --- a/source/tutorial/configure-ssl-clients.txt +++ b/source/tutorial/configure-ssl-clients.txt @@ -132,14 +132,14 @@ start the :binary:`~bin.mongo` shell with: For example, consider a :binary:`~bin.mongod` instance running on ``hostname.example.com`` with the following options: -.. code-block:: sh +.. code-block:: bash mongod --tlsMode requireTLS --tlsCertificateKeyFile To connect to the instance, start a :binary:`~bin.mongo` shell with the following options: -.. code-block:: sh +.. code-block:: bash mongo --tls --host hostname.example.com --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem @@ -174,14 +174,14 @@ shell with: For example, consider a :binary:`~bin.mongod` instance running on ``hostname.example.com`` with the following options: -.. code-block:: sh +.. code-block:: bash mongod --tlsMode requireTLS --tlsCertificateKeyFile /etc/ssl/mongodb.pem --tlsCAFile /etc/ssl/caToValidateClientCertificates.pem To connect to the instance, start a :binary:`~bin.mongo` shell with the following options: -.. code-block:: sh +.. code-block:: bash mongo --tls --host hostname.example.com --tlsCertificateKeyFile /etc/ssl/client.pem --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem @@ -197,7 +197,7 @@ On Windows and macOS, file from the system certificate store on macOS, start a :binary:`~bin.mongo` shell with the following options: - .. code-block:: sh + .. code-block:: bash mongo --tls --host hostname.example.com --tlsCertificateSelector subject="myclient.example.net" @@ -313,14 +313,14 @@ start the :binary:`~bin.mongo` shell with: For example, consider a :binary:`~bin.mongod` instance running on ``hostname.example.com`` with the following options: -.. code-block:: sh +.. code-block:: bash mongod --sslMode requireSSL --sslPEMKeyFile To connect to the instance, start a :binary:`~bin.mongo` shell with the following options: -.. code-block:: sh +.. code-block:: bash mongo --ssl --host hostname.example.com --sslCAFile /etc/ssl/caToValidateServerCertificates.pem @@ -355,14 +355,14 @@ shell with: For example, consider a :binary:`~bin.mongod` instance running on ``hostname.example.com`` with the following options: -.. code-block:: sh +.. code-block:: bash mongod --sslMode requireSSL --sslPEMKeyFile /etc/ssl/mongodb.pem --sslCAFile /etc/ssl/ca.pem To connect to the instance, start a :binary:`~bin.mongo` shell with the following options: -.. code-block:: sh +.. code-block:: bash mongo --ssl --host hostname.example.com --sslPEMKeyFile /etc/ssl/client.pem --sslCAFile /etc/ssl/ca.pem @@ -378,7 +378,7 @@ On Windows and macOS, store on macOS, start a :binary:`~bin.mongo` shell with the following options: - .. code-block:: sh + .. code-block:: bash mongo --ssl --host hostname.example.com --sslCertificateSelector subject=myclient.example.net diff --git a/source/tutorial/configure-ssl.txt b/source/tutorial/configure-ssl.txt index a9fc6c6d75b..2a53ef53ad0 100644 --- a/source/tutorial/configure-ssl.txt +++ b/source/tutorial/configure-ssl.txt @@ -237,7 +237,7 @@ settings ` in your A :binary:`~bin.mongod` instance that uses the above configuration can only use TLS/SSL connections: -.. code-block:: sh +.. code-block:: bash mongod --config @@ -356,7 +356,7 @@ A :binary:`~bin.mongod` instance that uses the above configuration can only use TLS/SSL connections and requires valid certificate from its clients: -.. code-block:: sh +.. code-block:: bash mongod --config @@ -728,7 +728,7 @@ your :binary:`~bin.mongod`/:binary:`~bin.mongos` instance's A :binary:`~bin.mongod` instance that uses the above configuration can only use TLS/SSL connections: -.. code-block:: sh +.. code-block:: bash mongod --config @@ -842,7 +842,7 @@ A :binary:`~bin.mongod` instance that uses the above configuration can only use TLS/SSL connections and requires valid certificate from its clients: -.. code-block:: sh +.. code-block:: bash mongod --config diff --git a/source/tutorial/configure-x509-client-authentication.txt b/source/tutorial/configure-x509-client-authentication.txt index 9c33ec92577..2c6a833c4d3 100644 --- a/source/tutorial/configure-x509-client-authentication.txt +++ b/source/tutorial/configure-x509-client-authentication.txt @@ -85,7 +85,7 @@ MongoDB Deployment Configured for x.509 (Using TLS Options) for x.509 authentication from the command-line. For example, to configure a standalone :binary:`~bin.mongod` instance: - .. code-block:: sh + .. code-block:: bash mongod --tlsMode requireTLS --tlsCertificateKeyFile --tlsCAFile --bind_ip @@ -183,7 +183,7 @@ MongoDB Deployment Configured for x.509 (Using SSL Options) for x.509 authentication from the command-line. For example, to configure a standalone :binary:`~bin.mongod` instance: - .. code-block:: sh + .. code-block:: bash mongod --sslMode requireSSL --sslPEMKeyFile --sslCAFile --bind_ip @@ -277,13 +277,13 @@ client certificate to authenticate more than one MongoDB user. #. You can retrieve the ``RFC2253`` formatted ``subject`` from the client certificate with the following command: - .. code-block:: sh + .. code-block:: bash openssl x509 -in -inform PEM -subject -nameopt RFC2253 The command returns the ``subject`` string as well as certificate: - .. code-block:: sh + .. code-block:: bash subject= CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry -----BEGIN CERTIFICATE----- @@ -344,7 +344,7 @@ authenticate with the client certificate. To authenticate during connection: - .. code-block:: sh + .. code-block:: bash mongo --tls --tlsCertificateKeyFile --tlsCAFile --authenticationDatabase '$external' --authenticationMechanism MONGODB-X509 @@ -387,7 +387,7 @@ authenticate with the client certificate. 1. Connect :binary:`~bin.mongo` shell to the :binary:`~bin.mongod` set up for TLS/SSL: - .. code-block:: sh + .. code-block:: bash mongo --tls --tlsCertificateKeyFile --tlsCAFile @@ -452,7 +452,7 @@ authenticate with the client certificate. To authenticate during connection: - .. code-block:: sh + .. code-block:: bash mongo --ssl --sslPEMKeyFile --sslCAFile --authenticationDatabase '$external' --authenticationMechanism MONGODB-X509 @@ -495,7 +495,7 @@ authenticate with the client certificate. 1. Connect :binary:`~bin.mongo` shell to the :binary:`~bin.mongod` set up for TLS/SSL: - .. code-block:: sh + .. code-block:: bash mongo --ssl --sslPEMKeyFile --sslCAFile diff --git a/source/tutorial/configure-x509-member-authentication.txt b/source/tutorial/configure-x509-member-authentication.txt index 68f08355902..d73ccb9e7b6 100644 --- a/source/tutorial/configure-x509-member-authentication.txt +++ b/source/tutorial/configure-x509-member-authentication.txt @@ -99,7 +99,7 @@ Use Command-line Options (``tls``) name: "TLS (Command-Line Options)" content: | - .. code-block:: sh + .. code-block:: bash mongod --replSet --tlsMode requireTLS --clusterAuthMode x509 --tlsClusterFile --tlsCertificateKeyFile --sslCAFile --bind_ip localhost, @@ -166,7 +166,7 @@ Use Command-line Options (``ssl``) ``--clusterAuthMode`` and ``--sslClusterFile``, as in the following example for a member of a replica set: - .. code-block:: sh + .. code-block:: bash mongod --replSet --sslMode requireSSL --clusterAuthMode x509 --sslClusterFile --sslPEMKeyFile --sslCAFile --bind_ip localhost, diff --git a/source/tutorial/control-access-to-mongodb-windows-with-kerberos-authentication.txt b/source/tutorial/control-access-to-mongodb-windows-with-kerberos-authentication.txt index 992c658f7db..4e70b5cc1a2 100644 --- a/source/tutorial/control-access-to-mongodb-windows-with-kerberos-authentication.txt +++ b/source/tutorial/control-access-to-mongodb-windows-with-kerberos-authentication.txt @@ -47,7 +47,7 @@ To start :binary:`~bin.mongos.exe` with Kerberos support, set the to ``GSSAPI``. You must start :binary:`~bin.mongos.exe` as the :ref:`service principal account `: -.. code-block:: sh +.. code-block:: bash mongos.exe --setParameter authenticationMechanisms=GSSAPI @@ -56,7 +56,7 @@ to ``GSSAPI``. You must start :binary:`~bin.mongos.exe` as the For example, the following starts a :binary:`~bin.mongos` instance with Kerberos support: -.. code-block:: sh +.. code-block:: bash mongos.exe --setParameter authenticationMechanisms=GSSAPI --configdb shard0.example.net, shard1.example.net,shard2.example.net --keyFile C:\\mongos.keyfile --bind_ip localhost, @@ -75,7 +75,7 @@ Use ``setspn.exe`` to assign the service principal name (SPN) to the account running the :binary:`~bin.mongod.exe` and the :binary:`~bin.mongos.exe` service: -.. code-block:: sh +.. code-block:: bash setspn.exe -S / @@ -85,7 +85,7 @@ account running the :binary:`~bin.mongod.exe` and the ``mongodb`` on ``testserver.mongodb.com`` with the service account name ``mongodtest``, assign the SPN as follows: - .. code-block:: sh + .. code-block:: bash setspn.exe -S mongodb/testserver.mongodb.com mongodtest @@ -113,7 +113,7 @@ can work alongside: Specify the mechanisms as follows: -.. code-block:: sh +.. code-block:: bash --setParameter authenticationMechanisms=GSSAPI,SCRAM-SHA-256 diff --git a/source/tutorial/control-access-to-mongodb-with-kerberos-authentication.txt b/source/tutorial/control-access-to-mongodb-with-kerberos-authentication.txt index 592be165bd2..fee602308c4 100644 --- a/source/tutorial/control-access-to-mongodb-with-kerberos-authentication.txt +++ b/source/tutorial/control-access-to-mongodb-with-kerberos-authentication.txt @@ -44,7 +44,7 @@ deployment must be `added to the Kerberos database You can add the service principal by running a command similar to the following on your KDC: -.. code-block:: sh +.. code-block:: bash kadmin.local addprinc mongodb/m1.example.com@EXAMPLE.COM @@ -55,7 +55,7 @@ for the respective service principal. You can create the keytab file by running a command similar to the following on the system running :binary:`~bin.mongod` or :binary:`~bin.mongos`: -.. code-block:: sh +.. code-block:: bash kadmin.local ktadd mongodb/m1.example.com@EXAMPLE.COM @@ -102,7 +102,7 @@ variable ``KRB5_KTNAME`` to the path of its :ref:`keytab file ` and the :binary:`~bin.mongos` parameter :parameter:`authenticationMechanisms` to ``GSSAPI`` in the following form: -.. code-block:: sh +.. code-block:: bash env KRB5_KTNAME= \ mongos \ @@ -115,7 +115,7 @@ variable ``KRB5_KTNAME`` to the path of its :ref:`keytab file For example, the following starts a :binary:`~bin.mongos` instance with Kerberos support: -.. code-block:: sh +.. code-block:: bash env KRB5_KTNAME=/opt/mongodb/mongos.keytab \ mongos \ @@ -170,7 +170,7 @@ configuration settings for a standalone :binary:`~bin.mongod`: To start :binary:`~bin.mongod` with Kerberos support, use the following form: -.. code-block:: sh +.. code-block:: bash env KRB5_KTNAME=/opt/mongodb/mongod.keytab \ /opt/mongodb/bin/mongod --config /opt/mongodb/mongod.conf @@ -211,7 +211,7 @@ can work alongside: Specify the mechanisms as follows: -.. code-block:: sh +.. code-block:: bash --setParameter authenticationMechanisms=GSSAPI,SCRAM-SHA-256 diff --git a/source/tutorial/convert-command-line-options-to-yaml.txt b/source/tutorial/convert-command-line-options-to-yaml.txt index ceda1764092..6ae0a38d5f2 100644 --- a/source/tutorial/convert-command-line-options-to-yaml.txt +++ b/source/tutorial/convert-command-line-options-to-yaml.txt @@ -21,7 +21,7 @@ Convert ``mongod`` Command-Line Options to YAML Consider the following :binary:`~bin.mongod` invocation that uses the command-line options: -.. code-block:: sh +.. code-block:: bash :copyable: false mongod --shardsvr --replSet myShard --dbpath /var/lib/mongodb --bind_ip localhost,My-Example-Hostname --fork --logpath /var/log/mongodb/mongod.log --clusterAuthMode x509 --tlsMode requireTLS --tlsCAFile /path/to/my/CA/file --tlsCertificateKeyFile /path/to/my/certificate/file --tlsClusterFile /path/to/my/cluster/membership/file @@ -29,7 +29,7 @@ command-line options: Include the :option:`--outputConfig ` command-line option to generate the corresponding YAML file. -.. code-block:: sh +.. code-block:: bash mongod --shardsvr --replSet myShard --dbpath /var/lib/mongodb --bind_ip localhost,My-Example-Hostname --fork --logpath /var/log/mongodb/mongod.log --clusterAuthMode x509 --tlsMode requireTLS --tlsCAFile /path/to/my/CA/file --tlsCertificateKeyFile /path/to/my/certificate/file --tlsClusterFile /path/to/my/cluster/membership/file --outputConfig @@ -70,7 +70,7 @@ Convert ``mongos`` Command-Line Options to YAML Consider the following :binary:`~bin.mongos` invocation that uses the command-line options: -.. code-block:: sh +.. code-block:: bash :copyable: false mongos --configdb myCSRS/cfg1.example.net:27019,cfg2.example.net:27019 --bind_ip localhost,My-Example-MONGOS-Hostname --fork --logpath /var/log/mongodb/mongos.log --clusterAuthMode x509 --tlsMode requireTLS --tlsCAFile /path/to/my/CA/file --tlsCertificateKeyFile /path/to/my/certificate/file --tlsClusterFile /path/to/my/cluster/membership/file @@ -79,7 +79,7 @@ Include the :option:`--outputConfig ` command-line option to generate the corresponding YAML for the :binary:`~bin.mongos` instance: -.. code-block:: sh +.. code-block:: bash mongos --configdb myCSRS/cfg1.example.net:27019,cfg2.example.net:27019 --bind_ip localhost,My-Example-MONGOS-Hostname --fork --logpath /var/log/mongodb/mongos.log --clusterAuthMode x509 --tlsMode requireTLS --tlsCAFile /path/to/my/CA/file --tlsCertificateKeyFile /path/to/my/certificate/file --tlsClusterFile /path/to/my/cluster/membership/file --outputConfig diff --git a/source/tutorial/convert-secondary-into-arbiter.txt b/source/tutorial/convert-secondary-into-arbiter.txt index 126ba41ba60..724710e2d33 100644 --- a/source/tutorial/convert-secondary-into-arbiter.txt +++ b/source/tutorial/convert-secondary-into-arbiter.txt @@ -61,7 +61,7 @@ Convert Secondary to Arbiter and Reuse the Port Number #. Move the secondary's data directory to an archive folder. For example: - .. code-block:: sh + .. code-block:: bash mv /data/db /data/db-old @@ -73,7 +73,7 @@ Convert Secondary to Arbiter and Reuse the Port Number :binary:`~bin.mongod` instance. You can reuse the previous name. For example: - .. code-block:: sh + .. code-block:: bash mkdir /data/db @@ -84,7 +84,7 @@ Convert Secondary to Arbiter and Reuse the Port Number .. include:: /includes/warning-bind-ip-security-considerations.rst - .. code-block:: sh + .. code-block:: bash mongod --port 27021 --dbpath /data/db --replSet rs --bind_ip localhost, @@ -121,7 +121,7 @@ Convert Secondary to Arbiter Running on a New Port Number #. Create a new, empty data directory to be used with the new port number. For example: - .. code-block:: sh + .. code-block:: bash mkdir /data/db-temp @@ -131,7 +131,7 @@ Convert Secondary to Arbiter Running on a New Port Number .. include:: /includes/warning-bind-ip-security-considerations.rst - .. code-block:: sh + .. code-block:: bash mongod --port 27021 --dbpath /data/db-temp --replSet rs --bind_ip localhost, @@ -174,7 +174,7 @@ Convert Secondary to Arbiter Running on a New Port Number #. Move the secondary's data directory to an archive folder. For example: - .. code-block:: sh + .. code-block:: bash mv /data/db /data/db-old diff --git a/source/tutorial/convert-shard-standalone-to-shard-replica-set.txt b/source/tutorial/convert-shard-standalone-to-shard-replica-set.txt index 0d37bb8674c..b1485daece5 100644 --- a/source/tutorial/convert-shard-standalone-to-shard-replica-set.txt +++ b/source/tutorial/convert-shard-standalone-to-shard-replica-set.txt @@ -42,7 +42,7 @@ Procedure uses the standalone's existing database path of ``/srv/mongodb/db0`` and :option:`--port ` is the same as before: - .. code-block:: sh + .. code-block:: bash mongod --port 27018 --dbpath /srv/mongodb/db0 --shardsvr --replSet shardA --bind_ip localhost, diff --git a/source/tutorial/convert-standalone-to-replica-set.txt b/source/tutorial/convert-standalone-to-replica-set.txt index 9e1f7cc0182..395f89d3506 100644 --- a/source/tutorial/convert-standalone-to-replica-set.txt +++ b/source/tutorial/convert-standalone-to-replica-set.txt @@ -38,7 +38,7 @@ Procedure .. include:: /includes/warning-bind-ip-security-considerations.rst - .. code-block:: sh + .. code-block:: bash mongod --port 27017 --dbpath /srv/mongodb/db0 --replSet rs0 --bind_ip localhost, diff --git a/source/tutorial/deploy-replica-set-for-testing.txt b/source/tutorial/deploy-replica-set-for-testing.txt index 48cc196ab1a..3b4414aea7b 100644 --- a/source/tutorial/deploy-replica-set-for-testing.txt +++ b/source/tutorial/deploy-replica-set-for-testing.txt @@ -60,7 +60,7 @@ Procedure 1. Create the necessary data directories for each member by issuing a command similar to the following: - .. code-block:: sh + .. code-block:: bash mkdir -p /srv/mongodb/rs0-0 /srv/mongodb/rs0-1 /srv/mongodb/rs0-2 @@ -74,19 +74,19 @@ Procedure First member: - .. code-block:: sh + .. code-block:: bash mongod --replSet rs0 --port 27017 --bind_ip localhost, --dbpath /srv/mongodb/rs0-0 --oplogSize 128 Second member: - .. code-block:: sh + .. code-block:: bash mongod --replSet rs0 --port 27018 --bind_ip localhost, --dbpath /srv/mongodb/rs0-1 --oplogSize 128 Third member: - .. code-block:: sh + .. code-block:: bash mongod --replSet rs0 --port 27019 --bind_ip localhost, --dbpath /srv/mongodb/rs0-2 --oplogSize 128 @@ -109,7 +109,7 @@ Procedure specifying its port number. For the sake of simplicity and clarity, you may want to choose the first one, as in the following command; - .. code-block:: sh + .. code-block:: bash mongo --port 27017 diff --git a/source/tutorial/deploy-shard-cluster.txt b/source/tutorial/deploy-shard-cluster.txt index 58dae575940..7fe1c4b43d5 100644 --- a/source/tutorial/deploy-shard-cluster.txt +++ b/source/tutorial/deploy-shard-cluster.txt @@ -150,7 +150,7 @@ command line parameter to specify the config servers. Start the :binary:`~bin.mongos` specifying the ``--config`` option and the path to the configuration file. - .. code-block:: sh + .. code-block:: bash mongos --config @@ -166,7 +166,7 @@ command line parameter to specify the config servers. .. include:: /includes/warning-bind-ip-security-considerations.rst - .. code-block:: sh + .. code-block:: bash mongos --configdb /cfg1.example.net:27019,cfg2.example.net:27019,cfg3.example.net:27019 --bind_ip localhost, @@ -182,7 +182,7 @@ Connect to the Sharded Cluster Connect a :binary:`~bin.mongo` shell to the :binary:`~bin.mongos`. Specify the ``host`` and ``port`` on which the ``mongos`` is running: -.. code-block:: sh +.. code-block:: bash mongo --host --port diff --git a/source/tutorial/expand-replica-set.txt b/source/tutorial/expand-replica-set.txt index 5e5c7ab7a07..dbe91072b5f 100644 --- a/source/tutorial/expand-replica-set.txt +++ b/source/tutorial/expand-replica-set.txt @@ -127,7 +127,7 @@ Add a Member to an Existing Replica Set and the replica set name. The following example specifies the ``/srv/mongodb/db0`` data directory and the ``rs0`` replica set: - .. code-block:: sh + .. code-block:: bash mongod --dbpath /srv/mongodb/db0 --replSet rs0 --bind_ip localhost, @@ -143,7 +143,7 @@ Add a Member to an Existing Replica Set `, and start the :binary:`~bin.mongod` with the following command: - .. code-block:: sh + .. code-block:: bash mongod --config /etc/mongod.conf diff --git a/source/tutorial/install-mongodb-enterprise-on-red-hat-tarball.txt b/source/tutorial/install-mongodb-enterprise-on-red-hat-tarball.txt index 138b2080cb8..ff5ead3060f 100644 --- a/source/tutorial/install-mongodb-enterprise-on-red-hat-tarball.txt +++ b/source/tutorial/install-mongodb-enterprise-on-red-hat-tarball.txt @@ -124,7 +124,7 @@ uses the following default directories: The default MongoDB directories are not created. To create the MongoDB data and log directories: - .. code-block:: sh + .. code-block:: bash sudo mkdir -p /var/lib/mongo sudo mkdir -p /var/log/mongodb @@ -132,7 +132,7 @@ uses the following default directories: By default, MongoDB runs using the |mongod-user| user account. Once created, set the owner and group of these directories to |mongod-user|: - .. code-block:: sh + .. code-block:: bash sudo chown -R mongod:mongod @@ -154,7 +154,7 @@ directories: #. Ensure that the user running MongoDB has access to the directory or directories: - .. code-block:: sh + .. code-block:: bash sudo chown -R mongod:mongod diff --git a/source/tutorial/install-mongodb-enterprise-on-red-hat.txt b/source/tutorial/install-mongodb-enterprise-on-red-hat.txt index 392bd4edca3..5a6bcdb5eed 100644 --- a/source/tutorial/install-mongodb-enterprise-on-red-hat.txt +++ b/source/tutorial/install-mongodb-enterprise-on-red-hat.txt @@ -90,7 +90,7 @@ uses the following default directories: The default MongoDB directories are not created. To create the MongoDB data and log directories: - .. code-block:: sh + .. code-block:: bash sudo mkdir -p /var/lib/mongo sudo mkdir -p /var/log/mongodb @@ -98,7 +98,7 @@ uses the following default directories: By default, MongoDB runs using the |mongod-user| user account. Once created, set the owner and group of these directories to |mongod-user|: - .. code-block:: sh + .. code-block:: bash sudo chown -R mongod:mongod @@ -120,7 +120,7 @@ directories: #. Ensure that the user running MongoDB has access to the directory or directories: - .. code-block:: sh + .. code-block:: bash sudo chown -R mongod:mongod diff --git a/source/tutorial/install-mongodb-on-os-x.txt b/source/tutorial/install-mongodb-on-os-x.txt index a5d6d85313e..f1ab50cf0d7 100644 --- a/source/tutorial/install-mongodb-on-os-x.txt +++ b/source/tutorial/install-mongodb-on-os-x.txt @@ -74,7 +74,7 @@ Homebrew requires the Xcode command-line tools from Apple's Xcode. - Install the Xcode command-line tools by running the following command in your macOS Terminal: - .. code-block:: sh + .. code-block:: bash xcode-select --install @@ -100,7 +100,7 @@ Follow these steps to install MongoDB |edition| Edition using Homebrew's Homebrew formula for MongoDB and the Database Tools, by running the following command in your macOS Terminal: - .. code-block:: sh + .. code-block:: bash brew tap mongodb/brew @@ -110,7 +110,7 @@ Follow these steps to install MongoDB |edition| Edition using Homebrew's #. To install MongoDB, run the following command in your macOS Terminal application: - .. code-block:: sh + .. code-block:: bash brew install mongodb-community@{+version+} @@ -161,7 +161,7 @@ for the current list of Apple hardware using the M1 processor. You can also run the following command to check where ``brew`` has installed these files and directories: -.. code-block:: sh +.. code-block:: bash brew --prefix @@ -186,14 +186,14 @@ MongoDB as a macOS service, as doing so sets the correct system - To run MongoDB (i.e. the :binary:`~bin.mongod` process) **as a macOS service**, issue the following: - .. code-block:: sh + .. code-block:: bash brew services start mongodb-community@{+version+} To stop a :binary:`~bin.mongod` running as a macOS service, use the following command as needed: - .. code-block:: sh + .. code-block:: bash brew services stop mongodb-community@{+version+} @@ -202,14 +202,14 @@ MongoDB as a macOS service, as doing so sets the correct system - For macOS running Intel processors: - .. code-block:: sh + .. code-block:: bash mongod --config /usr/local/etc/mongod.conf --fork - For macOS running on `Apple M1 processors `__: - .. code-block:: sh + .. code-block:: bash mongod --config /opt/homebrew/etc/mongod.conf --fork @@ -230,7 +230,7 @@ To verify that MongoDB is running, perform one of the following: - If you started MongoDB **as a macOS service**: - .. code-block:: sh + .. code-block:: bash brew services list @@ -239,7 +239,7 @@ To verify that MongoDB is running, perform one of the following: - If you started MongoDB **manually as a background process**: - .. code-block:: sh + .. code-block:: bash ps aux | grep -v grep | grep mongod @@ -254,7 +254,7 @@ Connect and Use MongoDB To begin using MongoDB, connect a :binary:`~bin.mongo` shell to the running instance. From a new terminal, issue the following: -.. code-block:: sh +.. code-block:: bash mongo @@ -290,7 +290,7 @@ macOS Terminal application. For example you could run :binary:`mongotop` against your running MongoDB instance by invoking it in your macOS Terminal like so: -.. code-block:: sh +.. code-block:: bash mongotop @@ -317,7 +317,7 @@ Troubleshooting ChecksumMismatchError If you have previously installed an older version of the formula, you may encounter a ``ChecksumMismatchError`` resembling the following: -.. code-block:: sh +.. code-block:: bash :copyable: false Error: An exception occurred within a child process: @@ -338,13 +338,13 @@ To fix: #. Retap the formula. - .. code-block:: sh + .. code-block:: bash brew untap mongodb/brew && brew tap mongodb/brew #. Retry the install. - .. code-block:: sh + .. code-block:: bash brew install mongodb-community@{+version+} diff --git a/source/tutorial/install-mongodb-on-red-hat-tarball.txt b/source/tutorial/install-mongodb-on-red-hat-tarball.txt index c13b9517a78..8837e80a83a 100644 --- a/source/tutorial/install-mongodb-on-red-hat-tarball.txt +++ b/source/tutorial/install-mongodb-on-red-hat-tarball.txt @@ -104,7 +104,7 @@ uses the following default directories: The default MongoDB directories are not created. To create the MongoDB data and log directories: - .. code-block:: sh + .. code-block:: bash sudo mkdir -p /var/lib/mongo sudo mkdir -p /var/log/mongodb @@ -112,7 +112,7 @@ uses the following default directories: By default, MongoDB runs using the |mongod-user| user account. Once created, set the owner and group of these directories to |mongod-user|: - .. code-block:: sh + .. code-block:: bash sudo chown -R mongod:mongod @@ -134,7 +134,7 @@ directories: #. Ensure that the user running MongoDB has access to the directory or directories: - .. code-block:: sh + .. code-block:: bash sudo chown -R mongod:mongod diff --git a/source/tutorial/install-mongodb-on-red-hat.txt b/source/tutorial/install-mongodb-on-red-hat.txt index 0f89336185f..543b4056860 100644 --- a/source/tutorial/install-mongodb-on-red-hat.txt +++ b/source/tutorial/install-mongodb-on-red-hat.txt @@ -88,7 +88,7 @@ uses the following default directories: The default MongoDB directories are not created. To create the MongoDB data and log directories: - .. code-block:: sh + .. code-block:: bash sudo mkdir -p /var/lib/mongo sudo mkdir -p /var/log/mongodb @@ -96,7 +96,7 @@ uses the following default directories: By default, MongoDB runs using the |mongod-user| user account. Once created, set the owner and group of these directories to |mongod-user|: - .. code-block:: sh + .. code-block:: bash sudo chown -R mongod:mongod @@ -118,7 +118,7 @@ directories: #. Ensure that the user running MongoDB has access to the directory or directories: - .. code-block:: sh + .. code-block:: bash sudo chown -R mongod:mongod diff --git a/source/tutorial/manage-journaling.txt b/source/tutorial/manage-journaling.txt index 535116a733f..223e20c7d25 100644 --- a/source/tutorial/manage-journaling.txt +++ b/source/tutorial/manage-journaling.txt @@ -125,7 +125,7 @@ instance: - If you are using a configuration file: - .. code-block:: sh + .. code-block:: bash mongod -f @@ -133,7 +133,7 @@ instance: file, update the :option:`--wiredTigerJournalCompressor ` option. - .. code-block:: sh + .. code-block:: bash mongod --wiredTigerJournalCompressor ... @@ -189,7 +189,7 @@ instance: - If you are using a configuration file: - .. code-block:: sh + .. code-block:: bash mongod -f @@ -207,7 +207,7 @@ instance: to ``true`` in the :option:`--setParameter ` option. - .. code-block:: sh + .. code-block:: bash mongod --nojournal --setParameter disableLogicalSessionCacheRefresh=true ... @@ -256,7 +256,7 @@ instance: - If you are using a configuration file: - .. code-block:: sh + .. code-block:: bash mongod -f @@ -276,7 +276,7 @@ instance: - Remove the ``disableLogicalSessionCacheRefresh`` parameter. - .. code-block:: sh + .. code-block:: bash mongod --wiredTigerJournalCompressor --replSet ... @@ -345,7 +345,7 @@ instance: - If you are using a configuration file: - .. code-block:: sh + .. code-block:: bash mongod -f @@ -371,7 +371,7 @@ instance: - Explicitly include :option:`--port ` set to the instance's current port. - .. code-block:: sh + .. code-block:: bash mongod --nojournal --setParameter skipShardingConfigurationChecks=true --setParameter disableLogicalSessionCacheRefresh=true --port ... @@ -425,7 +425,7 @@ instance: - If you are using a configuration file: - .. code-block:: sh + .. code-block:: bash mongod -f @@ -450,6 +450,6 @@ instance: ` as well as any additional options for your replica set member. - .. code-block:: sh + .. code-block:: bash mongod --shardsvr --wiredTigerJournalCompressor --replSet ... diff --git a/source/tutorial/manage-mongodb-processes.txt b/source/tutorial/manage-mongodb-processes.txt index 2562d578d73..37fc0736bff 100644 --- a/source/tutorial/manage-mongodb-processes.txt +++ b/source/tutorial/manage-mongodb-processes.txt @@ -44,7 +44,7 @@ server on the ``C:\`` drive stores all data files in ``C:\data\db``. To start MongoDB using all defaults, issue the following command at the system shell: -.. code-block:: sh +.. code-block:: bash mongod @@ -64,7 +64,7 @@ directory, use the :option:`--dbpath ` option. The following invocation will start a :binary:`~bin.mongod` instance and store data in the ``/srv/mongodb`` path -.. code-block:: sh +.. code-block:: bash mongod --dbpath /srv/mongodb/ @@ -81,7 +81,7 @@ To specify a port to :binary:`~bin.mongod`, use the :option:`--port ` option on the command line. The following command starts :binary:`~bin.mongod` listening on port ``12345``: -.. code-block:: sh +.. code-block:: bash mongod --port 12345 @@ -99,7 +99,7 @@ will create the log file if it does not exist. The following command starts :binary:`~bin.mongod` as a daemon and records log output to ``/var/log/mongodb/mongod.log``. -.. code-block:: sh +.. code-block:: bash mongod --fork --logpath /var/log/mongodb/mongod.log @@ -154,7 +154,7 @@ Supported on Linux only. From the command line, shut down the :binary:`~bin.mongod` using the :option:`--shutdown ` option: -.. code-block:: sh +.. code-block:: bash mongod --shutdown diff --git a/source/tutorial/manage-the-database-profiler.txt b/source/tutorial/manage-the-database-profiler.txt index fd43cb1e755..ecc556ea959 100644 --- a/source/tutorial/manage-the-database-profiler.txt +++ b/source/tutorial/manage-the-database-profiler.txt @@ -308,7 +308,7 @@ profiling level applies to all databases provided by the To enable profiling for a :binary:`~bin.mongod` instance, pass the following options to :binary:`~bin.mongod` at startup. -.. code-block:: sh +.. code-block:: bash mongod --profile 1 --slowms 15 --slowOpSampleRate 0.5 diff --git a/source/tutorial/model-monetary-data.txt b/source/tutorial/model-monetary-data.txt index e0012b14b95..c0ed709e395 100644 --- a/source/tutorial/model-monetary-data.txt +++ b/source/tutorial/model-monetary-data.txt @@ -289,7 +289,7 @@ To model monetary data using the scale factor approach: For example, the following scales ``9.99 USD`` by 1000 to preserve precision up to one tenth of a cent. -.. code-block:: sh +.. code-block:: bash { price: 9990, currency: "USD" } @@ -323,7 +323,7 @@ value in two fields: The following example uses the non-numeric model to store ``9.99 USD`` for the price and ``0.25 USD`` for the fee: -.. code-block:: sh +.. code-block:: bash { price: { display: "9.99", approx: 9.9900000000000002, currency: "USD" }, diff --git a/source/tutorial/monitor-with-snmp.txt b/source/tutorial/monitor-with-snmp.txt index bbb46f6c016..f4abe03e454 100644 --- a/source/tutorial/monitor-with-snmp.txt +++ b/source/tutorial/monitor-with-snmp.txt @@ -55,7 +55,7 @@ Optional: Run MongoDB as SNMP Master .. include:: /includes/fact-snmp-run-mongodb-as-snmp-master.rst -.. code-block:: sh +.. code-block:: bash cp mongod.conf.master /etc/snmp/mongod.conf @@ -71,6 +71,6 @@ Optional: Run MongoDB as SNMP Master Then, start |mongod-program| with the :option:`snmp-master ` option: -.. code-block:: sh +.. code-block:: bash mongod --snmp-master diff --git a/source/tutorial/restore-sharded-cluster.txt b/source/tutorial/restore-sharded-cluster.txt index 4b6a76d6f40..01bfa86dcb0 100644 --- a/source/tutorial/restore-sharded-cluster.txt +++ b/source/tutorial/restore-sharded-cluster.txt @@ -116,7 +116,7 @@ Prepare Data Directory :binary:`mongod ` has read, write, and execute permissions for all files and subfolders in that directory: - .. code-block:: sh + .. code-block:: bash sudo mkdir /path/to/mongodb sudo chown -R mongodb:mongodb /path/to/mongodb @@ -132,7 +132,7 @@ Prepare Log Directory runs the :binary:`mongod ` has read, write, and execute permissions for all files and subfolders in that directory: - .. code-block:: sh + .. code-block:: bash sudo mkdir /path/to/mongodb/logs sudo chown -R mongodb:mongodb /path/to/mongodb/logs @@ -150,7 +150,7 @@ Create Configuration File the user that runs the :binary:`mongod ` has read and write permissions on the configuration file: - .. code-block:: sh + .. code-block:: bash sudo touch /path/to/mongod.conf sudo chown mongodb:mongodb /path/to/mongodb/mongod.conf diff --git a/source/tutorial/rotate-encryption-key.txt b/source/tutorial/rotate-encryption-key.txt index bfac4180dc6..3c2f9f70152 100644 --- a/source/tutorial/rotate-encryption-key.txt +++ b/source/tutorial/rotate-encryption-key.txt @@ -41,7 +41,7 @@ For a replica set, to rotate out a member: well as any other options specific to your configuration, such as :option:`--dbpath ` and :option:`--bind_ip `. - .. code-block:: sh + .. code-block:: bash mongod --replSet myReplSet --enableEncryption \ --kmipServerName \ @@ -89,7 +89,7 @@ to re-encrypt the entire data set. with the new key to use or omit to request a new key from the KMIP server: - .. code-block:: sh + .. code-block:: bash mongod --enableEncryption --kmipRotateMasterKey \ --kmipServerName \ @@ -106,7 +106,7 @@ to re-encrypt the entire data set. parameter. Include any other options specific to your configuration, such as ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --enableEncryption --kmipServerName \ --kmipServerCAFile ca.pem --kmipClientCertificateFile client.pem @@ -135,7 +135,7 @@ to re-encrypt the entire data set. the :option:`--kmipKeyIdentifier ` option with the new key to use or omit. - .. code-block:: sh + .. code-block:: bash mongod --enableEncryption --kmipRotateMasterKey \ --kmipServerName \ @@ -152,7 +152,7 @@ to re-encrypt the entire data set. :option:`--kmipRotateMasterKey ` option. Include any other options specific to your configuration, such as ``--bind_ip``. - .. code-block:: sh + .. code-block:: bash mongod --enableEncryption --kmipServerName \ --kmipServerCAFile ca.pem --kmipClientCertificateFile client.pem diff --git a/source/tutorial/rotate-log-files.txt b/source/tutorial/rotate-log-files.txt index 4f9477ce12e..fb1c80ded07 100644 --- a/source/tutorial/rotate-log-files.txt +++ b/source/tutorial/rotate-log-files.txt @@ -85,7 +85,7 @@ For example, if a running :binary:`~bin.mongod` instance has a process ID (PID) of ``2200``, the following command rotates the log file for that instance on Linux: -.. code-block:: sh +.. code-block:: bash kill -SIGUSR1 2200 diff --git a/source/tutorial/troubleshoot-kerberos.txt b/source/tutorial/troubleshoot-kerberos.txt index a8c8efc841e..9c810960c2a 100644 --- a/source/tutorial/troubleshoot-kerberos.txt +++ b/source/tutorial/troubleshoot-kerberos.txt @@ -97,7 +97,7 @@ For example, the following command starts a standalone :binary:`~bin.mongod` whose keytab file is at the default ``/etc/krb5.keytab`` path and sets ``KRB5_TRACE`` to write to ``/logs/mongodb-kerberos.log``: -.. code-block:: sh +.. code-block:: bash env KRB5_KTNAME=/etc/krb5.keytab \ KRB5_TRACE=/logs/mongodb-kerberos.log \ diff --git a/source/tutorial/troubleshoot-replica-sets.txt b/source/tutorial/troubleshoot-replica-sets.txt index 162c5d74117..734762d8b0e 100644 --- a/source/tutorial/troubleshoot-replica-sets.txt +++ b/source/tutorial/troubleshoot-replica-sets.txt @@ -185,7 +185,7 @@ Consider the following example of a bidirectional test of networking: 1. Test the connection from ``m1.example.net`` to the other hosts with the following operation set ``m1.example.net``: - .. code-block:: sh + .. code-block:: bash mongo --host m2.example.net --port 27017 @@ -195,7 +195,7 @@ Consider the following example of a bidirectional test of networking: hosts with the following operation set from ``m2.example.net``, as in: - .. code-block:: sh + .. code-block:: bash mongo --host m1.example.net --port 27017 @@ -208,7 +208,7 @@ Consider the following example of a bidirectional test of networking: hosts with the following operation set from the ``m3.example.net`` host, as in: - .. code-block:: sh + .. code-block:: bash mongo --host m1.example.net --port 27017 diff --git a/source/tutorial/upgrade-cluster-to-ssl.txt b/source/tutorial/upgrade-cluster-to-ssl.txt index 9332e5f77ce..5b6818832df 100644 --- a/source/tutorial/upgrade-cluster-to-ssl.txt +++ b/source/tutorial/upgrade-cluster-to-ssl.txt @@ -59,7 +59,7 @@ process. name: Command-Line Options content: | - .. code-block:: sh + .. code-block:: bash mongod --replSet --tlsMode allowTLS --tlsCertificateKeyFile --sslCAFile @@ -90,7 +90,7 @@ process. connections, and its connections to other servers use TLS/SSL. For example: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, tlsMode: "preferTLS" } ) @@ -104,7 +104,7 @@ process. as its :setting:`net.tls.mode`, the node will reject any non-TLS/non-SSL connections. For example: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, tlsMode: "requireTLS" } ) @@ -159,7 +159,7 @@ process. name: Command-Line Options content: | - .. code-block:: sh + .. code-block:: bash mongod --replSet --sslMode allowSSL --sslPEMKeyFile --sslCAFile @@ -190,7 +190,7 @@ process. connections, and its connections to other servers use TLS/SSL. For example: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, sslMode: "preferSSL" } ) @@ -204,7 +204,7 @@ process. as its :setting:`net.ssl.mode`, the node will reject any non-TLS/non-SSL connections. For example: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, sslMode: "requireSSL" } ) diff --git a/source/tutorial/upgrade-keyfile-to-x509.txt b/source/tutorial/upgrade-keyfile-to-x509.txt index 7f49b043e65..1c91d01a50b 100644 --- a/source/tutorial/upgrade-keyfile-to-x509.txt +++ b/source/tutorial/upgrade-keyfile-to-x509.txt @@ -107,7 +107,7 @@ cluster authentication, use the following rolling upgrade process: :dbcommand:`setParameter` command to update the :parameter:`clusterAuthMode` to ``sendX509``. [#update-mode-alternative]_ - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, clusterAuthMode: "sendX509" } ) @@ -123,7 +123,7 @@ cluster authentication, use the following rolling upgrade process: update the :parameter:`clusterAuthMode` to ``x509`` to only use the x.509 certificate for authentication. [#update-mode-alternative]_ - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, clusterAuthMode: "x509" } ) @@ -272,7 +272,7 @@ to x.509 membership authentication and TLS/SSL connections: a keyfile or an x.509 certificate from other members to authenticate those members. - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, tlsMode: "preferTLS" } ); db.adminCommand( { setParameter: 1, clusterAuthMode: "sendX509" } ); @@ -427,7 +427,7 @@ cluster authentication, use the following rolling upgrade process: ` as well as any other options that are required for your specific configuration. For example: - .. code-block:: sh + .. code-block:: bash mongod --replSet --sslMode requireSSL --clusterAuthMode sendKeyFile --sslClusterFile --sslPEMKeyFile --sslCAFile --bind_ip localhost, @@ -441,7 +441,7 @@ cluster authentication, use the following rolling upgrade process: :dbcommand:`setParameter` command to update the :parameter:`clusterAuthMode` to ``sendX509``. [#update-mode-alternative]_ For example, - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, clusterAuthMode: "sendX509" } ) @@ -458,7 +458,7 @@ cluster authentication, use the following rolling upgrade process: x.509 certificate for authentication. [#update-mode-alternative]_ For example: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, clusterAuthMode: "x509" } ) @@ -492,7 +492,7 @@ x.509 authentication, use the following rolling upgrade process: ` as well as any other options that are required for your specific configuration. For example: - .. code-block:: sh + .. code-block:: bash mongod --replSet --sslMode allowSSL --clusterAuthMode sendKeyFile --sslClusterFile --sslPEMKeyFile --sslCAFile --bind_ip localhost, @@ -513,7 +513,7 @@ x.509 authentication, use the following rolling upgrade process: to ``preferSSL`` and the :parameter:`clusterAuthMode` to ``sendX509``. [#update-mode-alternative]_ For example: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, sslMode: "preferSSL", clusterAuthMode: "sendX509" } ) @@ -536,7 +536,7 @@ x.509 authentication, use the following rolling upgrade process: :parameter:`clusterAuthMode` to ``x509``. [#update-mode-alternative]_ For example: - .. code-block:: sh + .. code-block:: bash db.adminCommand( { setParameter: 1, sslMode: "requireSSL", clusterAuthMode: "x509" } ) diff --git a/source/tutorial/write-scripts-for-the-mongo-shell.txt b/source/tutorial/write-scripts-for-the-mongo-shell.txt index 6f796ba1acd..119176d1d4e 100644 --- a/source/tutorial/write-scripts-for-the-mongo-shell.txt +++ b/source/tutorial/write-scripts-for-the-mongo-shell.txt @@ -215,7 +215,7 @@ From the system prompt, use :binary:`~bin.mongo` to evaluate JavaScript. Use the :option:`--eval ` option to :binary:`~bin.mongo` to pass the shell a JavaScript fragment, as in the following: -.. code-block:: sh +.. code-block:: bash mongo test --eval "printjson(db.getCollectionNames())" @@ -233,7 +233,7 @@ You can specify a ``.js`` file to the :binary:`~bin.mongo` shell, and :binary:`~bin.mongo` will execute the JavaScript directly. Consider the following example: -.. code-block:: sh +.. code-block:: bash mongo localhost:27017/test myjsfile.js