-
Notifications
You must be signed in to change notification settings - Fork 202
/
cassandra-server
executable file
·41 lines (30 loc) · 1.07 KB
/
cassandra-server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
. $LKP_SRC/lib/reproduce-log.sh
. $LKP_SRC/lib/tests/cassandra.sh
cassandra_server=$BENCHMARK_ROOT/cassandra/bin/cassandra
setup_java_home
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
if [ -n "$mount_points" ]; then
path="${mount_points%% *}"
else
echo "Can not get the mount points, exit!" 1>&2
exit 1
fi
cassandra_conf="$BENCHMARK_ROOT/cassandra/conf/cassandra.yaml"
def_data_dir="/var/lib/cassandra/data"
new_data_dir="$path/cassandra/data"
sed -i "s/# data_file_directories:/data_file_directories:/" "$cassandra_conf"
sed -i "s@^#.*- $def_data_dir@ - $new_data_dir@" "$cassandra_conf"
def_log_dir="/var/lib/cassandra/commitlog"
new_log_dir="$path/cassandra/commitlog"
sed -i "s@# commitlog_directory: ${def_log_dir}@commitlog_directory: ${new_log_dir}@" $cassandra_conf
gc_log=$BENCHMARK_ROOT/cassandra/logs/gc.log
mkdir -p $(dirname $gc_log)
touch $gc_log
cp $cassandra_conf $TMP_RESULT_ROOT/
# log command
log_echo $cassandra_server -f -R
# start cassandra server
exec $cassandra_server -f -R