Skip to content

Commit

Permalink
feat: add compose configuration for deploying ydb cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
polRk committed Oct 17, 2024
1 parent 839e236 commit fd9b12b
Show file tree
Hide file tree
Showing 6 changed files with 475 additions and 140 deletions.
63 changes: 63 additions & 0 deletions docker/cfg/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
actor_system_config:
cpu_count: 1
node_type: STORAGE
use_auto_config: true
blob_storage_config:
service_set:
groups:
- erasure_species: none
rings:
- fail_domains:
- vdisk_locations:
- node_id: 1
path: SectorMap:1:64
pdisk_category: SSD
channel_profile_config:
profile:
- channel:
- erasure_species: none
pdisk_category: 0
storage_pool_kind: ssd
- erasure_species: none
pdisk_category: 0
storage_pool_kind: ssd
- erasure_species: none
pdisk_category: 0
storage_pool_kind: ssd
profile_id: 0
domains_config:
domain:
- name: Root
storage_pool_types:
- kind: ssd
pool_config:
box_id: 1
erasure_species: none
kind: ssd
pdisk_filter:
- property:
- type: SSD
vdisk_kind: Default
state_storage:
- ring:
node:
- 1
nto_select: 1
ssid: 1
grpc_config:
port: 2135
host_configs:
- drive:
- path: SectorMap:1:64
type: SSD
host_config_id: 1
hosts:
- host: localhost
host_config_id: 1
node_id: 1
port: 19001
walle_location:
body: 1
data_center: az-1
rack: "0"
static_erasure: none
9 changes: 9 additions & 0 deletions docker/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
x-template: &ydb-common
image: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7
restart: always
hostname: localhost
platform: linux/amd64
privileged: true
network_mode: host
volumes:
- ./cfg/config.yaml:/opt/ydb/cfg/config.yaml
191 changes: 191 additions & 0 deletions docker/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
x-template: &ydb-common
image: cr.yandex/crptqonuodf51kdj7a7d/ydb:24.2.7
restart: always
hostname: localhost
platform: linux/amd64
privileged: true
volumes:
- ./cfg/config.yaml:/opt/ydb/cfg/config.yaml

name: ydb

services:

static-0:
<<: *ydb-common
container_name: static-0
command:
- /opt/ydb/bin/ydbd
- server
- --grpc-port
- "2135"
- --mon-port
- "8765"
- --ic-port
- "19001"
- --yaml-config
- /opt/ydb/cfg/config.yaml
- --node
- static
- --label
- deployment=docker
ports:
- 2135:2135
- 8765:8765
- 19001:19001
healthcheck:
test: bash -c "exec 6<> /dev/tcp/localhost/2135"
interval: 10s
timeout: 1s
retries: 3
start_period: 30s

static-init:
<<: *ydb-common
restart: on-failure
container_name: static-init
command:
- /opt/ydb/bin/ydbd
- -s
- grpc://localhost:2135
- admin
- blobstorage
- config
- init
- --yaml-file
- /opt/ydb/cfg/config.yaml
depends_on:
static-0:
condition: service_healthy

tenant-init:
<<: *ydb-common
restart: on-failure
container_name: tenant-init
command:
- /opt/ydb/bin/ydbd
- -s
- grpc://localhost:2135
- admin
- database
- /Root/slo
- create
- ssd:1
depends_on:
static-init:
condition: service_completed_successfully

dynamic-1:
<<: *ydb-common
container_name: dynamic-1
command:
- /opt/ydb/bin/ydbd
- server
- --grpc-port
- "2136"
- --mon-port
- "8766"
- --ic-port
- "19002"
- --yaml-config
- /opt/ydb/cfg/config.yaml
- --tenant
- /Root/slo
- --node-broker
- grpc://localhost:2135
- --label
- deployment=docker
ports:
- 2136:2136
- 8766:8766
- 19002:19002
healthcheck:
test: bash -c "exec 6<> /dev/tcp/localhost/2136"
interval: 10s
timeout: 1s
retries: 3
start_period: 30s
depends_on:
static-0:
condition: service_healthy
static-init:
condition: service_completed_successfully
tenant-init:
condition: service_completed_successfully

dynamic-2:
<<: *ydb-common
container_name: dynamic-2
command:
- /opt/ydb/bin/ydbd
- server
- --grpc-port
- "2137"
- --mon-port
- "8767"
- --ic-port
- "19003"
- --yaml-config
- /opt/ydb/cfg/config.yaml
- --tenant
- /Root/slo
- --node-broker
- grpc://localhost:2135
- --label
- deployment=docker
ports:
- 2137:2137
- 8767:8767
- 19003:19003
healthcheck:
test: bash -c "exec 6<> /dev/tcp/localhost/2137"
interval: 10s
timeout: 1s
retries: 3
start_period: 30s
depends_on:
static-0:
condition: service_healthy
static-init:
condition: service_completed_successfully
tenant-init:
condition: service_completed_successfully

dynamic-3:
<<: *ydb-common
container_name: dynamic-3
command:
- /opt/ydb/bin/ydbd
- server
- --grpc-port
- "2138"
- --mon-port
- "8768"
- --ic-port
- "19004"
- --yaml-config
- /opt/ydb/cfg/config.yaml
- --tenant
- /Root/slo
- --node-broker
- grpc://localhost:2135
- --label
- deployment=docker
ports:
- 2138:2138
- 8768:8768
- 19004:19004
healthcheck:
test: bash -c "exec 6<> /dev/tcp/localhost/2138"
interval: 10s
timeout: 1s
retries: 3
start_period: 30s
depends_on:
static-0:
condition: service_healthy
static-init:
condition: service_completed_successfully
tenant-init:
condition: service_completed_successfully

Loading

0 comments on commit fd9b12b

Please sign in to comment.