aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Petrukhin <shmel1k@ydb.tech>2024-12-24 01:24:04 +0300
committerGitHub <noreply@github.com>2024-12-23 22:24:04 +0000
commita3bc91c3e0c58350a6f731d4a2a76d2001be2a71 (patch)
tree70c9f3b97f83c894820deaecf02c06db520514f6
parent1f4383057cc7d141096b8bd4480f2b9d72fc71ca (diff)
downloadydb-a3bc91c3e0c58350a6f731d4a2a76d2001be2a71.tar.gz
[ydbd_slice] improve configuration template, add some helps and so on. (#12899)
-rw-r--r--ydb/tools/ydbd_slice/__init__.py57
-rw-r--r--ydb/tools/ydbd_slice/baremetal/templates/block-4-2-8-nodes.yaml53
2 files changed, 64 insertions, 46 deletions
diff --git a/ydb/tools/ydbd_slice/__init__.py b/ydb/tools/ydbd_slice/__init__.py
index 75a385661d9..24828624866 100644
--- a/ydb/tools/ydbd_slice/__init__.py
+++ b/ydb/tools/ydbd_slice/__init__.py
@@ -24,7 +24,7 @@ logger = logging.getLogger(__name__)
HELP = '''
-\033[92mKiKiMR Developer's Slice Deployment Tool\x1b[0m
+\033[92mYDBD Developer's Slice Deployment Tool\x1b[0m
See examples of cluster.yaml here
https://cs.yandex-team.ru/#!,kikimr%%2F.*%%2Fcluster.yaml,,arcadia
@@ -37,6 +37,9 @@ Guide for ad-hoc Kubernetes operations could be found here
\033[96mCommands for Traditional Developer's Slices\x1b[0m
+\033[95msample-config\033[94m - get sample configuration for cluster:
+ %(prog)s sample-config --cluster-type=block-4-2-8-nodes --output-file=cluster.yaml
+
\033[95minstall\033[94m - full install process from scratch:
%(prog)s install cluster.yaml --arcadia
@@ -382,20 +385,20 @@ def arcadia_root(begin_path='.'):
def deduce_kikimr_bin_from_args(args):
- if args.kikimr is not None:
- path = os.path.abspath(args.kikimr)
+ if args.binary is not None:
+ path = os.path.abspath(args.binary)
elif args.arcadia:
root = arcadia_root()
path = ya_build(root, YDBD_EXECUTABLE, args.build_args, args.dry_run)
else:
- sys.exit("unable to deduce kikimr bin")
+ sys.exit("unable to deduce ydbd bin")
if 'LD_LIBRARY_PATH' not in os.environ:
os.environ['LD_LIBRARY_PATH'] = os.path.dirname(path)
- compressed_path = args.kikimr_lz4
+ compressed_path = args.binary_lz4
- logger.info("use kikimr bin '%s'", path)
+ logger.info("use ydbd bin '%s'", path)
return path, compressed_path
@@ -445,7 +448,7 @@ def log_args():
"--clear_logs",
dest='clear_logs',
action='store_true',
- help="stop rsyslogd and erase all kikimr logs"
+ help="stop rsyslogd and erase all ydbd logs"
)
return args
@@ -453,15 +456,15 @@ def log_args():
def binaries_args():
args = argparse.ArgumentParser(add_help=False)
args.add_argument(
- "--kikimr",
+ "--binary",
metavar="BIN",
default=None,
- help="explicit path to kikimr"
+ help="explicit path to ydbd"
)
args.add_argument(
- "--kikimr-lz4",
+ "--binary-lz4",
metavar="PATH",
- help="explicit path to compressed kikimr binary file used for transfer acceleration"
+ help="explicit path to compressed ydbd binary file used for transfer acceleration"
)
args.add_argument(
"--arcadia",
@@ -489,6 +492,7 @@ def component_args():
"multiple choice from: 'all', 'kikimr[={bin|cfg}]', "
"'dynamic_slots'"
"'all' is default",
+ # TODO(shmel1k@): change me
)
return args
@@ -520,12 +524,18 @@ def databases_config_path_args():
def cluster_type_args():
args = argparse.ArgumentParser(add_help=False)
+ available_erasure_types = [
+ "block-4-2-8-nodes",
+ "mirror-3-dc-3-nodes-in-memory",
+ "mirror-3-dc-3-nodes",
+ "mirror-3-dc-9-nodes",
+ ]
args.add_argument(
"--cluster-type",
metavar="CLUSTER_TYPE",
required=True,
- help="Erasure type for slice",
- choices=["block-4-2-8-nodes", "mirror-3-dc-3-nodes-in-memory", "mirror-3-dc-3-nodes", "mirror-3-dc-9-nodes"],
+ help="Erasure type for slice.\nAvailable types: " + ", ".join(available_erasure_types),
+ choices=available_erasure_types,
)
return args
@@ -652,10 +662,17 @@ def add_update_mode(modes, walle_provider):
mode = modes.add_parser(
"update",
conflict_handler='resolve',
- parents=[direct_nodes_args(), cluster_description_args(), binaries_args(), component_args(), log_args(), ssh_args()],
+ parents=[
+ direct_nodes_args(),
+ cluster_description_args(),
+ binaries_args(),
+ component_args(),
+ log_args(),
+ ssh_args(),
+ ],
description="Minor cluster update, just binary and cfg. No additional configuration is performed."
- "Stop all kikimr instances at the nodes, sync binary and cfg, start the instances. "
- "Use --hosts to specify particular hosts."
+ "Stop all ydbd instances at the nodes, sync binary and cfg, start the instances. "
+ "Use --hosts to specify particular hosts.",
)
mode.set_defaults(handler=_run)
@@ -687,7 +704,7 @@ def add_stop_mode(modes, walle_provider):
mode = modes.add_parser(
"stop",
parents=[direct_nodes_args(), cluster_description_args(), binaries_args(), component_args(), ssh_args()],
- description="Stop kikimr static instaneces at the nodes. "
+ description="Stop ydbd static instances at the nodes. "
"If option components specified, try to stop particular component. "
"Use --hosts to specify particular hosts."
)
@@ -701,7 +718,7 @@ def add_start_mode(modes, walle_provider):
mode = modes.add_parser(
"start",
parents=[direct_nodes_args(), cluster_description_args(), binaries_args(), component_args(), ssh_args()],
- description="Start all kikimr instances at the nodes. "
+ description="Start all ydbd instances at the nodes. "
"If option components specified, try to start particular component. "
"Otherwise only kikimr-multi-all will be started. "
"Use --hosts to specify particular hosts."
@@ -716,7 +733,7 @@ def add_clear_mode(modes, walle_provider):
mode = modes.add_parser(
"clear",
parents=[direct_nodes_args(), cluster_description_args(), binaries_args(), component_args(), ssh_args()],
- description="Stop all kikimr instances at the nodes, format all kikimr drivers, shutdown dynamic slots. "
+ description="Stop all ydbd instances at the nodes, format all ydbd drives, shutdown dynamic slots. "
"And don't start nodes after it. "
"Use --hosts to specify particular hosts."
)
@@ -730,7 +747,7 @@ def add_format_mode(modes, walle_provider):
mode = modes.add_parser(
"format",
parents=[direct_nodes_args(), cluster_description_args(), binaries_args(), component_args(), ssh_args()],
- description="Stop all kikimr instances at the nodes, format all kikimr drivers at the nodes, start the instances. "
+ description="Stop all ydbd instances at the nodes, format all ydbd drives at the nodes, start the instances. "
"If you call format for all cluster, you will spoil it. "
"Additional dynamic configuration will required after it. "
"If you call format for few nodes, cluster will regenerate after it. "
diff --git a/ydb/tools/ydbd_slice/baremetal/templates/block-4-2-8-nodes.yaml b/ydb/tools/ydbd_slice/baremetal/templates/block-4-2-8-nodes.yaml
index 6487d9fadb5..86b64ddd893 100644
--- a/ydb/tools/ydbd_slice/baremetal/templates/block-4-2-8-nodes.yaml
+++ b/ydb/tools/ydbd_slice/baremetal/templates/block-4-2-8-nodes.yaml
@@ -11,15 +11,15 @@ use_new_style_kikimr_cfg: true
host_configs: # the list of available host configurations in the cluster.
- drive:
- path: /dev/disk/by-partlabel/kikimr_nvme_01 # path of the first disk in the host configration.
- type: SSD # kind of the disk: available kinds are SSD, NVME or HDD
+ type: SSD # kind of the disk: available kinds are SSD, NVME or HDD
- path: /dev/disk/by-partlabel/kikimr_nvme_02
type: SSD
# Add more disks if required.
host_config_id: 1 # the unique id of the host config
hosts:
-- host: ydb-node-zone-a-1.local # storage node DNS name, change if required.
+- host: &host_1 CHANGE_ME_HOST_1 # storage node DNS name, change if required.
host_config_id: 1 # numeric host configuration template identifier.
- walle_location: # this parameter describes where host is located.
+ location: # this parameter describes where host is located.
body: 1 # string representing a host serial number.
data_center: 'DCA' # string representing the datacenter / availability zone where the host is located.
# if cluster is deployed using mirror-3-dc fault tolerance mode, all hosts must be distributed
@@ -34,45 +34,45 @@ hosts:
# they will be located at `kikimr_ssd_01-04`
# If your host has label like '_2hdd', that means, that
# they will be located at `/dev/disk/by-partlabel/kikimr_hdd_03-04` (enumeration starts with 03)
-- host: ydb-node-zone-a-2.local
+- host: &host_2 CHANGE_ME_HOST_2
host_config_id: 1
location:
body: 2
data_center: 'DCA'
rack: '2'
-- host: ydb-node-zone-a-3.local
+- host: &host_3 CHANGE_ME_HOST_3
host_config_id: 1
location:
body: 3
data_center: 'DCA'
rack: '3'
-- host: ydb-node-zone-a-4.local
+- host: &host_4 CHANGE_ME_HOST_4
host_config_id: 1
location:
body: 4
data_center: 'DCA'
rack: '4'
-- host: ydb-node-zone-a-5.local
+- host: &host_5 CHANGE_ME_HOST_5
host_config_id: 1
location:
body: 5
data_center: 'DCA'
rack: '5'
-- host: ydb-node-zone-a-6.local
+- host: &host_6 CHANGE_ME_HOST_6
host_config_id: 1
location:
body: 6
data_center: 'DCA'
rack: '6'
-- host: ydb-node-zone-a-7.local
+- host: &host_7 CHANGE_ME_HOST_7
host_config_id: 1
location:
body: 7
data_center: 'DCA'
rack: '7'
-- host: ydb-node-zone-a-8.local
+- host: &host_8 CHANGE_ME_HOST_8
host_config_id: 1
location:
body: 8
@@ -153,43 +153,44 @@ blob_storage_config: # configuration of static blobstorage group.
rings: # in block-4-2 must have exactly 1 ring or availability zone.
- fail_domains:
- vdisk_locations: # fail domains of the static group describe where each vdisk of the static group should be located.
- - node_id: "ydb-node-zone-a-1.local"
- pdisk_category: SSD
+ - node_id: *host_1
+ pdisk_category: &pdisk_category CHANGE_PDISK_CATEGORY # Set this option to 1, if cluster has SSD/NVME disks
+ # or to 0, if cluster has HDD.
path: /dev/disk/by-partlabel/kikimr_nvme_01
pdisk_guid: 1
- vdisk_locations:
- - node_id: "ydb-node-zone-a-2.local"
- pdisk_category: SSD
+ - node_id: *host_2
+ pdisk_category: *pdisk_category
path: /dev/disk/by-partlabel/kikimr_nvme_01
pdisk_guid: 2
- vdisk_locations:
- - node_id: "ydb-node-zone-a-3.local"
- pdisk_category: SSD
+ - node_id: *host_3
+ pdisk_category: *pdisk_category
path: /dev/disk/by-partlabel/kikimr_nvme_01
pdisk_guid: 3
- vdisk_locations:
- - node_id: "ydb-node-zone-a-4.local"
- pdisk_category: SSD
+ - node_id: *host_4
+ pdisk_category: *pdisk_category
path: /dev/disk/by-partlabel/kikimr_nvme_01
pdisk_guid: 4
- vdisk_locations:
- - node_id: "ydb-node-zone-a-5.local"
- pdisk_category: SSD
+ - node_id: *host_5
+ pdisk_category: *pdisk_category
path: /dev/disk/by-partlabel/kikimr_nvme_01
pdisk_guid: 5
- vdisk_locations:
- - node_id: "ydb-node-zone-a-6.local"
- pdisk_category: SSD
+ - node_id: *host_6
+ pdisk_category: *pdisk_category
path: /dev/disk/by-partlabel/kikimr_nvme_01
pdisk_guid: 6
- vdisk_locations:
- - node_id: "ydb-node-zone-a-7.local"
- pdisk_category: SSD
+ - node_id: *host_7
+ pdisk_category: *pdisk_category
path: /dev/disk/by-partlabel/kikimr_nvme_01
pdisk_guid: 7
- vdisk_locations:
- - node_id: "ydb-node-zone-a-8.local"
- pdisk_category: SSD
+ - node_id: *host_8
+ pdisk_category: *pdisk_category
path: /dev/disk/by-partlabel/kikimr_nvme_01
pdisk_guid: 8
# TODO: migrate to channel_profile_config