Skip to content

Instantly share code, notes, and snippets.

@ajm188
Created June 10, 2021 18:47
Show Gist options
  • Save ajm188/094f286b6adce5da02f38e1ad5b7608a to your computer and use it in GitHub Desktop.
Save ajm188/094f286b6adce5da02f38e1ad5b7608a to your computer and use it in GitHub Desktop.
vtctl replacement
--- a/examples/local/scripts/etcd-up.sh
+++ b/examples/local/scripts/etcd-up.sh
@@@ -40,10 -40,10 +40,21 @@@ etcdctl --endpoints "http://${ETCD_SERV
echo "add $cell CellInfo"
set +e
# shellcheck disable=SC2086
--vtctl $TOPOLOGY_FLAGS AddCellInfo \
-- -root /vitess/$cell \
-- -server_address "${ETCD_SERVER}" \
-- $cell
++vtctld $TOPOLOGY_FLAGS \
++ -service_map 'grpc-vtctld' \
++ -log_dir ${VTDATAROOT}/tmp \
++ -grpc_port 15999 \
++ -pid_file ${VTDATAROOT}/tmp/vtctld.pid \
++ > "${VTDATAROOT}/tmp/vtctld.out" 2>&1 &
++
++vtctld_pid=$!
++sleep 0.1
++vtctldclient --server ":15999" \
++ AddCellInfo \
++ --root /vitess/$cell \
++ --server-address "${ETCD_SERVER}" \
++ $cell
++kill ${vtctld_pid}
set -e
echo "etcd start done..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment