Skip to content

Commit

Permalink
debug: Job for scylla-server.service failed
Browse files Browse the repository at this point in the history
Change-Id: I70ef59c592b6af33062a00d74005d0a8c1fb56e4
  • Loading branch information
javeme committed Apr 19, 2021
1 parent 723fa10 commit 3aad453
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 13 deletions.
23 changes: 12 additions & 11 deletions hugegraph-dist/src/assembly/travis/install-cassandra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@
set -ev

TRAVIS_DIR=`dirname $0`
CASSA_DOWNLOAD_ADDRESS="http://archive.apache.org/dist/cassandra"
CASSA_VERSION="3.10"
CASSA_PACKAGE="apache-cassandra-${CASSA_VERSION}"
CASSA_TAR="${CASSA_PACKAGE}-bin.tar.gz"
CASS_DOWNLOAD_ADDRESS="http://archive.apache.org/dist/cassandra"
CASS_VERSION="3.10"
CASS_PACKAGE="apache-cassandra-${CASS_VERSION}"
CASS_TAR="${CASS_PACKAGE}-bin.tar.gz"
CASS_CONF="${CASS_PACKAGE}/conf/cassandra.yaml"

# download cassandra
if [ ! -f $HOME/downloads/${CASSA_TAR} ]; then
wget -q -O $HOME/downloads/${CASSA_TAR} ${CASSA_DOWNLOAD_ADDRESS}/${CASSA_VERSION}/${CASSA_TAR}
if [ ! -f $HOME/downloads/${CASS_TAR} ]; then
wget -q -O $HOME/downloads/${CASS_TAR} ${CASS_DOWNLOAD_ADDRESS}/${CASS_VERSION}/${CASS_TAR}
fi

# decompress cassandra
cp $HOME/downloads/${CASSA_TAR} ${CASSA_TAR} && tar xzf ${CASSA_TAR}
cp $HOME/downloads/${CASS_TAR} ${CASS_TAR} && tar -xzf ${CASS_TAR}

# using tmpfs for the Cassandra data directory reduces travis test runtime
sudo mkdir /mnt/ramdisk
sudo mount -t tmpfs -o size=1024m tmpfs /mnt/ramdisk
sudo ln -s /mnt/ramdisk $CASSA_PACKAGE/data
sudo ln -s /mnt/ramdisk $CASS_PACKAGE/data

# config cassandra
sed -i "s/batch_size_warn_threshold_in_kb:.*/batch_size_warn_threshold_in_kb: 10240/g" ${CASSA_PACKAGE}/conf/cassandra.yaml
sed -i "s/batch_size_fail_threshold_in_kb:.*/batch_size_fail_threshold_in_kb: 10240/g" ${CASSA_PACKAGE}/conf/cassandra.yaml
sed -i "s/batch_size_warn_threshold_in_kb:.*/batch_size_warn_threshold_in_kb: 10240/g" $CASS_CONF
sed -i "s/batch_size_fail_threshold_in_kb:.*/batch_size_fail_threshold_in_kb: 10240/g" $CASS_CONF

# start cassandra service
sh ${CASSA_PACKAGE}/bin/cassandra
sh ${CASS_PACKAGE}/bin/cassandra
29 changes: 27 additions & 2 deletions hugegraph-dist/src/assembly/travis/install-scylladb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ TRAVIS_DIR=`dirname $0`
# https://www.scylladb.com/download/?platform=ubuntu-16.04&version=scylla-4.4#open-source
# https://github.com/scylladb/gocqlx/commit/c7f0483dd30b1c7ad1972ea135528dc95cc4ce32
DOWNLOAD_ADDRESS="http://downloads.scylladb.com/deb/ubuntu/scylla-4.4-$(lsb_release -s -c).list"
SCYLLA_PORT=9042
SCYLLA_CONF="/etc/scylla/scylla.yaml"
SCYLLA_OPTS="--network-stack posix --enable-in-memory-data-store 1 --developer-mode 1"
SCYLLA_OPTS_LOG="--log-to-stdout 1 --default-log-level info"

Expand All @@ -18,8 +20,31 @@ sudo curl -L --output /etc/apt/sources.list.d/scylla.list $DOWNLOAD_ADDRESS
sudo apt-get update
sudo apt-get install scylla

cat /etc/scylla/scylla.yaml
# config scylladb
sed -i "s/batch_size_warn_threshold_in_kb:.*/batch_size_warn_threshold_in_kb: 10240/g" $SCYLLA_CONF
sed -i "s/batch_size_fail_threshold_in_kb:.*/batch_size_fail_threshold_in_kb: 10240/g" $SCYLLA_CONF
cat $SCYLLA_CONF

sudo scylla_dev_mode_setup --developer-mode 1
cat /etc/scylla.d/dev-mode.conf

# setup scylladb with scylla_setup by expect
sudo apt-get install expect
sudo expect <<EOF
spawn sudo scylla_setup
expect {
"YES/no" { send "no\r"; exp_continue }
eof
}
EOF

# start scylladb service
#sudo /usr/bin/scylla --options-file /etc/scylla/scylla.yaml ${SCYLLA_OPTS} ${SCYLLA_OPTS_LOG} &
sudo systemctl start scylla-server
sudo systemctl start scylla-server || (sudo systemctl status scylla-server.service && exit 1)

# check status, wait port listened
echo "Waiting for scylladb to launch on port $SCYLLA_PORT..."
while ! nc -z localhost $SCYLLA_PORT; do
sleep 1 # wait for 1 second before check again
done
sudo netstat -na | grep -i listen | grep tcp # can also run `nodetool status`

0 comments on commit 3aad453

Please sign in to comment.