Skip to content
Merged
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
4 changes: 3 additions & 1 deletion .github/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ function install_etcd() {
rm "$file"
ln -snf "$dist/etcd-${version}-${platform}-${target}/etcd" "$VTROOT/bin/etcd"
}
install_dep "etcd" "v3.3.10" "$VTROOT/dist/etcd" install_etcd

# Install etcd if not detected
which etcd || install_dep "etcd" "v3.3.10" "$VTROOT/dist/etcd" install_etcd

echo
echo "bootstrap finished"
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function install_etcd() {
rm "$file"
ln -snf "$dist/etcd-${version}-${platform}-${target}/etcd" "$VTROOT/bin/etcd"
}
install_dep "etcd" "v3.3.10" "$VTROOT/dist/etcd" install_etcd
which etcd || install_dep "etcd" "v3.3.10" "$VTROOT/dist/etcd" install_etcd


# Download and install consul, link consul binary into our root.
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
2 changes: 1 addition & 1 deletion 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 Down
7 changes: 4 additions & 3 deletions examples/local/etcd-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@ 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 &
PID=$!
echo $PID > "${VTDATAROOT}/tmp/etcd.pid"
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