-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathch_client.sh
More file actions
executable file
·41 lines (39 loc) · 1.81 KB
/
ch_client.sh
File metadata and controls
executable file
·41 lines (39 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
echo "Select a server:";
select choice in \
"Shard 1 Replica 1" \
"Shard 1 Replica 2" \
"Shard 2 Replica 1" \
"Shard 2 Replica 2" \
"Shard 3 Replica 1" \
"Shard 3 Replica 2";
do
case "$choice" in
"Shard 1 Replica 1") echo "Connecting to $choice ..."; docker container run -it --rm --network chcompose_main \
--link chcompose_clickhouse_shard_1_replica_1_1:clickhouse-server yandex/clickhouse-client \
--host clickhouse-server
break;;
"Shard 1 Replica 2") echo "Connecting to $choice ..."; docker container run -it --rm --network chcompose_main \
--link chcompose_clickhouse_shard_1_replica_2_1:clickhouse-server yandex/clickhouse-client \
--host clickhouse-server
break;;
"Shard 2 Replica 1") echo "Connecting to $choice ..."; docker container run -it --rm --network chcompose_main \
--link chcompose_clickhouse_shard_2_replica_1_1:clickhouse-server yandex/clickhouse-client \
--host clickhouse-server
break;;
"Shard 2 Replica 2") echo "Connecting to $choice ..."; docker container run -it --rm --network chcompose_main \
--link chcompose_clickhouse_shard_2_replica_2_1:clickhouse-server yandex/clickhouse-client \
--host clickhouse-server
break;;
"Shard 3 Replica 1") echo "Connecting to $choice ..."; docker container run -it --rm --network chcompose_main \
--link chcompose_clickhouse_shard_3_replica_1_1:clickhouse-server yandex/clickhouse-client \
--host clickhouse-server
break;;
"Shard 3 Replica 2") echo "Connecting to $choice ..."; docker container run -it --rm --network chcompose_main \
--link chcompose_clickhouse_shard_3_replica_2_1:clickhouse-server yandex/clickhouse-client \
--host clickhouse-server
break;;
*) echo "Error: Please try again (select 1..6)!"
;;
esac
done