aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbazeltsev <bazeltsev@ydb.tech>2023-03-17 17:24:49 +0300
committerbazeltsev <bazeltsev@ydb.tech>2023-03-17 17:24:49 +0300
commit7aefab771fa67b74c4e5879cdcc631bf390faa57 (patch)
treeab5cadf2d99672ea5c77ee298a31aa60db03e6a1
parent0c6916b16969111cbd8b8217f21ddd3a2ee3e46c (diff)
downloadydb-7aefab771fa67b74c4e5879cdcc631bf390faa57.tar.gz
Updated ydb on prem install docs
update dynnode start commands for 22-5+ PR from branch users/mzinal/ better bare metal deployment instruction in Russian systemd service file templates for ydbd, TLS certificate generator script sample for YDB
-rw-r--r--ydb/deploy/systemd_services/nontls/ydbd-storage.service25
-rw-r--r--ydb/deploy/systemd_services/nontls/ydbd-testdb.service25
-rw-r--r--ydb/deploy/systemd_services/ydbd-storage.service26
-rw-r--r--ydb/deploy/systemd_services/ydbd-testdb.service32
-rw-r--r--ydb/deploy/tls_cert_gen/README.md13
-rw-r--r--ydb/deploy/tls_cert_gen/ydb-ca-nodes.txt.example3
-rwxr-xr-xydb/deploy/tls_cert_gen/ydb-ca-update.sh154
-rw-r--r--ydb/deploy/yaml_config_examples/block-4-2.yaml12
-rw-r--r--ydb/deploy/yaml_config_examples/mirror-3dc-3-nodes.yaml12
-rw-r--r--ydb/deploy/yaml_config_examples/mirror-3dc-9-nodes.yaml12
-rw-r--r--ydb/docs/en/core/_includes/storage-device-requirements.md2
-rw-r--r--ydb/docs/en/core/cluster/topology.md5
-rw-r--r--ydb/docs/en/core/deploy/manual/_includes/prepare-configs.md5
-rw-r--r--ydb/docs/en/core/deploy/manual/deploy-ydb-on-premises.md509
-rw-r--r--ydb/docs/ru/core/_includes/storage-device-requirements.md2
-rw-r--r--ydb/docs/ru/core/cluster/system-requirements.md2
-rw-r--r--ydb/docs/ru/core/cluster/topology.md7
-rw-r--r--ydb/docs/ru/core/deploy/manual/_includes/prepare-configs.md5
-rw-r--r--ydb/docs/ru/core/deploy/manual/deploy-ydb-on-premises.md507
19 files changed, 835 insertions, 523 deletions
diff --git a/ydb/deploy/systemd_services/nontls/ydbd-storage.service b/ydb/deploy/systemd_services/nontls/ydbd-storage.service
new file mode 100644
index 0000000000..84e1ac2175
--- /dev/null
+++ b/ydb/deploy/systemd_services/nontls/ydbd-storage.service
@@ -0,0 +1,25 @@
+[Unit]
+Description=YDB storage node
+After=network-online.target rc-local.service
+Wants=network-online.target
+StartLimitInterval=10
+StartLimitBurst=15
+
+[Service]
+Restart=always
+RestartSec=1
+User=ydb
+PermissionsStartOnly=true
+StandardOutput=syslog
+StandardError=syslog
+SyslogIdentifier=ydbd
+SyslogFacility=daemon
+SyslogLevel=err
+Environment=LD_LIBRARY_PATH=/opt/ydb/lib
+ExecStart=/opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp --yaml-config /opt/ydb/cfg/config.yaml --grpc-port 2135 --ic-port 19001 --mon-port 8765 --node static
+LimitNOFILE=65536
+LimitCORE=0
+LimitMEMLOCK=3221225472
+
+[Install]
+WantedBy=multi-user.target
diff --git a/ydb/deploy/systemd_services/nontls/ydbd-testdb.service b/ydb/deploy/systemd_services/nontls/ydbd-testdb.service
new file mode 100644
index 0000000000..79a718e91f
--- /dev/null
+++ b/ydb/deploy/systemd_services/nontls/ydbd-testdb.service
@@ -0,0 +1,25 @@
+[Unit]
+Description=YDB testdb dynamic node
+After=network-online.target rc-local.service
+Wants=network-online.target
+StartLimitInterval=10
+StartLimitBurst=15
+
+[Service]
+Restart=always
+RestartSec=1
+User=ydb
+PermissionsStartOnly=true
+StandardOutput=syslog
+StandardError=syslog
+SyslogIdentifier=ydbd
+SyslogFacility=daemon
+SyslogLevel=err
+Environment=LD_LIBRARY_PATH=/opt/ydb/lib
+ExecStart=/opt/ydb/bin/ydbd server --grpc-port 2136 --ic-port 19002 --mon-port 8766 --yaml-config /opt/ydb/cfg/config.yaml --tenant /Root/testdb --node-broker <ydb1>:2135 --node-broker <ydb2>:2135 --node-broker <ydb3>:2135
+LimitNOFILE=65536
+LimitCORE=0
+LimitMEMLOCK=32212254720
+
+[Install]
+WantedBy=multi-user.target
diff --git a/ydb/deploy/systemd_services/ydbd-storage.service b/ydb/deploy/systemd_services/ydbd-storage.service
new file mode 100644
index 0000000000..98f321184a
--- /dev/null
+++ b/ydb/deploy/systemd_services/ydbd-storage.service
@@ -0,0 +1,26 @@
+[Unit]
+Description=YDB storage node
+After=network-online.target rc-local.service
+Wants=network-online.target
+StartLimitInterval=10
+StartLimitBurst=15
+
+[Service]
+Restart=always
+RestartSec=1
+User=ydb
+PermissionsStartOnly=true
+StandardOutput=syslog
+StandardError=syslog
+SyslogIdentifier=ydbd
+SyslogFacility=daemon
+SyslogLevel=err
+Environment=LD_LIBRARY_PATH=/opt/ydb/lib
+ExecStart=/opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp --yaml-config /opt/ydb/cfg/config.yaml \
+ --grpcs-port 2135 --ic-port 19001 --mon-port 8765 --mon-cert /opt/ydb/certs/web.pem --node static
+LimitNOFILE=65536
+LimitCORE=0
+LimitMEMLOCK=3221225472
+
+[Install]
+WantedBy=multi-user.target
diff --git a/ydb/deploy/systemd_services/ydbd-testdb.service b/ydb/deploy/systemd_services/ydbd-testdb.service
new file mode 100644
index 0000000000..0493a58940
--- /dev/null
+++ b/ydb/deploy/systemd_services/ydbd-testdb.service
@@ -0,0 +1,32 @@
+[Unit]
+Description=YDB testdb dynamic node
+After=network-online.target rc-local.service
+Wants=network-online.target
+StartLimitInterval=10
+StartLimitBurst=15
+
+[Service]
+Restart=always
+RestartSec=1
+User=ydb
+PermissionsStartOnly=true
+StandardOutput=syslog
+StandardError=syslog
+SyslogIdentifier=ydbd
+SyslogFacility=daemon
+SyslogLevel=err
+Environment=LD_LIBRARY_PATH=/opt/ydb/lib
+ExecStart=/opt/ydb/bin/ydbd server \
+ --grpcs-port 2136 --grpc-ca /opt/ydb/certs/ca.crt \
+ --ic-port 19002 --ca /opt/ydb/certs/ca.crt \
+ --mon-port 8766 --mon-cert /opt/ydb/certs/web.pem \
+ --yaml-config /opt/ydb/cfg/config.yaml --tenant /Root/testdb \
+ --node-broker grpcs://<ydb1>:2135 \
+ --node-broker grpcs://<ydb2>:2135 \
+ --node-broker grpcs://<ydb3>:2135
+LimitNOFILE=65536
+LimitCORE=0
+LimitMEMLOCK=32212254720
+
+[Install]
+WantedBy=multi-user.target
diff --git a/ydb/deploy/tls_cert_gen/README.md b/ydb/deploy/tls_cert_gen/README.md
new file mode 100644
index 0000000000..05d536cff7
--- /dev/null
+++ b/ydb/deploy/tls_cert_gen/README.md
@@ -0,0 +1,13 @@
+# TLS certificate generation script for YDB
+
+In order to simplify generation and re-generation of certificates for YDB cluster, the `ydb-ca-update.sh` script has been created.
+
+The recommended option is to generate a separate certificate for each cluster node. Users may choose to generate a single wildcard certificate for the whole cluster instead, by specifying the host name in the form of `*.domain.com`.
+
+The script reads the list of certificate host names from `ydb-ca-nodes.txt` file, one hostname per line. Host names should be specified exactly as they are defined in the YDB cluster configuration file. If the wildcard name is used, it should match the correspoding hosts DNS names. Up to two host names can be specified in each line, both referring to the same host.
+
+The generated certificates are written into the directory structure in the `CA` subdirectory, which is created if missing.
+
+In case the certificate authority is not initialized yet, private CA key and certificate are generated.
+
+For each host name or wildcard listed in the `ydb-ca-nodes.txt` file, each invocation of the script generates the new key and new certificate signed by the private CA. All generated files are put into `CA/certs/YYYY-MM-DD_hh-mi-ss` subdirectory.
diff --git a/ydb/deploy/tls_cert_gen/ydb-ca-nodes.txt.example b/ydb/deploy/tls_cert_gen/ydb-ca-nodes.txt.example
new file mode 100644
index 0000000000..edede8ace4
--- /dev/null
+++ b/ydb/deploy/tls_cert_gen/ydb-ca-nodes.txt.example
@@ -0,0 +1,3 @@
+ycydb-s1 ycydb-s1.ru-central1.internal
+ycydb-s2 ycydb-s2.ru-central1.internal
+ycydb-s3 ycydb-s3.ru-central1.internal
diff --git a/ydb/deploy/tls_cert_gen/ydb-ca-update.sh b/ydb/deploy/tls_cert_gen/ydb-ca-update.sh
new file mode 100755
index 0000000000..46703add66
--- /dev/null
+++ b/ydb/deploy/tls_cert_gen/ydb-ca-update.sh
@@ -0,0 +1,154 @@
+#! /bin/sh
+
+set -e
+set +u
+
+NODES_FILE=ydb-ca-nodes.txt
+KEY_BITS=4096
+
+[ -d CA ] || mkdir CA
+cd CA
+
+[ -d secure ] || mkdir secure
+[ -d certs ] || mkdir certs
+[ -d nodes ] || mkdir nodes
+
+if [ ! -f ca.cnf ]; then
+ echo "** Generating CA configuration file"
+cat >ca.cnf <<EOF
+[ ca ]
+default_ca = CA_default
+
+[ CA_default ]
+default_days = 365
+database = index.txt
+serial = serial.txt
+default_md = sha256
+copy_extensions = copy
+unique_subject = no
+
+[ req ]
+prompt=no
+distinguished_name = distinguished_name
+x509_extensions = extensions
+
+[ distinguished_name ]
+organizationName = YDB
+commonName = YDB CA
+
+[ extensions ]
+keyUsage = critical,digitalSignature,nonRepudiation,keyEncipherment,keyCertSign
+basicConstraints = critical,CA:true,pathlen:1
+
+[ signing_policy ]
+organizationName = supplied
+commonName = optional
+
+[ signing_node_req ]
+keyUsage = critical,digitalSignature,keyEncipherment
+extendedKeyUsage = serverAuth,clientAuth
+
+# Used to sign client certificates.
+[ signing_client_req ]
+keyUsage = critical,digitalSignature,keyEncipherment
+extendedKeyUsage = clientAuth
+EOF
+fi
+
+if [ ! -f secure/ca.key ]; then
+ echo "** Generating CA key"
+ openssl genrsa -out secure/ca.key ${KEY_BITS}
+fi
+
+if [ ! -f certs/ca.crt ]; then
+ echo "** Generating CA certificate"
+ openssl req -new -x509 -config ca.cnf -key secure/ca.key -out certs/ca.crt -days 1830 -batch
+fi
+
+[ -f index.txt ] || touch index.txt
+[ -f serial.txt ] || (echo 01 >serial.txt)
+
+# The '..' part here is due to changed current directory
+if [ ! -f ../${NODES_FILE} ]; then
+ echo "** Missing file ${NODES_FILE} - EXIT"
+ exit 0
+fi
+
+make_node_conf() {
+ mkdir -p nodes/"$1"
+ cfile=nodes/"$1"/options.cnf
+ if [ ! -f ${cfile} ]; then
+ echo "** Creating node configuration file for $2..."
+cat > ${cfile} <<EOF
+# OpenSSL node configuration file
+[ req ]
+prompt=no
+distinguished_name = distinguished_name
+req_extensions = extensions
+
+[ distinguished_name ]
+organizationName = YDB
+
+[ extensions ]
+subjectAltName = @alt_names
+
+[ alt_names ]
+DNS.1=$2
+EOF
+ if [ ! -z "$3" ]; then
+ vn=1
+ for nn in $3; do
+ vn=`echo "$vn + 1" | bc`
+ echo "DNS.$vn=$nn" >>${cfile}
+ done
+ fi
+ fi
+}
+
+make_node_key() {
+ if [ ! -f nodes/"$1"/node.key ]; then
+ mkdir -p nodes/"$1"
+ echo "** Generating key for node $2..."
+ openssl genrsa -out nodes/"$1"/node.key ${KEY_BITS}
+ fi
+}
+
+make_node_csr() {
+ if [ ! -f nodes/"$1"/node.csr ]; then
+ echo "** Generating CSR for node $2..."
+ openssl req -new -sha256 -config nodes/"$1"/options.cnf -key nodes/"$1"/node.key -out nodes/"$1"/node.csr -batch
+ fi
+}
+
+make_node_cert() {
+ if [ ! -f nodes/"$1"/node.crt ]; then
+ echo "** Generating certificate for node $2..."
+ openssl ca -config ca.cnf -keyfile secure/ca.key -cert certs/ca.crt -policy signing_policy \
+ -extensions signing_node_req -out nodes/"$1"/node.crt -outdir nodes/"$1"/ -in nodes/"$1"/node.csr -batch
+ fi
+ if [ ! -f nodes/"$1"/web.pem ]; then
+ cat nodes/"$1"/node.key nodes/"$1"/node.crt certs/ca.crt >nodes/"$1"/web.pem
+ fi
+}
+
+DEST_NAME=`date "+%Y-%m-%d_%H-%M-%S"`
+[ -d certs/"$DEST_NAME" ] || mkdir certs/"$DEST_NAME"
+cp -v certs/ca.crt certs/"$DEST_NAME"/
+
+move_node_files() {
+ mv -v nodes/"$1" certs/"$DEST_NAME"/
+}
+
+# The '..' part here is due to changed current directory
+(cat ../${NODES_FILE}; echo "") | while read node node2; do
+ if [ ! -z "$node" ]; then
+ safe_node=`echo $node | tr '*$/' '___'`
+ make_node_conf "$safe_node" "$node" "$node2"
+ make_node_key "$safe_node" "$node"
+ make_node_csr "$safe_node" "$node"
+ make_node_cert "$safe_node" "$node"
+ move_node_files "$safe_node" "$node"
+ fi
+done
+
+echo "All done. Certificates are in CA/certs/$DEST_NAME"
diff --git a/ydb/deploy/yaml_config_examples/block-4-2.yaml b/ydb/deploy/yaml_config_examples/block-4-2.yaml
index 2982a718f6..a3442b76b5 100644
--- a/ydb/deploy/yaml_config_examples/block-4-2.yaml
+++ b/ydb/deploy/yaml_config_examples/block-4-2.yaml
@@ -171,3 +171,15 @@ channel_profile_config:
pdisk_category: 1
storage_pool_kind: ssd
profile_id: 0
+interconnect_config:
+ start_tcp: true
+ encryption_mode: OPTIONAL
+ path_to_certificate_file: "/opt/ydb/certs/node.crt"
+ path_to_private_key_file: "/opt/ydb/certs/node.key"
+ path_to_ca_file: "/opt/ydb/certs/ca.crt"
+grpc_config:
+ cert: "/opt/ydb/certs/node.crt"
+ key: "/opt/ydb/certs/node.key"
+ ca: "/opt/ydb/certs/ca.crt"
+ services_enabled:
+ - legacy
diff --git a/ydb/deploy/yaml_config_examples/mirror-3dc-3-nodes.yaml b/ydb/deploy/yaml_config_examples/mirror-3dc-3-nodes.yaml
index 77d493ad48..c5f0757f7f 100644
--- a/ydb/deploy/yaml_config_examples/mirror-3dc-3-nodes.yaml
+++ b/ydb/deploy/yaml_config_examples/mirror-3dc-3-nodes.yaml
@@ -151,3 +151,15 @@ channel_profile_config:
pdisk_category: 0
storage_pool_kind: ssd
profile_id: 0
+interconnect_config:
+ start_tcp: true
+ encryption_mode: OPTIONAL
+ path_to_certificate_file: "/opt/ydb/certs/node.crt"
+ path_to_private_key_file: "/opt/ydb/certs/node.key"
+ path_to_ca_file: "/opt/ydb/certs/ca.crt"
+grpc_config:
+ cert: "/opt/ydb/certs/node.crt"
+ key: "/opt/ydb/certs/node.key"
+ ca: "/opt/ydb/certs/ca.crt"
+ services_enabled:
+ - legacy
diff --git a/ydb/deploy/yaml_config_examples/mirror-3dc-9-nodes.yaml b/ydb/deploy/yaml_config_examples/mirror-3dc-9-nodes.yaml
index fcb593b24e..ccb58cd258 100644
--- a/ydb/deploy/yaml_config_examples/mirror-3dc-9-nodes.yaml
+++ b/ydb/deploy/yaml_config_examples/mirror-3dc-9-nodes.yaml
@@ -168,3 +168,15 @@ channel_profile_config:
pdisk_category: 1
storage_pool_kind: ssd
profile_id: 0
+interconnect_config:
+ start_tcp: true
+ encryption_mode: OPTIONAL
+ path_to_certificate_file: "/opt/ydb/certs/node.crt"
+ path_to_private_key_file: "/opt/ydb/certs/node.key"
+ path_to_ca_file: "/opt/ydb/certs/ca.crt"
+grpc_config:
+ cert: "/opt/ydb/certs/node.crt"
+ key: "/opt/ydb/certs/node.key"
+ ca: "/opt/ydb/certs/ca.crt"
+ services_enabled:
+ - legacy
diff --git a/ydb/docs/en/core/_includes/storage-device-requirements.md b/ydb/docs/en/core/_includes/storage-device-requirements.md
index 06cd0192b2..823f961d4f 100644
--- a/ydb/docs/en/core/_includes/storage-device-requirements.md
+++ b/ydb/docs/en/core/_includes/storage-device-requirements.md
@@ -6,4 +6,6 @@ The minimum disk size is 80 GB, otherwise the {{ ydb-short-name }} node won't be
Configurations with disks less than 800 GB or any types of storage system virtualization cannot be used for production services or system performance testing.
+We don't recommend storing {{ ydb-short-name }} data on disks used by other processes (including the operating system).
+
{% endnote %}
diff --git a/ydb/docs/en/core/cluster/topology.md b/ydb/docs/en/core/cluster/topology.md
index 4a2a6d059e..563010ca02 100644
--- a/ydb/docs/en/core/cluster/topology.md
+++ b/ydb/docs/en/core/cluster/topology.md
@@ -1,5 +1,10 @@
# Topology
+{{ ydb-short-name }} cluster is built from nodes of two types - static and dynamic:
+
+* static nodes store data, implementing one of the supported redundancy modes depending on the operating mode configured;
+* dynamic nodes execute queries, handle transaction coordination and perform other data management functions.
+
Cluster topology is determined by the fault tolerance requirements. The following operating modes are available:
| Mode | Storage<br>volume multiplier | Minimum<br>number<br>of nodes | Description |
diff --git a/ydb/docs/en/core/deploy/manual/_includes/prepare-configs.md b/ydb/docs/en/core/deploy/manual/_includes/prepare-configs.md
index fe4aaa3d0a..39cabfd401 100644
--- a/ydb/docs/en/core/deploy/manual/_includes/prepare-configs.md
+++ b/ydb/docs/en/core/deploy/manual/_includes/prepare-configs.md
@@ -42,6 +42,11 @@ Prepare a configuration file for {{ ydb-short-name }}:
rack: '1'
```
+1. In the `blob_storage_config` section, update the FQDN of each node used to store the static storage group:
+
+ * in the `mirror-3-dc` mode, FQDNs for 9 nodes are needed;
+ * in the `block-4-2` mode, FQDNs for 8 nodes are needed.
+
1. Enable user authentication (optional).
If you plan to use authentication and user access differentiation features in the {{ ydb-short-name }} cluster, add the following parameters to the `domains_config` section:
diff --git a/ydb/docs/en/core/deploy/manual/deploy-ydb-on-premises.md b/ydb/docs/en/core/deploy/manual/deploy-ydb-on-premises.md
index c1b755f52b..043835eab5 100644
--- a/ydb/docs/en/core/deploy/manual/deploy-ydb-on-premises.md
+++ b/ydb/docs/en/core/deploy/manual/deploy-ydb-on-premises.md
@@ -6,79 +6,84 @@ This document describes how to deploy a multi-tenant {{ ydb-short-name }} cluste
### Prerequisites {#requirements}
-Make sure you have SSH access to all servers. This is required to install artifacts and run the {{ ydb-short-name }} executable. The network configuration must allow TCP connections on the following ports (by default):
+Review the [system requirements](../../cluster/system-requirements.md) and the [cluster topology](../../cluster/topology.md).
+
+Make sure you have SSH access to all servers. This is required to install artifacts and run the {{ ydb-short-name }} executable.
+
+The network configuration must allow TCP connections on the following ports (by default, can be changed if necessary):
+* 22: SSH service.
* 2135, 2136: GRPC for client-cluster interaction.
* 19001, 19002: Interconnect for intra-cluster node interaction.
-* 8765, 8766: The HTTP interface for cluster monitoring.
+* 8765, 8766: The HTTP interface of {{ ydb-short-name }} Embedded UI.
-Review the [system requirements](../../cluster/system-requirements.md) and the [cluster topology](../../cluster/topology.md).
+Ensure the clock synchronization for the servers within the cluster, using `ntpd` or `chrony` tools. Ideally all servers should be synced to the same time source, to ensure that leap seconds are handled in the same way.
+
+If your servers' Linux flavor uses `syslogd` for logging, configure logfiles rotation using the `logrotate` or similar tools. {{ ydb-short-name }} services may generate a significant amount of log data, specifically when the logging level is increased for diagnostical purposes, so system log files rotation is important to avoid the overflows of the `/var` filesystem.
Select the servers and disks to be used for storing data:
* Use the `block-4-2` fault tolerance model for cluster deployment in one availability zone (AZ). Use at least 8 nodes to be able to withstand the loss of 2 of them.
* Use the `mirror-3-dc` fault tolerance model for cluster deployment in three availability zones (AZ). To survive the loss of a single AZ and of 1 node in another AZ, use at least 9 nodes. The number of nodes in each AZ should be the same.
-Run each static node on a separate server.
+{% note info %}
-For more information about hardware requirements, see [{#T}](../../cluster/system-requirements.md).
+Run each static node on a separate server. Static and dynamic nodes may run on the same server. Multiple dynamic nodes may run on the same server, provided that it has sufficient compute resources.
-## Create a system user and a group to run {{ ydb-short-name }} {#create-user}
-
-On each server that will be running {{ ydb-short-name }}, execute the command below:
-
-```bash
-sudo groupadd ydb
-sudo useradd ydb -g ydb
-```
+{% endnote %}
-To make sure that {{ ydb-short-name }} has access to block disks to run, you need to add the process owner to the `disk` group:
+For more information about the hardware requirements, see [{#T}](../../cluster/system-requirements.md).
-```bash
-sudo usermod -aG disk ydb
-```
+### TLS keys and certificates preparation {#tls-certificates}
-## Prepare and format disks on each server {#prepare-disks}
+Traffic protection and {{ ydb-short-name }} server node authentication is implemented using the TLS protocol. Before installing the cluster, the list of nodes, their naming scheme and particular names should be defined, and used to prepare the TLS keys and certificates.
-{% note warning %}
+The existing or new TLS certificates can be used. The following PEM-encoded key and certificate files are needed to run the cluster:
+* `ca.crt` - public certificate of the Certification Authority (CA), used to sign all other TLS certificate (same file on all servers in the cluster);
+* `node.key` - secret keys for each of the cluster nodes (separate key for each server);
+* `node.crt` - public certificate for each of the cluster nodes (the certificate for the corresponding private key);
+* `web.pem` - node secret key, node public certificate and Certification Authority certificate concatenation, to be used by the internal HTTP monitoring service (separate file for each server).
-We don't recommend storing data on disks used by other processes (including the operating system).
+Certificate parameters are typically defined by the organizational policies. Typically {{ ydb-short-name }} certificates are generated with the following parameters:
+* 2048 or 4096 bit RSA keys;
+* SHA-256 with RSA encryption algorithm for certificate signing;
+* node certificates validity period - 1 year;
+* CA certificate validity period - 3 years or more.
-{% endnote %}
+The CA certificate must be marked appropriately: it needs the CA sign, and the usage for "Digital Signature, Non Repudiation, Key Encipherment, Certificate Sign" enabled.
-{% include [_includes/storage-device-requirements.md](../../_includes/storage-device-requirements.md) %}
+For node certificates, it is important that the actual host name (or names) matches the values specified in the "Subject Alternative Name" field. Node certificates should have "Digital Signature, Key Encipherment" usage enabled, as well as "TLS Web Server Authentication, TLS Web Client Authentication" extended usage. Node certificates should support both server and client authentication (`extendedKeyUsage = serverAuth,clientAuth` option in the OpenSSL settings).
-1. Create a partition on the selected disk:
+{{ ydb-short-name }} repository on Github contains the [sample script](https://github.com/ydb-platform/ydb/blob/main/ydb/deploy/tls_cert_gen/) which can be used to automate the batch generation or renewal of TLS certificates for the whole cluster. The script can build the key and certificate files for the list of cluster nodes in a single operation, which simplifies the installation preparation.
- {% note alert %}
+## Create a system user and a group to run {{ ydb-short-name }} {#create-user}
- The following step will delete all partitions on the specified disks. Make sure that you specified the disks that have no other data!
+On each server that will be running {{ ydb-short-name }}, execute the command below:
- {% endnote %}
+```bash
+sudo groupadd ydb
+sudo useradd ydb -g ydb
+```
- ```bash
- sudo parted /dev/nvme0n1 mklabel gpt -s
- sudo parted -a optimal /dev/nvme0n1 mkpart primary 0% 100%
- sudo parted /dev/nvme0n1 name 1 ydb_disk_ssd_01
- sudo partx --u /dev/nvme0n1
- ```
+To make sure that {{ ydb-short-name }} has access to block disks to run, the new system user needs to be added to the `disk` group:
- As a result, a disk labeled `/dev/disk/by-partlabel/ydb_disk_ssd_01` will appear on the system.
+```bash
+sudo usermod -aG disk ydb
+```
- If you plan to use more than one disk on each server, replace `ydb_disk_ssd_01` with a unique label for each one. You'll need to use these disks later in the configuration files.
+## Install {{ ydb-short-name }} software on each server {#install-binaries}
-1. Download and unpack an archive with the `ydbd` executable and the libraries required for {{ ydb-short-name }} to run:
+1. Download and unpack the archive with the `ydbd` executable and the required libraries:
```bash
mkdir ydbd-stable-linux-amd64
curl -L https://binaries.ydb.tech/ydbd-stable-linux-amd64.tar.gz | tar -xz --strip-component=1 -C ydbd-stable-linux-amd64
```
-1. Create directories to run:
+1. Create the directories to install the {{ ydb-short-name }} binaries:
```bash
sudo mkdir -p /opt/ydb /opt/ydb/cfg
- sudo chown -R ydb:ydb /opt/ydb
```
1. Copy the executable and libraries to the appropriate directories:
@@ -88,183 +93,84 @@ We don't recommend storing data on disks used by other processes (including the
sudo cp -iR ydbd-stable-linux-amd64/lib /opt/ydb/
```
-1. Format the disk with the builtin command below:
-
- ```bash
- sudo LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd admin bs disk obliterate /dev/disk/by-partlabel/ydb_disk_ssd_01
- ```
+1. Set the file and directory ownership:
- Perform this operation for each disk that will be used for data storage.
+ ```bash
+ sudo chown -R root:bin /opt/ydb
+ ```
-## Prepare configuration files {#config}
-
-{% list tabs %}
-
-- Unprotected mode
-
- In unprotected mode, traffic between cluster nodes and between the client and cluster uses an unencrypted connection. Use this mode for testing purposes.
-
- {% include [prepare-configs.md](_includes/prepare-configs.md) %}
+## Prepare and format disks on each server {#prepare-disks}
-- Protected mode
+{% include [_includes/storage-device-requirements.md](../../_includes/storage-device-requirements.md) %}
- In protected mode, traffic between cluster nodes and between the client and cluster is encrypted using the TLS protocol.
+1. Create a partition on the selected disk:
- {% note info %}
+ {% note alert %}
- You can use existing TLS certificates. It's important that certificates support both server and client authentication (`extendedKeyUsage = serverAuth,clientAuth`).
+ The following step will delete all partitions on the specified disks. Make sure that you specified the disks that have no other data!
{% endnote %}
- 1. Create a key and a certificate for the Certification Authority (CA):
-
- 1. Create a directory named `secure` to store the CA key and one named `certs` for certificates and node keys:
-
- ```bash
- mkdir secure
- mkdir certs
- ```
-
- 1. Create a configuration file named `ca.cnf` with the following contents:
-
- ```text
- [ ca ]
- default_ca = CA_default
-
- [ CA_default ]
- default_days = 365
- database = index.txt
- serial = serial.txt
- default_md = sha256
- copy_extensions = copy
- unique_subject = no
-
- [ req ]
- prompt=no
- distinguished_name = distinguished_name
- x509_extensions = extensions
-
- [ distinguished_name ]
- organizationName = YDB
- commonName = YDB CA
-
- [ extensions ]
- keyUsage = critical,digitalSignature,nonRepudiation,keyEncipherment,keyCertSign
- basicConstraints = critical,CA:true,pathlen:1
-
- [ signing_policy ]
- organizationName = supplied
- commonName = optional
-
- [ signing_node_req ]
- keyUsage = critical,digitalSignature,keyEncipherment
- extendedKeyUsage = serverAuth,clientAuth
-
- # Used to sign client certificates.
- [ signing_client_req ]
- keyUsage = critical,digitalSignature,keyEncipherment
- extendedKeyUsage = clientAuth
- ```
-
- 1. Create a CA key:
-
- ```bash
- openssl genrsa -out secure/ca.key 2048
- ```
-
- Save this key separately, you'll need it for issuing certificates. If it's lost, you'll have to reissue all certificates.
-
- 1. Create a private Certificate Authority (CA) certificate:
-
- ```bash
- openssl req -new -x509 -config ca.cnf -key secure/ca.key -out certs/ca.crt -days 1830 -batch
- ```
-
- 1. Create a text database and an OpenSSL certificate index file:
-
- ```bash
- touch index.txt
- echo 01 >serial.txt
- ```
-
- 1. Create keys and certificates for the cluster nodes:
-
- 1. Create a `node.cnf` configuration file with the following contents:
-
- ```text
- # OpenSSL node configuration file
- [ req ]
- prompt = no
- distinguished_name = distinguished_name
- req_extensions = extensions
-
- [ distinguished_name ]
- organizationName = YDB
-
- [ extensions ]
- subjectAltName = DNS:<node>.<domain>
- ```
-
- 1. Create a certificate key:
-
- ```bash
- openssl genrsa -out certs/node.key 2048
- ```
-
- 1. Create a Certificate Signing Request (CSR):
-
- ```bash
- openssl req -new -sha256 -config node.cnf -key certs/node.key -out node.csr -batch
- ```
-
- 1. Create a node certificate:
-
- ```bash
- openssl ca -config ca.cnf -keyfile secure/ca.key -cert certs/ca.crt -policy signing_policy \
- -extensions signing_node_req -out certs/node.crt -outdir certs/ -in node.csr -batch
- ```
+ ```bash
+ DISK=/dev/nvme0n1
+ sudo parted ${DISK} mklabel gpt -s
+ sudo parted -a optimal ${DISK} mkpart primary 0% 100%
+ sudo parted ${DISK} name 1 ydb_disk_ssd_01
+ sudo partx --u ${DISK}
+ ```
- Create similar certificate-key pairs for each node.
+ As a result, a disk labeled `/dev/disk/by-partlabel/ydb_disk_ssd_01` will appear in the system.
- 1. Create certificate directories on each node:
+ If you plan to use more than one disk on each server, replace `ydb_disk_ssd_01` with a unique label for each one. Disk labels must be unique within a single server, and are used in the configuration files, as shown in the subsequent instructions.
- ```bash
- sudo mkdir /opt/ydb/certs
- sudo chown -R ydb:ydb /opt/ydb/certs
- sudo chmod 0750 /opt/ydb/certs
- ```
+ For cluster servers having similar disk configuration it is convenient to use exacty the same disk labels, to simplify the subsequent configuration.
- 1. Copy the certificates and node keys to the installation folder:
+2. Format the disk with the builtin command below:
- ```bash
- sudo -u ydb cp certs/ca.crt certs/node.crt certs/node.key /opt/ydb/certs/
- ```
+ ```bash
+ sudo LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd admin bs disk obliterate /dev/disk/by-partlabel/ydb_disk_ssd_01
+ ```
- 1. {% include [prepare-configs.md](_includes/prepare-configs.md) %}
+ Perform this operation for each disk that will be used to store {{ ydb-short-name }} data.
- 1. Enable the traffic encryption mode in the {{ ydb-short-name }} configuration file.
+## Prepare configuration files {#config}
- In the `interconnect_config` and `grpc_config` sections, specify the path to the certificate, key, and CA certificate:
+{% include [prepare-configs.md](_includes/prepare-configs.md) %}
+
+When TLS traffic protection is to be used (which is the default), ensure that {{ ydb-short-name }} configuration file contains the proper paths to key and certificate files in the `interconnect_config` and `grpc_config` sections, as shown below:
+
+```json
+interconnect_config:
+ start_tcp: true
+ encryption_mode: OPTIONAL
+ path_to_certificate_file: "/opt/ydb/certs/node.crt"
+ path_to_private_key_file: "/opt/ydb/certs/node.key"
+ path_to_ca_file: "/opt/ydb/certs/ca.crt"
+grpc_config:
+ cert: "/opt/ydb/certs/node.crt"
+ key: "/opt/ydb/certs/node.key"
+ ca: "/opt/ydb/certs/ca.crt"
+ services_enabled:
+ - legacy
+```
- ```json
- interconnect_config:
- start_tcp: true
- encryption_mode: OPTIONAL
- path_to_certificate_file: "/opt/ydb/certs/node.crt"
- path_to_private_key_file: "/opt/ydb/certs/node.key"
- path_to_ca_file: "/opt/ydb/certs/ca.crt"
+Save the {{ ydb-short-name }} configuration file as `/opt/ydb/cfg/config.yaml` on each server of the cluster.
- grpc_config:
- cert: "/opt/ydb/certs/node.crt"
- key: "/opt/ydb/certs/node.key"
- ca: "/opt/ydb/certs/ca.crt"
- ```
+For more detailed information about creating configurations, see [Cluster configurations](../configuration/config.md).
-{% endlist %}
+## Copy TLS keys and certificates to each server {#tls-copy-cert}
-Save the {{ ydb-short-name }} configuration file as `/opt/ydb/cfg/config.yaml` on each cluster node.
+The TLS keys and certificates prepared need to be copied into the protected directory on each node of the {{ ydb-short-name }} cluster. An example of commands to create of the protected directory and copy the key and certificate files into it is shown below.
-For more detailed information about creating configurations, see [Cluster configurations](../configuration/config.md).
+```bash
+sudo mkdir -p /opt/ydb/certs
+sudo cp -v ca.crt /opt/ydb/certs/
+sudo cp -v node.crt /opt/ydb/certs/
+sudo cp -v node.key /opt/ydb/certs/
+sudo cp -v web.pem /opt/ydb/certs/
+sudo chown -R ydb:ydb /opt/ydb/certs
+sudo chmod 700 /opt/ydb/certs
+```
## Start static nodes {#start-storage}
@@ -272,19 +178,19 @@ For more detailed information about creating configurations, see [Cluster config
- Manually
- Run {{ ydb-short-name }} storage on each node:
+ Run {{ ydb-short-name }} storage service on each static node:
```bash
sudo su - ydb
cd /opt/ydb
export LD_LIBRARY_PATH=/opt/ydb/lib
- /opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp --yaml-config /opt/ydb/cfg/config.yaml \
- --grpc-port 2135 --ic-port 19001 --mon-port 8765 --node static
+ /opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp --yaml-config /opt/ydb/cfg/config.yaml \
+ --grpcs-port 2135 --ic-port 19001 --mon-port 8765 --mon-cert /opt/ydb/certs/web.pem --node static
```
- Using systemd
- On every node, create a `/etc/systemd/system/ydbd-storage.service` configuration file with the following contents:
+ On each static node, create a `/etc/systemd/system/ydbd-storage.service` systemd configuration file with the following contents. Sample file is also available [in the repository](https://github.com/ydb-platform/ydb/blob/main/ydb/deploy/systemd_services/ydbd-storage.service).
```text
[Unit]
@@ -305,7 +211,10 @@ For more detailed information about creating configurations, see [Cluster config
SyslogFacility=daemon
SyslogLevel=err
Environment=LD_LIBRARY_PATH=/opt/ydb/lib
- ExecStart=/opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp --yaml-config /opt/ydb/cfg/config.yaml --grpc-port 2135 --ic-port 19001 --mon-port 8765 --node static
+ ExecStart=/opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp \
+ --yaml-config /opt/ydb/cfg/config.yaml \
+ --grpcs-port 2135 --ic-port 19001 --mon-port 8765 \
+ --mon-cert /opt/ydb/certs/web.pem --node static
LimitNOFILE=65536
LimitCORE=0
LimitMEMLOCK=3221225472
@@ -314,7 +223,7 @@ For more detailed information about creating configurations, see [Cluster config
WantedBy=multi-user.target
```
- Run {{ ydb-short-name }} storage on each node:
+ Run {{ ydb-short-name }} storage service on each static node:
```bash
sudo systemctl start ydbd-storage
@@ -324,98 +233,122 @@ For more detailed information about creating configurations, see [Cluster config
## Initialize a cluster {#initialize-cluster}
-Cluster initialization actions depend on whether user authentication mode is enabled in the {{ ydb-short-name }} configuration file.
-
-{% list tabs %}
+Cluster initialization configures the set of static nodes defined in the cluster configuration file to store {{ ydb-short-name }} data.
-- Authentication disabled
+To perform the cluster initialization, the path to the `ca.crt` file containing the Certification Authority certificate has to be specified in the corresponding commands. Copy the `ca.crt` file to the host where those commands will be executed.
- On one of the cluster nodes, run the commands:
+Cluster initialization actions sequence depends on whether user authentication mode is enabled in the {{ ydb-short-name }} configuration file.
- ```bash
- export LD_LIBRARY_PATH=/opt/ydb/lib
- /opt/ydb/bin/ydbd admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
- echo $?
- ```
-
- The command execution code should be null.
+{% list tabs %}
- Authentication enabled
- To execute administrative commands (including cluster initialization, database creation, disk management, and others) in a cluster with user authentication mode enabled, you must first get an authentication token using the {{ ydb-short-name }} CLI client version 2.0.0 or higher. You must install the {{ ydb-short-name }} CLI client on any computer with network access to the cluster nodes (for example, on one of the cluster nodes) by following the [installation instructions](../../reference/ydb-cli/install.md).
+ To execute the administrative commands (including cluster initialization, database creation, disk management, and others) in a cluster with user authentication enabled, an authentication token has to be obtained using the {{ ydb-short-name }} CLI client version 2.0.0 or higher. The {{ ydb-short-name }} CLI client can be installed on any computer with network access to the cluster nodes (for example, on one of the cluster nodes) by following the [installation instructions](../../reference/ydb-cli/install.md).
When the cluster is first installed, it has a single `root` account with a blank password, so the command to get the token is the following:
```bash
- ydb -e grpc://<node1.ydb.tech>:2135 -d /Root \
- --user root --no-password auth get-token --force >token-file
+ ydb -e grpcs://<node1.ydb.tech>:2135 -d /Root --ca-file ca.crt \
+ --user root --no-password auth get-token --force >token-file
```
- Any cluster server can be specified as a connection server (the `-e` or `--endpoint` parameter).
+ Any static node's address can be specified as the endpoint (the `-e` or `--endpoint` parameter).
- If TLS traffic protection was enabled, use the protected `grpcs` protocol instead of the `grpc` protocol in the command above and additionally specify the path to the CA certificate in the `--ca-file` parameter. For example:
+ If the command above is executed successfully, the authentication token will be written to `token-file`. This token file needs to be copied to one of the cluster storage nodes. Next, run the following commands on this cluster node:
```bash
- ydb -e grpcs://<node1.ydb.tech>:2135 -d /Root --ca-file /opt/ydb/certs/ca.crt \
- --user root --no-password auth get-token --force >token-file
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd -f token-file --ca-file ca.crt -s grpcs://`hostname -f`:2135 \
+ admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
+ echo $?
```
- If the command above is executed successfully, the authentication token will be written to `token-file`. You need to copy this file to the cluster node on which you intend to run the cluster initialization and database creation commands later. Next, run the commands on this cluster node:
+- Authentication disabled
+
+ On one of the cluster storage nodes, run the commands:
```bash
export LD_LIBRARY_PATH=/opt/ydb/lib
- /opt/ydb/bin/ydbd -f token-file admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
+ /opt/ydb/bin/ydbd --ca-file ca.crt -s grpcs://`hostname -f`:2135 \
+ admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
echo $?
```
- The command execution code should be null.
-
{% endlist %}
+Upon successful cluster initialization, the command execution status code shown on the screen should be zero.
+
## Create a database {#create-db}
-To work with tables, you need to create at least one database and run a process to service this database (a dynamic node):
+To work with tables, you need to create at least one database and run a process (or processes) to service this database (a dynamic node).
-```bash
-LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd admin database /Root/testdb create ssd:1
-```
+In order to run the database creation administrative command, the `ca.crt` file with the CA certificate is needed, similar to the cluster initialization steps shown above.
-If user authentication mode is enabled in the cluster, the authentication token must be passed to the database creation command. The procedure for getting a token is described in the [cluster initialization](#initialize-cluster) section.
+On database creation the initial number of storage groups is configured, which determines the available input/output throughput and data storage capacity. The number of storage groups can be increased after the database creation, if needed.
-A variant of the database creation command with reference to the token file:
+Database creation actions sequence depends on whether user authentication mode is enabled in the {{ ydb-short-name }} configuration file.
-```bash
-LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd -f token-file admin database /Root/testdb create ssd:1
-```
+{% list tabs %}
+
+- Authentication enabled
+
+ The authentication token is needed. The existing token file obtained at [cluster initialization stage](#initialize-cluster) can be used, or the new token can be obtained.
+
+ The authentication token file needs to be copied to one of the static nodes. Next, run the following commands on this cluster node:
+
+ ```bash
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd -f token-file --ca-file ca.crt -s grpcs://`hostname -s`:2135 \
+ admin database /Root/testdb create ssd:1
+ echo $?
+ ```
+
+- Authentication disabled
+
+ On one of the static nodes, run the commands:
+
+ ```bash
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd --ca-file ca.crt -s grpcs://`hostname -s`:2135 \
+ admin database /Root/testdb create ssd:1
+ echo $?
+ ```
+
+{% endlist %}
The command examples above use the following parameters:
* `/Root`: The name of the root domain, must match the `domains_config`.`domain`.`name` setting in the cluster configuration file.
* `testdb`: The name of the created database.
-* `ssd:1`: The name of the storage pool and the number of the block in the pool. The pool name usually means the type of data storage devices and must match the `storage_pool_types`.`kind` setting inside the `domains_config`.`domain` element of the configuration file.
+* `ssd:1`: The name of the storage pool and the number of the storage groups to be used by the database. The pool name usually means the type of data storage devices and must match the `storage_pool_types`.`kind` setting inside the `domains_config`.`domain` element of the configuration file.
+
+Upon successful database creation, the command execution status code shown on the screen should be zero.
-## Start the database dynamic node {#start-dynnode}
+## Start the dynamic nodes {#start-dynnode}
{% list tabs %}
- Manually
- Start the {{ ydb-short-name }} dynamic node for the /Root/testdb database:
+ Start the {{ ydb-short-name }} dynamic node for the `/Root/testdb` database:
```bash
sudo su - ydb
cd /opt/ydb
export LD_LIBRARY_PATH=/opt/ydb/lib
- /opt/ydb/bin/ydbd server --grpc-port 2136 --ic-port 19002 --mon-port 8766 --yaml-config /opt/ydb/cfg/config.yaml \
- --tenant /Root/testdb --node-broker <node1.ydb.tech>:2135 --node-broker <node2.ydb.tech>:2135 --node-broker <node3.ydb.tech>:2135
+ /opt/ydb/bin/ydbd server --grpcs-port 2136 --grpc-ca /opt/ydb/certs/ca.crt \
+ --ic-port 19002 --ca /opt/ydb/certs/ca.crt \
+ --mon-port 8766 --mon-cert /opt/ydb/certs/web.pem \
+ --yaml-config /opt/ydb/cfg/config.yaml --tenant /Root/testdb \
+ --node-broker grpcs://<ydb1>:2135 \
+ --node-broker grpcs://<ydb2>:2135 \
+ --node-broker grpcs://<ydb3>:2135
```
- Where `<nodeN.ydb.tech>` is the FQDN of the servers running the static nodes.
-
- Run additional dynamic nodes on other servers to ensure database availability.
+ In the command shown above `<ydbN>` entries correspond to the FQDNs of any three servers running the static nodes.
- Using systemd
- 1. Create a configuration file named `/etc/systemd/system/ydbd-testdb.service` with the following content:
+ Create a systemd configuration file named `/etc/systemd/system/ydbd-testdb.service` with the following content. Sample file is also available [in the repository](https://github.com/ydb-platform/ydb/blob/main/ydb/deploy/systemd_services/ydbd-testdb.service).
```text
[Unit]
@@ -436,7 +369,14 @@ The command examples above use the following parameters:
SyslogFacility=daemon
SyslogLevel=err
Environment=LD_LIBRARY_PATH=/opt/ydb/lib
- ExecStart=/opt/ydb/bin/ydbd server --grpc-port 2136 --ic-port 19002 --mon-port 8766 --yaml-config /opt/ydb/cfg/config.yaml --tenant /Root/testdb --node-broker <node1.ydb.tech>:2135 --node-broker <node2.ydb.tech>:2135 --node-broker <node3.ydb.tech>:2135
+ ExecStart=/opt/ydb/bin/ydbd server \
+ --grpcs-port 2136 --grpc-ca /opt/ydb/certs/ca.crt \
+ --ic-port 19002 --ca /opt/ydb/certs/ca.crt \
+ --mon-port 8766 --mon-cert /opt/ydb/certs/web.pem \
+ --yaml-config /opt/ydb/cfg/config.yaml --tenant /Root/testdb \
+ --node-broker grpcs://<ydb1>:2135 \
+ --node-broker grpcs://<ydb2>:2135 \
+ --node-broker grpcs://<ydb3>:2135
LimitNOFILE=65536
LimitCORE=0
LimitMEMLOCK=32212254720
@@ -445,48 +385,48 @@ The command examples above use the following parameters:
WantedBy=multi-user.target
```
- Where `<nodeN.ydb.tech>` is the FQDN of the servers running the static nodes.
+ In the file shown above `<ydbN>` entries correspond to the FQDNs of any three servers running the static nodes.
- 1. Start the {{ ydb-short-name }} dynamic node for the /Root/testdb database:
+ Start the {{ ydb-short-name }} dynamic node for the `/Root/testdb` database:
```bash
sudo systemctl start ydbd-testdb
```
- 1. Run additional dynamic nodes on other servers to ensure database availability.
-
{% endlist %}
-## Initial account setup {#security-setup}
+Start the additional dynamic nodes on other servers to scale and to ensure database and availability.
-If authentication mode is enabled in the cluster configuration file, initial account setup must be done before working with the {{ ydb-short-name }} cluster.
+## Initial user accounts setup {#security-setup}
+
+If authentication mode is enabled in the cluster configuration file, initial user accounts setup must be done before working with the {{ ydb-short-name }} cluster.
The initial installation of the {{ ydb-short-name }} cluster automatically creates a `root` account with a blank password, as well as a standard set of user groups described in the [Access management](../../cluster/access.md) section.
-To perform initial account setup in the created {{ ydb-short-name }} cluster, run the following operations:
+To perform the initial user accounts setup in the created {{ ydb-short-name }} cluster, run the following operations:
1. Install the {{ ydb-short-name }} CLI as described in the [documentation](../../reference/ydb-cli/install.md).
1. Set the password for the `root` account:
```bash
- ydb -e grpc://<node.ydb.tech>:2136 -d /Root/testdb --user root --no-password \
+ ydb --ca-file ca.crt -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --user root --no-password \
yql -s 'ALTER USER root PASSWORD "passw0rd"'
```
Replace the `passw0rd` value with the required password.
-1. Create additional accounts:
+1. Create the additional accounts:
```bash
- ydb -e grpc://<node.ydb.tech>:2136 -d /Root/testdb --user root \
+ ydb --ca-file ca.crt -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --user root \
yql -s 'CREATE USER user1 PASSWORD "passw0rd"'
```
-1. Set the account rights by including them in the integrated groups:
+1. Set the account permissions by including it into the security groups:
```bash
- ydb -e grpc://<node.ydb.tech>:2136 -d /Root/testdb --user root \
+ ydb --ca-file ca.crt -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --user root \
yql -s 'ALTER GROUP `ADMINS` ADD USER user1'
```
@@ -494,8 +434,6 @@ In the command examples above, `<node.ydb.tech>` is the FQDN of the server runni
When running the account creation and group assignment commands, the {{ ydb-short-name }} CLI client will request the `root` user's password. You can avoid multiple password entries by creating a connection profile as described in the [{{ ydb-short-name }} CLI documentation](../../reference/ydb-cli/profile/index.md).
-If TLS traffic protection was enabled in the cluster, use the protected `grpcs` protocol instead of the `grpc` protocol in the command above and specify the path to the CA certificate in the `--ca-file` parameter (or save it in the connection profile).
-
## Test the created database {#try-first-db}
1. Install the {{ ydb-short-name }} CLI as described in the [documentation](../../reference/ydb-cli/install.md).
@@ -503,15 +441,64 @@ If TLS traffic protection was enabled in the cluster, use the protected `grpcs`
1. Create a `test_table`:
```bash
- ydb -e grpc://<node.ydb.tech>:2136 -d /Root/testdb scripting yql \
- --script 'CREATE TABLE `testdir/test_table` (id Uint64, title Utf8, PRIMARY KEY (id));'
+ ydb --ca-file ca.crt -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --user root \
+ yql -s 'CREATE TABLE `testdir/test_table` (id Uint64, title Utf8, PRIMARY KEY (id));'
```
Where `<node.ydb.tech>` is the FQDN of the server running the dynamic node that supports the `/Root/testdb` database.
- The command above must be adjusted if TLS traffic protection or user authentication mode is enabled in the cluster. Example:
+## Validate the access to the embedded UI
- ```bash
- ydb -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --ca-file ydb-ca.crt --user root scripting yql \
- --script 'CREATE TABLE `testdir/test_table` (id Uint64, title Utf8, PRIMARY KEY (id));'
- ```
+To validate the access to {{ ydb-short-name }} embedded UI a Web browser should be used, opening the address `https://<node.ydb.tech>:8765`, where `<node.ydb.tech>` should be replaced with the FQDN of any static node server.
+
+Web browser should be configured to trust the CA used to generate the cluster node certificates, otherwise a warning will be shown that the certificate is not trusted.
+
+In case the authentication is enabled, the Web browser will display the login and password prompt. After entering the correct credentials, the initial {{ ydb-short-name }} embedded UI page will be shown. The available functions and user interface are described in the following document: [{#T}](../../maintenance/embedded_monitoring/index.md).
+
+{% note info %}
+
+Highly available HTTP load balancer, based on `haproxy`, `nginx` or similar software, is typically used to enable access to the {{ ydb-short-name }} embedded UI. The configuration details for HTTP load balancer are out of scope for the basic {{ ydb-short-name }} installation instruction.
+
+{% endnote %}
+
+
+# Installing {{ ydb-short-name }} in the unprotected mode
+
+{% note warning %}
+
+We DO NOT recommend to run {{ ydb-short-name }} in the unprotected mode for any purpose.
+
+{% endnote %}
+
+The installation procedure described above assumes that {{ ydb-short-name }} runs in its default protected mode.
+
+The unprotected {{ ydb-short-name }} mode is also available, and is intended for internal purposes, mainly for the development and testing of {{ ydb-short-name }} software. When running in the unprotected mode:
+* all traffic is passed in the clear text, including the intra-cluster communications and cluster-client communications;
+* user authentication is not used (enabling authentication without TLS traffic protection does not make much sense, as login and password are both passed unprotected through the network).
+
+Installing {{ ydb-short-name }} for the unprotected mode is performed according with the general procedure described above, with the exceptions listed below:
+
+1. TLS keys and certificates generation is skipped. No need to copy the key and certificate files to cluster servers.
+
+1. Subsection `security_config` of section `domains_config` is excluded from the configuration file. Sections `interconnect_config` and `grpc_config` are excluded, too.
+
+1. The syntax of commands to start static and dynamic nodes is reduced: the options referring to TLS key and certificate files are excluded, `grpc` protocol name is used instead of `grpcs` for connection points.
+
+1. The step to obtain the authentication token before cluster initialization and database creation is skipped.
+
+1. Cluster initialization is performed with the following command:
+
+ ```bash
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
+ echo $?
+ ```
+
+1. Database creation is performed with the following command:
+
+ ```bash
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd admin database /Root/testdb create ssd:1
+ ```
+
+1. `grpc` protocol is used instead of `grpcs` when configuring the connections to the database in {{ ydb-short-name }} CLI and applications. Authentication is not used.
diff --git a/ydb/docs/ru/core/_includes/storage-device-requirements.md b/ydb/docs/ru/core/_includes/storage-device-requirements.md
index b9dde90f2d..5bed5f0284 100644
--- a/ydb/docs/ru/core/_includes/storage-device-requirements.md
+++ b/ydb/docs/ru/core/_includes/storage-device-requirements.md
@@ -6,4 +6,6 @@
Конфигурации с дисками объемом меньше 800 ГБ или с любыми видами виртуализации системы хранения нельзя использовать для сервисов, находящихся в промышленной эксплуатации, а также для тестирования производительности системы.
+Мы не рекомендуем использовать для хранения данных {{ ydb-short-name }} диски, которые используются другими процессами (в том числе операционной системой).
+
{% endnote %}
diff --git a/ydb/docs/ru/core/cluster/system-requirements.md b/ydb/docs/ru/core/cluster/system-requirements.md
index c145463cd0..24abfb85e4 100644
--- a/ydb/docs/ru/core/cluster/system-requirements.md
+++ b/ydb/docs/ru/core/cluster/system-requirements.md
@@ -26,7 +26,7 @@
Работоспособность и производительность {{ ydb-short-name }} не тестировалась ни на каких видах виртуальных или сетевых устройств хранения.
- При планировании места стоит учитывать, что {{ ydb-short-name }} использует часть дискового пространства для своих внутренних нужд. Так, например, на среднего размера кластере из 8 нод можно ожидать потребления под статическую группу около 100 Гб на весь кластер. На большом кластере с >1500 нод — около 200 Гб. Так же есть логи размером 25.6 Гб на каждом Pdisk и системная область на каждом Pdisk. Её размер зависит от размера Pdisk, но не менее 0.2 Гб.
+ При планировании места стоит учитывать, что {{ ydb-short-name }} использует часть дискового пространства для своих внутренних нужд. Так, например, на среднего размера кластере из 8 узлов можно ожидать потребления под статическую группу около 100 Гб на весь кластер. На большом кластере с >1500 узлов — около 200 Гб. Также есть системные логи размером 25.6 Гб на каждом Pdisk и системная область на каждом Pdisk. Её размер зависит от размера Pdisk, но не менее 0.2 Гб.
## Программная конфигурация {#software}
diff --git a/ydb/docs/ru/core/cluster/topology.md b/ydb/docs/ru/core/cluster/topology.md
index 98d60a526b..ea10c20440 100644
--- a/ydb/docs/ru/core/cluster/topology.md
+++ b/ydb/docs/ru/core/cluster/topology.md
@@ -1,5 +1,10 @@
# Топология
+Кластер {{ ydb-short-name }} состоит из статических и динамических узлов:
+
+* статические узлы обеспечивают хранение данных, реализуя одну из поддерживаемых схем избыточности в зависимости от установленного режима работы;
+* динамические узлы обеспечивают выполнение запросов, координацию транзакций и другие функции управления данными.
+
Топология кластера определяется требованиями к отказоустойчивости. Доступны следующие режимы работы:
Режим | Множитель<br>объема хранения | Минимальное<br>количество<br>узлов | Описание
@@ -11,7 +16,7 @@
{% note info %}
-Под выходом из строя узла подразумевается как полная так и частичная его недоступность, например выход из строя одного диска на узле.
+Под выходом из строя узла подразумевается как полная, так и частичная его недоступность, например выход из строя одного диска на узле.
Приведенный выше множитель объема хранения относится только к фактору обеспечения отказоустойчивости. Для планирования размера хранилища необходимо учитывать другие влияющие факторы (например, фрагментацию и гранулярность слотов).
diff --git a/ydb/docs/ru/core/deploy/manual/_includes/prepare-configs.md b/ydb/docs/ru/core/deploy/manual/_includes/prepare-configs.md
index 3021eeb304..599bf37e83 100644
--- a/ydb/docs/ru/core/deploy/manual/_includes/prepare-configs.md
+++ b/ydb/docs/ru/core/deploy/manual/_includes/prepare-configs.md
@@ -42,6 +42,11 @@
rack: '1'
```
+1. В секции `blob_storage_config` скорректируйте FQDN всех нод, используемых для размещения статической группы хранения:
+
+ * для схемы `mirror-3-dc` необходимо указать FQDN для 9 нод;
+ * для схемы `block-4-2` необходимо указать FQDN для 8 нод.
+
1. Включите аутентификацию пользователей (опционально).
Если вы планируете использовать в кластере {{ ydb-short-name }} возможности аутентификации и разграничения доступа пользователей, добавьте в секцию `domains_config` следующие дополнительные параметры:
diff --git a/ydb/docs/ru/core/deploy/manual/deploy-ydb-on-premises.md b/ydb/docs/ru/core/deploy/manual/deploy-ydb-on-premises.md
index 679a6970e3..a6ab806af2 100644
--- a/ydb/docs/ru/core/deploy/manual/deploy-ydb-on-premises.md
+++ b/ydb/docs/ru/core/deploy/manual/deploy-ydb-on-premises.md
@@ -6,66 +6,72 @@
### Требования {#requirements}
-У вас должен быть ssh доступ на все сервера. Это необходимо для установки артефактов и запуска исполняемого файла {{ ydb-short-name }}. Сетевая конфигурация должна разрешать TCP соединения по следующим портам (по умолчанию):
+Ознакомьтесь с [системными требованиями](../../cluster/system-requirements.md) и [топологией кластера](../../cluster/topology.md).
-* 2135, 2136 - grpc для клиент-кластерного взаимодействия;
-* 19001, 19002 - Interconnect для внутрикластерного взаимодействия нод;
-* 8765, 8766 - http интерфейс для мониторинга кластера.
+У вас должен быть SSH доступ на все сервера. Это необходимо для установки артефактов и запуска исполняемого файла {{ ydb-short-name }}.
-Ознакомьтесь с [системными требованиями](../../cluster/system-requirements.md) и [топологией кластера](../../cluster/topology.md).
+Сетевая конфигурация должна разрешать TCP соединения по следующим портам (по умолчанию, могут быть изменены настройками):
-Выберите серверы и диски, которые будут использоваться для хранения данных:
+* 22: сервис SSH;
+* 2135, 2136 - GRPC для клиент-кластерного взаимодействия;
+* 19001, 19002 - Interconnect для внутрикластерного взаимодействия узлов;
+* 8765, 8766 - HTTP интерфейс {{ ydb-short-name }} Embedded UI.
-* Используйте схему отказоустойчивости `block-4-2` для развертывания кластера в одной зоне доступности (AZ). Чтобы переживать отказ 2 нод используйте не менее 8 нод.
-* Используйте схему отказоустойчивости `mirror-3-dc` для развертывания кластера в трех зонах доступности (AZ). Чтобы переживать отказ 1 AZ и 1 ноды в другом AZ используйте не менее 9 нод. Количество нод в каждой AZ должно быть одинаковым.
+Убедитесь в том, что системные часы на всех серверах в составе кластера синхронизированы с помощью инструментов `ntpd` или `chrony`. Желательно использовать единый источник времени для всех серверов кластера, чтобы обеспечить одинаковую обработку секунд координации (leap seconds).
-Запускайте каждую статическую ноду на отдельном сервере.
+Если применяемый на серверах кластера тип Linux использует `syslogd` для логирования, необходимо настроить ротацию файлов лога с использованием инструмента `logrotate` или его аналогов. Сервисы {{ ydb-short-name }} могут генерировать значительный объем системных логов, в особенности при повышении уровня логирования для диагностических целей, поэтому важно включить ротацию файлов системного лога для исключения ситуаций переполнения файловой системы `/var`.
-Подробнее требования к оборудованию описаны в разделе [{#T}](../../cluster/system-requirements.md).
+Выберите серверы и диски, которые будут использоваться для хранения данных:
-## Создайте системного пользователя и группу, от имени которого будет работать {{ ydb-short-name }} {#create-user}
+* Используйте схему отказоустойчивости `block-4-2` для развертывания кластера в одной зоне доступности (AZ). Чтобы переживать отказ 2 серверов, используйте не менее 8 серверов.
+* Используйте схему отказоустойчивости `mirror-3-dc` для развертывания кластера в трех зонах доступности (AZ). Чтобы переживать отказ 1 AZ и 1 сервера в другой AZ, используйте не менее 9 серверов. Количество задействованных серверов в каждой AZ должно быть одинаковым.
-На каждом сервере, где будет запущен {{ ydb-short-name }} выполните:
+{% note info %}
-```bash
-sudo groupadd ydb
-sudo useradd ydb -g ydb
-```
+Запускайте каждый статический узел (узел хранения данных) на отдельном сервере. Возможно совмещение статических и динамических узлов на одном сервере, а также размещение на одном сервере нескольких динамических узлов при наличии достаточных вычислительных ресурсов.
-Для того, чтобы сервис {{ ydb-short-name }} имел доступ к блочным дискам для работы, необходимо добавить пользователя, под которым будет запущен процесс, в группу `disk`:
+{% endnote %}
-```bash
-sudo usermod -aG disk ydb
-```
+Подробнее требования к оборудованию описаны в разделе [{#T}](../../cluster/system-requirements.md).
-## Подготовьте и отформатируйте диски на каждом сервере {#prepare-disks}
+### Подготовка ключей и сертификатов TLS {#tls-certificates}
-{% note warning %}
+Защита трафика и проверка подлинности серверных узлов {{ ydb-short-name }} осуществляется с использованием протокола TLS. Перед установкой кластера необходимо спланировать состав серверов, определиться со схемой именования узлов и конкретными именами, и подготовить ключи и сертификаты TLS.
-Мы не рекомендуем использовать для хранения данных диски, которые используются другими процессами (в том числе операционной системой).
+Вы можете использовать существующие или сгенерировать новые сертификаты. Следующие файлы ключей и сертификатов TLS должны быть подготовлены в формате PEM:
+* `ca.crt` - сертификат центра регистрации (Certification Authority, CA), которым подписаны остальные сертификаты TLS (одинаковые файлы на всех узлах кластера);
+* `node.key` - секретные ключи TLS для каждого из узлов кластера (свой ключ на каждый сервер кластера);
+* `node.crt` - сертификаты TLS для каждого из узлов кластера (соответствующий ключу сертификат);
+* `web.pem` - конкатенация секретного ключа узла, сертификата узла и сертификата центра регистрации для работы HTTP интерфейса мониторинга (свой файл на каждый сервер кластера).
-{% endnote %}
+Необходимые параметры формирования сертификатов определяются политикой организации. Обычно сертификаты и ключи для {{ ydb-short-name }} формируются со следующими параметрами:
+* ключи RSA длиною 2048 или 4096 бит;
+* алгоритм подписи сертификатов SHA-256 с шифрованием RSA;
+* срок действия сертификатов узлов не менее 1 года;
+* срок действия сертификата центра регистрации не менее 3 лет.
-{% include [_includes/storage-device-requirements.md](../../_includes/storage-device-requirements.md) %}
+Необходимо, чтобы сертификат центра регистрации был помечен соответствующим образом: должен быть установлен признак CA, а также включены виды использования "Digital Signature, Non Repudiation, Key Encipherment, Certificate Sign".
-1. Создайте раздел на выбранном диске:
+Для сертификатов узлов важно соответствие фактического имени хоста (или имён хостов) значениям, указанным в поле "Subject Alternative Name". Для сертификатов должны быть включены виды использования "Digital Signature, Key Encipherment" и расширенные виды использования "TLS Web Server Authentication, TLS Web Client Authentication". Необходимо, чтобы сертификаты узлов поддерживали как серверную, так и клиентскую аутентификацию (опция `extendedKeyUsage = serverAuth,clientAuth` в настройках OpenSSL).
- {% note alert %}
+Для пакетной генерации или обновления сертификатов кластера {{ ydb-short-name }} с помощью программного обеспечения OpenSSL можно воспользоваться [примером скрипта](https://github.com/ydb-platform/ydb/blob/main/ydb/deploy/tls_cert_gen/), размещённым в репозитории {{ ydb-short-name }} на Github. Скрипт позволяет автоматически сформировать необходимые файлы ключей и сертификатов для всего набора узлов кластера за одну операцию, облегчая подготовку к установке.
- Следующая операция удалит все разделы на указанных дисках! Убедитесь, что вы указали диски, на которых нет других данных!
+## Создайте системного пользователя и группу, от имени которых будет работать {{ ydb-short-name }} {#create-user}
- {% endnote %}
+На каждом сервере, где будет запущен {{ ydb-short-name }}, выполните:
- ```bash
- sudo parted /dev/nvme0n1 mklabel gpt -s
- sudo parted -a optimal /dev/nvme0n1 mkpart primary 0% 100%
- sudo parted /dev/nvme0n1 name 1 ydb_disk_ssd_01
- sudo partx --u /dev/nvme0n1
- ```
+```bash
+sudo groupadd ydb
+sudo useradd ydb -g ydb
+```
+
+Для того, чтобы сервис {{ ydb-short-name }} имел доступ к блочным дискам для работы, необходимо добавить пользователя, под которым будут запущены процессы {{ ydb-short-name }}, в группу `disk`:
- После выполнения в системе появится диск с лейблом `/dev/disk/by-partlabel/ydb_disk_ssd_01`.
+```bash
+sudo usermod -aG disk ydb
+```
- Если вы планируете использовать более одного диска на каждом сервере, укажите для каждого свой уникальный лейбл вместо `ydb_disk_ssd_01`. Эти диски необходимо будет использовать в конфигурационных файлах далее.
+## Установите программное обеспечение {{ ydb-short-name }} на каждом сервере {#install-binaries}
1. Скачайте и распакуйте архив с исполняемым файлом `ydbd` и необходимыми для работы {{ ydb-short-name }} библиотеками:
@@ -74,11 +80,10 @@ sudo usermod -aG disk ydb
curl -L https://binaries.ydb.tech/ydbd-stable-linux-amd64.tar.gz | tar -xz --strip-component=1 -C ydbd-stable-linux-amd64
```
-1. Создайте директории для запуска:
+1. Создайте директории для размещения программного обеспечения {{ ydb-short-name }}:
```bash
sudo mkdir -p /opt/ydb /opt/ydb/cfg
- sudo chown -R ydb:ydb /opt/ydb
```
1. Скопируйте исполняемый файл и библиотеки в соответствующие директории:
@@ -88,203 +93,104 @@ sudo usermod -aG disk ydb
sudo cp -iR ydbd-stable-linux-amd64/lib /opt/ydb/
```
-1. Отформатируйте диск встроенной командой:
+1. Установите владельца файлов и каталогов:
```bash
- sudo LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd admin bs disk obliterate /dev/disk/by-partlabel/ydb_disk_ssd_01
+ sudo chown -R root:bin /opt/ydb
```
- Проделайте данную операцию для каждого диска, который будет использоваться для хранения данных.
-
-## Подготовьте конфигурационные файлы {#config}
-
-{% list tabs %}
-
-- Незащищенный режим
-
- В незащищенном режиме трафик между нодами кластера, а также между клиентом и кластером использует нешифрованное соединение. Используйте данный режим для тестовых задач.
-
- {% include [prepare-configs.md](_includes/prepare-configs.md) %}
-
-- Защищенный режим
-
- В защищенном режиме трафик между нодами кластера, а также между клиентом и кластером шифруется протоколом TLS.
-
- {% note info %}
-
- Вы можете использовать существующие TLS сертификаты. Важно, чтобы сертификаты поддерживали как серверную, так и клиентскую аутентификацию (`extendedKeyUsage = serverAuth,clientAuth`)
-
- {% endnote %}
-
- 1. Создайте ключ и сертификат для центра сертификации (CA):
-
- 1. Создайте директории `secure`, в которой будет храниться ключ CA, и `certs` для сертификатов и ключей нод:
-
- ```bash
- mkdir secure
- mkdir certs
- ```
-
- 1. Создайте конфигурационный файл `ca.cnf` со следующим содержимым:
-
- ```text
- [ ca ]
- default_ca = CA_default
-
- [ CA_default ]
- default_days = 365
- database = index.txt
- serial = serial.txt
- default_md = sha256
- copy_extensions = copy
- unique_subject = no
-
- [ req ]
- prompt=no
- distinguished_name = distinguished_name
- x509_extensions = extensions
-
- [ distinguished_name ]
- organizationName = YDB
- commonName = YDB CA
-
- [ extensions ]
- keyUsage = critical,digitalSignature,nonRepudiation,keyEncipherment,keyCertSign
- basicConstraints = critical,CA:true,pathlen:1
-
- [ signing_policy ]
- organizationName = supplied
- commonName = optional
-
- [ signing_node_req ]
- keyUsage = critical,digitalSignature,keyEncipherment
- extendedKeyUsage = serverAuth,clientAuth
-
- # Used to sign client certificates.
- [ signing_client_req ]
- keyUsage = critical,digitalSignature,keyEncipherment
- extendedKeyUsage = clientAuth
- ```
-
- 1. Создайте CA ключ:
-
- ```bash
- openssl genrsa -out secure/ca.key 2048
- ```
-
- Сохраните этот ключ отдельно, он необходим для выписывания сертификатов. При его утере вам необходимо будет перевыпустить все сертификаты.
-
- 1. Создайте частный Certificate Authority (CA) сертификат:
-
- ```bash
- openssl req -new -x509 -config ca.cnf -key secure/ca.key -out certs/ca.crt -days 1830 -batch
- ```
-
- 1. Создайте текстовую базу данных и файл индекса сертификатов OpenSSL:
-
- ```bash
- touch index.txt
- echo 01 >serial.txt
- ```
-
- 1. Создайте ключи и сертификаты для нод кластера:
-
- 1. Создайте конфигурационный файл `node.cnf` со следующим содержимым:
-
- ```text
- # OpenSSL node configuration file
- [ req ]
- prompt = no
- distinguished_name = distinguished_name
- req_extensions = extensions
-
- [ distinguished_name ]
- organizationName = YDB
-
- [ extensions ]
- subjectAltName = DNS:<node>.<domain>
- ```
+## Подготовьте и отформатируйте диски на каждом сервере {#prepare-disks}
- 1. Создайте ключ сертификата:
+{% include [_includes/storage-device-requirements.md](../../_includes/storage-device-requirements.md) %}
- ```bash
- openssl genrsa -out certs/node.key 2048
- ```
+1. Создайте разделы на выбранных дисках:
- 1. Создайте Certificate Signing Request (CSR):
+ {% note alert %}
- ```bash
- openssl req -new -sha256 -config node.cnf -key certs/node.key -out node.csr -batch
- ```
+ Следующая операция удалит все разделы на указанном диске! Убедитесь, что вы указали диск, на котором нет других данных!
- 1. Создайте сертификат ноды:
+ {% endnote %}
- ```bash
- openssl ca -config ca.cnf -keyfile secure/ca.key -cert certs/ca.crt -policy signing_policy \
- -extensions signing_node_req -out certs/node.crt -outdir certs/ -in node.csr -batch
- ```
+ ```bash
+ DISK=/dev/nvme0n1
+ sudo parted ${DISK} mklabel gpt -s
+ sudo parted -a optimal ${DISK} mkpart primary 0% 100%
+ sudo parted ${DISK} name 1 ydb_disk_ssd_01
+ sudo partx --u ${DISK}
+ ```
- Создайте аналогичные пары сертификат-ключ для каждой ноды.
+ После выполнения в системе появится диск с меткой `/dev/disk/by-partlabel/ydb_disk_ssd_01`.
- 1. Создайте на каждой ноде директирии для сертификатов:
+ Если вы планируете использовать более одного диска на каждом сервере, укажите для каждого свою уникальную метку вместо `ydb_disk_ssd_01`. Метки дисков должны быть уникальны в рамках каждого сервера, и используются в конфигурационных файлах, как показано в последующих инструкциях.
- ```bash
- sudo mkdir /opt/ydb/certs
- sudo chown -R ydb:ydb /opt/ydb/certs
- sudo chmod 0750 /opt/ydb/certs
- ```
+ Для упрощения последующей настройки удобно использовать одинаковые метки дисков на серверах кластера, имеющих идентичную конфигурацию дисков.
- 1. Скопируйте сертификаты и ключи ноды в каталог инсталляции:
+2. Отформатируйте диск встроенной в исполняемый файл `ydbd` командой:
- ```bash
- sudo -u ydb cp certs/ca.crt certs/node.crt certs/node.key /opt/ydb/certs/
- ```
+ ```bash
+ sudo LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd admin bs disk obliterate /dev/disk/by-partlabel/ydb_disk_ssd_01
+ ```
- 1. {% include [prepare-configs.md](_includes/prepare-configs.md) %}
+ Проделайте данную операцию для каждого диска, который будет использоваться для хранения данных {{ ydb-short-name }}.
- 1. Включите режим шифрования трафика в конфигурационном файле {{ ydb-short-name }}.
+## Подготовьте конфигурационные файлы {#config}
- В секциях `interconnect_config` и `grpc_config` укажите путь до файлов сертификата, ключа и CA сертификата:
+{% include [prepare-configs.md](_includes/prepare-configs.md) %}
+
+При использовании режима шифрования трафика убедитесь в наличии в конфигурационном файле {{ ydb-short-name }} установленных путей к файлам ключей и сертификатов в секциях `interconnect_config` и `grpc_config`:
+
+```json
+interconnect_config:
+ start_tcp: true
+ encryption_mode: OPTIONAL
+ path_to_certificate_file: "/opt/ydb/certs/node.crt"
+ path_to_private_key_file: "/opt/ydb/certs/node.key"
+ path_to_ca_file: "/opt/ydb/certs/ca.crt"
+grpc_config:
+ cert: "/opt/ydb/certs/node.crt"
+ key: "/opt/ydb/certs/node.key"
+ ca: "/opt/ydb/certs/ca.crt"
+ services_enabled:
+ - legacy
+```
- ```json
- interconnect_config:
- start_tcp: true
- encryption_mode: OPTIONAL
- path_to_certificate_file: "/opt/ydb/certs/node.crt"
- path_to_private_key_file: "/opt/ydb/certs/node.key"
- path_to_ca_file: "/opt/ydb/certs/ca.crt"
+Сохраните конфигурационный файл {{ ydb-short-name }} под именем `/opt/ydb/cfg/config.yaml` на каждом сервере кластера.
- grpc_config:
- cert: "/opt/ydb/certs/node.crt"
- key: "/opt/ydb/certs/node.key"
- ca: "/opt/ydb/certs/ca.crt"
- ```
+Более подробная информация по созданию файла конфигурации приведена в статье [Конфигурация кластера](../configuration/config.md).
-{% endlist %}
+## Скопируйте ключи и сертификаты TLS на каждый сервер {#tls-copy-cert}
-Сохраните конфигурационный файл {{ ydb-short-name }} под именем `/opt/ydb/cfg/config.yaml` на каждом узле кластера.
+Подготовленные ключи и сертификаты TLS необходимо скопировать в защищенный каталог на каждом из узлов кластера {{ ydb-short-name }}. Ниже приведен пример команд для создания защищенного каталога и копирования файлов с ключами и сертификатами.
-Более подробная информация по созданию конфигурации приведена в статье [Конфигурация кластера](../configuration/config.md).
+```bash
+sudo mkdir -p /opt/ydb/certs
+sudo cp -v ca.crt /opt/ydb/certs/
+sudo cp -v node.crt /opt/ydb/certs/
+sudo cp -v node.key /opt/ydb/certs/
+sudo cp -v web.pem /opt/ydb/certs/
+sudo chown -R ydb:ydb /opt/ydb/certs
+sudo chmod 700 /opt/ydb/certs
+```
-## Запустите статические ноды {#start-storage}
+## Запустите статические узлы {#start-storage}
{% list tabs %}
- Вручную
- Запустите на каждой ноде {{ ydb-short-name }} storage:
+ Запустите сервис хранения данных {{ ydb-short-name }} на каждом статическом узле кластера:
```bash
sudo su - ydb
cd /opt/ydb
export LD_LIBRARY_PATH=/opt/ydb/lib
- /opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp --yaml-config /opt/ydb/cfg/config.yaml \
- --grpc-port 2135 --ic-port 19001 --mon-port 8765 --node static
+ /opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp --yaml-config /opt/ydb/cfg/config.yaml \
+ --grpcs-port 2135 --ic-port 19001 --mon-port 8765 --mon-cert /opt/ydb/certs/web.pem --node static
```
- С использованием systemd
- Создайте на каждой ноде конфигурационный файл `/etc/systemd/system/ydbd-storage.service` со следующим содержимым:
+ Создайте на каждом сервере, где будет размещен статический узел кластера, конфигурационный файл systemd `/etc/systemd/system/ydbd-storage.service` по приведенному ниже образцу. Образец файла также можно [скачать из репозитория](https://github.com/ydb-platform/ydb/blob/main/ydb/deploy/systemd_services/ydbd-storage.service).
```text
[Unit]
@@ -305,7 +211,10 @@ sudo usermod -aG disk ydb
SyslogFacility=daemon
SyslogLevel=err
Environment=LD_LIBRARY_PATH=/opt/ydb/lib
- ExecStart=/opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp --yaml-config /opt/ydb/cfg/config.yaml --grpc-port 2135 --ic-port 19001 --mon-port 8765 --node static
+ ExecStart=/opt/ydb/bin/ydbd server --log-level 3 --syslog --tcp \
+ --yaml-config /opt/ydb/cfg/config.yaml \
+ --grpcs-port 2135 --ic-port 19001 --mon-port 8765 \
+ --mon-cert /opt/ydb/certs/web.pem --node static
LimitNOFILE=65536
LimitCORE=0
LimitMEMLOCK=3221225472
@@ -314,7 +223,7 @@ sudo usermod -aG disk ydb
WantedBy=multi-user.target
```
- Запустите на каждой ноде {{ ydb-short-name }} storage:
+ Запустите сервис на каждом статическом узле {{ ydb-short-name }}:
```bash
sudo systemctl start ydbd-storage
@@ -324,21 +233,13 @@ sudo usermod -aG disk ydb
## Инициализируйте кластер {#initialize-cluster}
-Действия по инициализации кластера зависят от того, включен ли в конфигурационном файле {{ ydb-short-name }} режим аутентификации пользователей.
-
-{% list tabs %}
-
-- Аутентификация выключена
+Операция инициализации кластера осуществляет настройку набора статических узлов, перечисленных в конфигурационном файле кластера, для хранения данных {{ ydb-short-name }}.
- На одной из нод кластера выполните команды:
+Для инициализации кластера потребуется файл сертификата центра регистрации `ca.crt`, путь к которому должен быть указан при выполнении соответствующих команд. Перед выполнением соответствующих команд скопируйте файл `ca.crt` на сервер, на котором эти команды будут выполняться.
- ```bash
- export LD_LIBRARY_PATH=/opt/ydb/lib
- /opt/ydb/bin/ydbd admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
- echo $?
- ```
+Порядок действий по инициализации кластера зависят от того, включен ли в конфигурационном файле {{ ydb-short-name }} режим аутентификации пользователей.
- Код завершения команды должен быть нулевым.
+{% list tabs %}
- Аутентификация включена
@@ -347,75 +248,107 @@ sudo usermod -aG disk ydb
При первоначальной установке кластера в нём существует единственная учётная запись `root` с пустым паролем, поэтому команда получения токена выглядит следующим образом:
```bash
- ydb -e grpc://<node1.ydb.tech>:2135 -d /Root \
- --user root --no-password auth get-token --force >token-file
+ ydb -e grpcs://<node1.ydb.tech>:2135 -d /Root --ca-file ca.crt \
+ --user root --no-password auth get-token --force >token-file
```
- В качестве сервера для подключения (параметр `-e` или `--endpoint`) может быть указан любой из серверов кластера.
+ В качестве сервера для подключения (параметр `-e` или `--endpoint`) может быть указан любой из серверов хранения в составе кластера.
- Если была включена защита трафика с использованием TLS, то вместо протокола `grpc` в команде выше следует использовать его защищенный вариант `grpcs`, и дополнительно указать путь к файлу с сертификатом CA в параметре `--ca-file`. Например:
+ При успешном выполнении указанной выше команды аутентификационный токен будет записан в файл `token-file`. Файл токена необходимо скопировать на один из серверов хранения в составе кластера, а затем на выбранном сервере выполнить команды:
```bash
- ydb -e grpcs://<node1.ydb.tech>:2135 -d /Root --ca-file /opt/ydb/certs/ca.crt \
- --user root --no-password auth get-token --force >token-file
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd -f token-file --ca-file ca.crt -s grpcs://`hostname -f`:2135 \
+ admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
+ echo $?
```
- При успешном выполнении указанной выше команды аутентификационный токен будет записан в файл `token-file`. Этот файл необходимо будет скопировать на ноду кластера, на которой в дальнейшем вы собираетесь выполнять команды инициализации кластера и создания базы данных. Далее на этой ноде кластера выполните команды:
+- Аутентификация выключена
+
+ На одном из серверов хранения в составе кластера выполните команды:
```bash
export LD_LIBRARY_PATH=/opt/ydb/lib
- /opt/ydb/bin/ydbd -f token-file admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
+ /opt/ydb/bin/ydbd --ca-file ca.crt -s grpcs://`hostname -f`:2135 \
+ admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
echo $?
```
- Код завершения команды должен быть нулевым.
-
{% endlist %}
+При успешном выполнении инициализации кластера выведенный на экран код завершения команды инициализации кластера должен быть нулевым.
+
## Создайте базу данных {#create-db}
-Для работы с таблицами необходимо создать как минимум одну базу данных и поднять процесс, обслуживающий эту базу данных (динамическую ноду):
+Для работы с таблицами необходимо создать как минимум одну базу данных и запустить процесс или процессы, обслуживающие эту базу данных (динамические узлы).
-```bash
-LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd admin database /Root/testdb create ssd:1
-```
+Для выполнения административной команды создания базы данных потребуется файл сертификата центра регистрации `ca.crt`, аналогично описанному выше порядку выполнения действий по инициализации кластера.
-Если в кластере включен режим аутентификации пользователей, то в команду создания базы данных необходимо передать аутентификационный токен. Процедура получения токена описана в разделе по [инициализации кластера](#initialize-cluster).
+При создании базы данных устанавливается первоначальное количество используемых групп хранения, определяющее доступную пропускную способность ввода-вывода и максимальную емкость хранения. Количество групп хранения может быть при необходимости увеличено после создания базы данных.
-Вариант команды создания базы данных с указанием файла токена:
+Порядок действий по созданию базы данных зависит от того, включен ли в конфигурационном файле {{ ydb-short-name }} режим аутентификации пользователей.
-```bash
-LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd -f token-file admin database /Root/testdb create ssd:1
-```
+{% list tabs %}
+
+- Аутентификация включена
+
+ Необходимо получить аутентификационный токен. Может использоваться файл с токеном аутентификации, полученный при выполнении [инициализации кластера](#initialize-cluster), либо подготовлен новый токен.
+
+ Файл токена необходимо скопировать на один из серверов хранения в составе кластера, а затем на выбранном сервере выполнить команды:
+
+ ```bash
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd -f token-file --ca-file ca.crt -s grpcs://`hostname -s`:2135 \
+ admin database /Root/testdb create ssd:1
+ echo $?
+ ```
+
+- Аутентификация выключена
-В приведенных выше примерах команд используются следующие параметры:
+ На одном из серверов хранения в составе кластера выполните команды:
+
+ ```bash
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd --ca-file ca.crt -s grpcs://`hostname -s`:2135 \
+ admin database /Root/testdb create ssd:1
+ echo $?
+ ```
+
+{% endlist %}
+
+При успешном создании базы данных, выведенный на экран код завершения команды должен быть нулевым.
+
+В приведенном выше примере команд используются следующие параметры:
* `/Root` - имя корневого домена, должно соответствовать настройке `domains_config`.`domain`.`name` в файле конфигурации кластера;
* `testdb` - имя создаваемой базы данных;
-* `ssd:1` - имя пула хранения и номер блока в пуле. Имя пула обычно означает тип устройств хранения данных и должно соответствовать настройке `storage_pool_types`.`kind` внутри элемента `domains_config`.`domain` файла конфигурации.
+* `ssd:1` - имя пула хранения и количество выделяемых групп хранения. Имя пула обычно означает тип устройств хранения данных и должно соответствовать настройке `storage_pool_types`.`kind` внутри элемента `domains_config`.`domain` файла конфигурации.
-## Запустите динамическую ноду базы данных {#start-dynnode}
+## Запустите динамические узлы {#start-dynnode}
{% list tabs %}
- Вручную
- Запустите динамическую ноду {{ ydb-short-name }} для базы /Root/testdb:
+ Запустите динамический узел {{ ydb-short-name }} для базы `/Root/testdb`:
```bash
sudo su - ydb
cd /opt/ydb
export LD_LIBRARY_PATH=/opt/ydb/lib
- /opt/ydb/bin/ydbd server --grpc-port 2136 --ic-port 19002 --mon-port 8766 --yaml-config /opt/ydb/cfg/config.yaml \
- --tenant /Root/testdb --node-broker <node1.ydb.tech>:2135 --node-broker <node2.ydb.tech>:2135 --node-broker <node3.ydb.tech>:2135
+ /opt/ydb/bin/ydbd server --grpcs-port 2136 --grpc-ca /opt/ydb/certs/ca.crt \
+ --ic-port 19002 --ca /opt/ydb/certs/ca.crt \
+ --mon-port 8766 --mon-cert /opt/ydb/certs/web.pem \
+ --yaml-config /opt/ydb/cfg/config.yaml --tenant /Root/testdb \
+ --node-broker grpcs://<ydb1>:2135 \
+ --node-broker grpcs://<ydb2>:2135 \
+ --node-broker grpcs://<ydb3>:2135
```
- Где `<nodeN.ydb.tech>` - FQDN серверов, на которых запущены статические ноды.
-
- Запустите дополнительные динноды на других серверах для обеспечения доступности базы данных.
+ В примере команды выше `<ydbN>` - FQDN трех любых серверов, на которых запущены статические узлы кластера.
- С использованием systemd
- 1. Создайте конфигурационный файл `/etc/systemd/system/ydbd-testdb.service` со следующим содержимым:
+ Создайте конфигурационный файл systemd `/etc/systemd/system/ydbd-testdb.service` по приведенному ниже образцу. Образец файла также можно [скачать из репозитория](https://github.com/ydb-platform/ydb/blob/main/ydb/deploy/systemd_services/ydbd-testdb.service).
```text
[Unit]
@@ -436,7 +369,14 @@ LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd -f token-file admin database /Roo
SyslogFacility=daemon
SyslogLevel=err
Environment=LD_LIBRARY_PATH=/opt/ydb/lib
- ExecStart=/opt/ydb/bin/ydbd server --grpc-port 2136 --ic-port 19002 --mon-port 8766 --yaml-config /opt/ydb/cfg/config.yaml --tenant /Root/testdb --node-broker <node1.ydb.tech>:2135 --node-broker <node2.ydb.tech>:2135 --node-broker <node3.ydb.tech>:2135
+ ExecStart=/opt/ydb/bin/ydbd server \
+ --grpcs-port 2136 --grpc-ca /opt/ydb/certs/ca.crt \
+ --ic-port 19002 --ca /opt/ydb/certs/ca.crt \
+ --mon-port 8766 --mon-cert /opt/ydb/certs/web.pem \
+ --yaml-config /opt/ydb/cfg/config.yaml --tenant /Root/testdb \
+ --node-broker grpcs://<ydb1>:2135 \
+ --node-broker grpcs://<ydb2>:2135 \
+ --node-broker grpcs://<ydb3>:2135
LimitNOFILE=65536
LimitCORE=0
LimitMEMLOCK=32212254720
@@ -445,18 +385,18 @@ LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd -f token-file admin database /Roo
WantedBy=multi-user.target
```
- Где `<nodeN.ydb.tech>` - FQDN серверов, на которых запущены статические ноды.
+ В примере файла выше `<ydbN>` - FQDN трех любых серверов, на которых запущены статические узлы кластера.
- 1. Запустите динамическую ноду {{ ydb-short-name }} для базы /Root/testdb:
+ Запустите динамический узел {{ ydb-short-name }} для базы `/Root/testdb`:
```bash
sudo systemctl start ydbd-testdb
```
- 1. Запустите дополнительные динноды на других серверах для обеспечения доступности базы данных.
-
{% endlist %}
+Запустите дополнительные динамические узлы на других серверах для масштабирования и обеспечения отказоустойчивости базы данных.
+
## Первоначальная настройка учетных записей {#security-setup}
Если в файле настроек кластера включен режим аутентификации, то перед началом работы с кластером {{ ydb-short-name }} необходимо выполнить первоначальную настройку учетных записей.
@@ -470,7 +410,7 @@ LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd -f token-file admin database /Roo
1. Выполните установку пароля учетной записи `root`:
```bash
- ydb -e grpc://<node.ydb.tech>:2136 -d /Root/testdb --user root --no-password \
+ ydb --ca-file ca.crt -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --user root --no-password \
yql -s 'ALTER USER root PASSWORD "passw0rd"'
```
@@ -479,23 +419,21 @@ LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd -f token-file admin database /Roo
1. Создайте дополнительные учетные записи:
```bash
- ydb -e grpc://<node.ydb.tech>:2136 -d /Root/testdb --user root \
+ ydb --ca-file ca.crt -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --user root \
yql -s 'CREATE USER user1 PASSWORD "passw0rd"'
```
1. Установите права учетных записей, включив их во встроенные группы:
```bash
- ydb -e grpc://<node.ydb.tech>:2136 -d /Root/testdb --user root \
+ ydb --ca-file ca.crt -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --user root \
yql -s 'ALTER GROUP `ADMINS` ADD USER user1'
```
-В перечисленных выше примерах команд `<node.ydb.tech>` - FQDN сервера, на котором запущена динамическая нода, обслуживающая базу `/Root/testdb`.
+В перечисленных выше примерах команд `<node.ydb.tech>` - FQDN сервера, на котором запущен любой динамический узел, обслуживающий базу `/Root/testdb`.
При выполнении команд создания учетных записей и присвоения групп клиент {{ ydb-short-name }} CLI будет запрашивать ввод пароля пользователя `root`. Избежать многократного ввода пароля можно, создав профиль подключения, как описано в [документации {{ ydb-short-name }} CLI](../../reference/ydb-cli/profile/index.md).
-Если в кластере была включена защита трафика с использованием TLS, то вместо протокола `grpc` в команде выше следует использовать его защищенный вариант `grpcs`, и дополнительно указать путь к файлу с сертификатом CA в параметре `--ca-file` (либо сохранить в профиле подключения).
-
## Протестируйте работу с созданной базой {#try-first-db}
1. Установите {{ ydb-short-name }} CLI, как описано в [документации](../../reference/ydb-cli/install.md).
@@ -503,15 +441,64 @@ LD_LIBRARY_PATH=/opt/ydb/lib /opt/ydb/bin/ydbd -f token-file admin database /Roo
1. Создайте тестовую таблицу `test_table`:
```bash
- ydb -e grpc://<node.ydb.tech>:2136 -d /Root/testdb scripting yql \
- --script 'CREATE TABLE `testdir/test_table` (id Uint64, title Utf8, PRIMARY KEY (id));'
+ ydb --ca-file ca.crt -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --user root \
+ yql -s 'CREATE TABLE `testdir/test_table` (id Uint64, title Utf8, PRIMARY KEY (id));'
```
- Где `<node.ydb.tech>` - FQDN сервера, на котором запущена динамическая нода, обслуживающая базу `/Root/testdb`.
+ Где `<node.ydb.tech>` - FQDN сервера, на котором запущен динамический узел, обслуживающий базу `/Root/testdb`.
- Указанную выше команду необходимо будет скорректировать, если в кластере включена защита трафика с использованием TLS или активирован режим аутентификации пользователей. Пример:
+## Проверка доступа ко встроенному web-интерфейсу
- ```bash
- ydb -e grpcs://<node.ydb.tech>:2136 -d /Root/testdb --ca-file ydb-ca.crt --user root scripting yql \
- --script 'CREATE TABLE `testdir/test_table` (id Uint64, title Utf8, PRIMARY KEY (id));'
- ```
+Для проверки доступа ко встроенному web-интерфейсу {{ ydb-short-name }} достаточно открыть в Web-браузере страницу с адресом `https://<node.ydb.tech>:8765`, где `<node.ydb.tech>` - FQDN сервера, на котором запущен любой статический узел {{ ydb-short-name }}.
+
+В Web-браузере должно быть настроено доверие в отношении центра регистрации, выпустившего сертификаты для кластера {{ ydb-short-name }}, в противном случае будет отображено предупреждение об использовании недоверенного сертификата.
+
+Если в кластере включена аутентификация, в Web-браузере должен отобразиться запрос логина и пароля. После ввода верных данных аутентификации должна отобразиться начальная страница встроенного web-интерфейса. Описание доступных функций и пользовательского интерфейса приведено в разделе [{#T}](../../maintenance/embedded_monitoring/index.md).
+
+{% note info %}
+
+Обычно для обеспечения доступа ко встроенному web-интерфейсу {{ ydb-short-name }} настраивают отказоустойчивый HTTP-балансировщик на базе программного обеспечения `haproxy`, `nginx` или аналогов. Детали настройки HTTP-балансировщика выходят за рамки стандартной инструкции по установке {{ ydb-short-name }}.
+
+{% endnote %}
+
+
+# Особенности установки {{ ydb-short-name }} в незащищенном режиме
+
+{% note warning %}
+
+Мы не рекомендуем использовать незащищенный режим работы {{ ydb-short-name }} ни при эксплуатации, ни при разработке приложений.
+
+{% endnote %}
+
+Описанная выше процедура установки предусматривает развёртывание {{ ydb-short-name }} в стандартном защищенном режиме.
+
+Незащищённый режим работы {{ ydb-short-name }} предназначен для решения тестовых задач, преимущественно связанных с разработкой и тестированием программного обеспечения {{ ydb-short-name }}. В незащищенном режиме:
+* трафик между узлами кластера, а также между приложениями и кластером использует незашифрованные соединения;
+* не используется аутентификация пользователей (включение аутентификации при отсутстви шифрования трафика не имеет смысла, поскольку логин и пароль в такой конфигурации передавались бы через сеть в открытом виде).
+
+Установка {{ ydb-short-name }} для работы в незащищенном режиме производится в порядке, описанном выше, со следующими исключениями:
+
+1. При подготовке к установке не требуется формировать сертификаты и ключи TLS, и не выполняется копирование сертификатов и ключей на узлы кластера.
+
+1. Из конфигурационных файлов кластерных узлов исключается подсекция `security_config` в секции `domains_config`, а также целиком исключаются секции `interconnect_config` и `grpc_config`.
+
+1. Используются упрощенный вариант команд запуска статических и динамических узлов кластера: исключаются опции с именами файлов сертификатов и ключей, используется протокол `grpc` вместо `grpcs` при указании точек подключения.
+
+1. Пропускается ненужный в незащищенном режиме шаг по получению токена аутентификации перед выполнением инициализации кластера и созданием базы данных.
+
+1. Команда инициализации кластера выполняется в следующей форме:
+
+ ```bash
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd admin blobstorage config init --yaml-file /opt/ydb/cfg/config.yaml
+ echo $?
+ ```
+
+1. Команда создания базы данных выполняется в следующей форме:
+
+ ```bash
+ export LD_LIBRARY_PATH=/opt/ydb/lib
+ /opt/ydb/bin/ydbd admin database /Root/testdb create ssd:1
+ ```
+
+1. При обращении к базе данных из {{ ydb-short-name }} CLI и приложений используется протокол grpc вместо grpcs, и не используется аутентификация.