Skip to content

Commit c68cb93

Browse files
Merge pull request #664 from vitessio/arthur/fixups
More fixups
2 parents 4b2a141 + 2349228 commit c68cb93

4 files changed

Lines changed: 7 additions & 10 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ COPY requirements.txt .
4646
RUN pip3 install -r requirements.txt
4747

4848
# Install ansible add-ons
49+
COPY ansible/requirements.yml ansible/requirements.yml
4950
RUN ansible-galaxy install -r ansible/requirements.yml
5051

5152
# Copy the source code to the working directory

ansible/create_cluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868

6969
- name: Apply VSchema
7070
shell: |
71-
vtctldclient --server {{ groups['vtctld'][0] }}:15999 ApplyVSchema -- --vschema="$(cat /tmp/vschema_sysbench.json)" main
71+
vtctlclient --server {{ groups['vtctld'][0] }}:15999 ApplyVSchema -- --vschema="$(cat /tmp/vschema_sysbench.json)" main
7272
7373
- name: Print go version
7474
debug: msg="VSchema is applied."

ansible/roles/vtctld/tasks/ensure.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
- name: Ensure Primary
1414
register: ensure_latest
1515
shell: |
16-
alias vc="vtctldclient --server {{ groups['vtctld'][0] }}:15999"
16+
alias vc="vtctlclient --server {{ groups['vtctld'][0] }}:15999"
1717
for keyspace in $(vc GetKeyspaces); do
1818
echo "working on ${keyspace}"
1919
for shard in $(vc FindAllShardsInKeyspace -- ${keyspace} | jq -r 'keys[]'); do
2020
echo "working on ${shard}"
21-
primary=$(vc GetTablets --keyspace "${keyspace}" --shard "${shard}" --tablet-type primary | awk '{ print $1 }' | head -n1)
22-
if [ -z "${primary}" ]; then
21+
master=$(vc ListShardTablets -- ${keyspace}/${shard} | grep primary)
22+
if [ -z "${master}" ]; then
2323
echo "setting primary for ${keyspace}/${shard}"
24-
vc InitShardPrimary -- --force ${keyspace}/${shard} $(vc GetTablets --keyspace "${keyspace}" --shard "${shard}" --tablet-type replica | awk '{ print $1 }' | head -n1)
24+
vc InitShardPrimary -- --force ${keyspace}/${shard} $(vc ListShardTablets ${keyspace}/${shard} | awk '{ print $1 }' | head -n1)
2525
else
26-
vc SetReadWrite -- ${primary}
26+
vc SetReadWrite -- $(echo ${master} | awk '{ print $1 }' | head -n1)
2727
fi
2828
done
2929
done

ansible/setup.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@
135135
- files:
136136
- "{{ prometheus_config_dir }}/file_sd/gateways.yml"
137137
prometheus_remote_write:
138-
- url: "http://{{ stats_remote_db_host }}/prom/api/v1/write"
139-
basic_auth:
140-
username: "{{ stats_remote_db_user }}"
141-
password: "{{ stats_remote_db_password }}"
142138
- url: "http://{{ stats_remote_db_host }}:{{ stats_remote_db_port }}/api/v1/prom/write?db={{ stats_remote_db_database }}&u={{ stats_remote_db_user }}&p={{ stats_remote_db_password }}"
143139
prometheus_external_labels:
144140
exec_uuid: "exec_uuid"

0 commit comments

Comments
 (0)