diff --git a/bootstrap.sh b/bootstrap.sh index 3296b06dee6..47c4a2f6f32 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -207,37 +207,6 @@ if [ "$BUILD_JAVA" == 1 ] ; then install_dep "Zookeeper" "$zk_ver" "$VTROOT/dist/vt-zookeeper-$zk_ver" install_zookeeper fi -# Download and install etcd, link etcd binary into our root. -function install_etcd() { - local version="$1" - local dist="$2" - - case $(uname) in - Linux) local platform=linux; local ext=tar.gz;; - Darwin) local platform=darwin; local ext=zip;; - esac - - case $(get_arch) in - aarch64) local target=arm64;; - x86_64) local target=amd64;; - *) echo "ERROR: unsupported architecture"; exit 1;; - esac - - download_url=https://github.com/coreos/etcd/releases/download - file="etcd-${version}-${platform}-${target}.${ext}" - - wget "$download_url/$version/$file" - if [ "$ext" = "tar.gz" ]; then - tar xzf "$file" - else - unzip "$file" - fi - rm "$file" - ln -snf "$dist/etcd-${version}-${platform}-${target}/etcd" "$VTROOT/bin/etcd" -} -install_dep "etcd" "v3.3.10" "$VTROOT/dist/etcd" install_etcd - - # Download and install consul, link consul binary into our root. function install_consul() { local version="$1" diff --git a/examples/local/env.sh b/examples/local/env.sh index ef9a0c8538a..9232c60b4ff 100644 --- a/examples/local/env.sh +++ b/examples/local/env.sh @@ -58,14 +58,7 @@ if [ "${TOPO}" = "zk2" ]; then else echo "enter etcd2 env" - case $(uname) in - Linux) etcd_platform=linux;; - Darwin) etcd_platform=darwin;; - esac - ETCD_SERVER="localhost:2379" - ETCD_VERSION=$(cat "${VTROOT}/dist/etcd/.installed_version") - ETCD_BINDIR="${VTROOT}/dist/etcd/etcd-${ETCD_VERSION}-${etcd_platform}-amd64/" TOPOLOGY_FLAGS="-topo_implementation etcd2 -topo_global_server_address $ETCD_SERVER -topo_global_root /vitess/global" mkdir -p "${VTDATAROOT}/tmp" diff --git a/examples/local/etcd-down.sh b/examples/local/etcd-down.sh index 402c1216795..fa5daf04de0 100755 --- a/examples/local/etcd-down.sh +++ b/examples/local/etcd-down.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# This is an example script that stops the ZooKeeper servers started by zk-up.sh. +# This is an example script that stops the etcd servers started by etcd-up.sh. set -e @@ -26,4 +26,4 @@ source "${script_root}/env.sh" # Stop etcd servers. echo "Stopping etcd servers..." -kill -9 "$(pgrep -f "${ETCD_BINDIR}/etcd")" +killall -9 etcd diff --git a/examples/local/etcd-up.sh b/examples/local/etcd-up.sh index 5883d967271..4e79c353445 100755 --- a/examples/local/etcd-up.sh +++ b/examples/local/etcd-up.sh @@ -20,20 +20,21 @@ set -e cell=${CELL:-'test'} script_root=$(dirname "${BASH_SOURCE[0]}") +export ETCDCTL_API=2 # shellcheck source=./env.sh # shellcheck disable=SC1091 source "${script_root}/env.sh" -${ETCD_BINDIR}/etcd --data-dir "${VTDATAROOT}/etcd/" --listen-client-urls "http://${ETCD_SERVER}" --advertise-client-urls "http://${ETCD_SERVER}" > "${VTDATAROOT}"/tmp/etcd.out 2>&1 & +etcd --data-dir "${VTDATAROOT}/etcd/" --listen-client-urls "http://${ETCD_SERVER}" --advertise-client-urls "http://${ETCD_SERVER}" > "${VTDATAROOT}"/tmp/etcd.out 2>&1 & sleep 5 echo "add /vitess/global" -${ETCD_BINDIR}/etcdctl --endpoints "http://${ETCD_SERVER}" mkdir /vitess/global & +etcdctl --endpoints "http://${ETCD_SERVER}" mkdir /vitess/global & echo "add /vitess/$cell" -${ETCD_BINDIR}/etcdctl --endpoints "http://${ETCD_SERVER}" mkdir /vitess/$cell & +etcdctl --endpoints "http://${ETCD_SERVER}" mkdir /vitess/$cell & # And also add the CellInfo description for the cell. # If the node already exists, it's fine, means we used existing data.