3 CASSANDRA_IP=<%= @cassandra_ip %>
4 CASSANDRA_PORT=<%= @cassandra_port %>
5 CS_PASSWORD=<%= @cassandra_pwd %>
6 SDC_USER=<%= @sdc_usr %>
7 SDC_PASSWORD=<%= @sdc_pwd %>
13 while [ $is_up -eq 0 -a $retry_num -le 100 ]; do
15 echo "exit" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT > /dev/null 2>&1
18 if [ $res1 -eq 0 ]; then
19 echo "`date` --- cqlsh is enabled to connect."
22 echo "`date` --- cqlsh is NOT enabled to connect yet. sleep 5"
28 cassandra_user_exist=`echo "list users;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT | grep -c $SDC_USER`
29 if [ $cassandra_user_exist -eq 1 ] ; then
30 echo "cassandra user $SDC_USER already exist"
32 echo "Going to create $SDC_USER"
33 echo "create user $SDC_USER with password '$SDC_PASSWORD' nosuperuser;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT