Created
June 21, 2022 11:08
-
-
Save avikivity/8965f1c189c7941596a8f30a346c06e3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -ex | |
using_container=0 | |
using_gdb=0 | |
while [[ "$1" = -* ]]; do | |
case "$1" in | |
--container) | |
using_container=1; shift | |
;; | |
--gdb) | |
using_gdb=1; shift | |
;; | |
*) | |
echo "unknown switch $1"; | |
exit 1 | |
;; | |
esac | |
done | |
binary="$1" | |
ip="127.0.0.$2" | |
cluster_home="/home/avi/cluster" | |
gdb_prefix=() | |
if ((using_gdb)); then | |
gdb_prefix=(gdb --args) | |
fi | |
cmds=("$binary") | |
if ((using_container)); then | |
cmds=(podman run --rm --net host -v "${HOME}:${HOME}" -w "$PWD" | |
--entrypoint /usr/bin/scylla "$binary") | |
fi | |
run() { | |
"${cmds[@]}" "$@" | |
} | |
mkdir -p "$cluster_home/$ip" | |
opts=(--ring-delay-ms 2000) | |
#opts+=(--reactor-backend linux-aio) | |
# opts+=(--experimental-features cdc) | |
# perf buildid-cache --add "$binary" | |
if run --help | grep -q workdir; then | |
opts+=(--workdir "$cluster_home/$ip") | |
else | |
if run --help-loggers | grep -q schema_diff; then | |
opts+=(--logger-log-level schema_diff=trace) | |
fi | |
if run --help | grep -q view-hints-directory; then | |
opts+=("--view-hints-directory" "$cluster_home/$ip/view-hints") | |
fi | |
if run --help | grep -q hints-directory; then | |
opts+=("--hints-directory" "$cluster_home/$ip/hints") | |
fi | |
opts+=( | |
--datadir "$cluster_home/$ip/data" | |
--commitlog-directory "$cluster_home/$ip/commitlog" | |
) | |
fi | |
#perf_events=( | |
# sdt_rpc:rxdelay | |
# sdt_seastar:reactor_run_tasks_end | |
# sdt_seastar:reactor_run_tasks_single_end | |
# sdt_seastar:reactor_run_tasks_single_start | |
# sdt_seastar:reactor_run_tasks_start | |
#) | |
# | |
#for e in "${perf_events}"; do | |
# perf probe "$e" | |
#done | |
#perf=(perf record "${perf_events[@]/#/-e}") | |
run \ | |
--collectd 0 \ | |
-m 2G --smp 1 --overprovisioned \ | |
--developer-mode 1 \ | |
--blocked-reactor-notify-ms=2 \ | |
--rpc-address "$ip" \ | |
--listen-address "$ip" \ | |
--api-address "$ip" \ | |
--prometheus-address "$ip" \ | |
--seed-provider-parameters seeds=127.0.0.1 \ | |
"${opts[@]}" \ | |
2>&1 | tee "$cluster_home/$ip/log" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment