@@ -39,20 +39,22 @@ KEEPER_HOST_01="${keepers[0]}"
39
39
KEEPER_HOST_02=" ${keepers[1]} "
40
40
KEEPER_HOST_03=" ${keepers[2]} "
41
41
42
- # Generate unique reproduceable number IDs by removing letters from KEEPER_IDENTIFIER_*
43
- # Keeper IDs must be numbers, and they cannot be reused (i.e. when a keeper node is
44
- # unrecoverable the ID must be changed to something new).
45
- # By trimming the hosts we can make sure all keepers will always be up to date when
46
- # a new keeper is spun up. Clickhouse does not allow very large numbers, so we will
47
- # be reducing to 7 characters. This should be enough entropy given the small amount
48
- # of keepers we have.
42
+ # Generate unique reproduceable number IDs by removing letters from
43
+ # KEEPER_IDENTIFIER_* Keeper IDs must be numbers, and they cannot be reused
44
+ # (i.e. when a keeper node is unrecoverable the ID must be changed to something
45
+ # new). By trimming the hosts we can make sure all keepers will always be up to
46
+ # date when a new keeper is spun up. Clickhouse does not allow very large
47
+ # numbers, so we will be reducing to 7 characters. This should be enough
48
+ # entropy given the small amount of keepers we have.
49
49
KEEPER_ID_01=" $( echo " ${KEEPER_HOST_01} " | tr -dc [:digit:] | cut -c1-7) "
50
50
KEEPER_ID_02=" $( echo " ${KEEPER_HOST_02} " | tr -dc [:digit:] | cut -c1-7) "
51
51
KEEPER_ID_03=" $( echo " ${KEEPER_HOST_03} " | tr -dc [:digit:] | cut -c1-7) "
52
52
53
- # Identify the node type this is as this will influence how the config is constructed
54
- # TODO(https://github.com/oxidecomputer/omicron/issues/3824): There are probably much better ways to do this service name lookup, but this works
55
- # for now. The services contain the same IDs as the hostnames.
53
+ # Identify the node type this is as this will influence how the config is
54
+ # constructed
55
+ # TODO(https://github.com/oxidecomputer/omicron/issues/3824): There are
56
+ # probably much better ways to do this service name lookup, but this works for
57
+ # now. The services contain the same IDs as the hostnames.
56
58
KEEPER_SVC=" $( zonename | tr -dc [:digit:] | cut -c1-7) "
57
59
if [[ $KEEPER_ID_01 == $KEEPER_SVC ]]
58
60
then
68
70
exit " $SMF_EXIT_ERR_CONFIG "
69
71
fi
70
72
71
- # Setting environment variables this way is best practice, but has the downside of
72
- # obscuring the field values to anyone ssh=ing into the zone. To mitigate this,
73
- # we will be saving them to ${DATASTORE}/config_env_vars
73
+ # Setting environment variables this way is best practice, but has the downside
74
+ # of obscuring the field values to anyone ssh=ing into the zone. To mitigate
75
+ # this, we will be saving them to ${DATASTORE}/config_env_vars
74
76
export CH_LOG=" ${DATASTORE} /clickhouse-keeper.log"
75
77
export CH_ERROR_LOG=" ${DATASTORE} /clickhouse-keeper.err.log"
76
78
export CH_LISTEN_ADDR=${LISTEN_ADDR}
@@ -103,7 +105,7 @@ CH_KEEPER_HOST_03="${CH_KEEPER_HOST_03}""
103
105
104
106
echo $content >> " ${DATASTORE} /config_env_vars"
105
107
106
- # The clickhouse binary must be run from within the directory that contains it.
108
+ # The clickhouse binary must be run from within the directory that contains it.
107
109
# Otherwise, it does not automatically detect the configuration files, nor does
108
110
# it append them when necessary
109
111
cd /opt/oxide/clickhouse_keeper/
0 commit comments