Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 0 additions & 7 deletions examples/local/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions examples/local/etcd-down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
7 changes: 4 additions & 3 deletions examples/local/etcd-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down