diff options
author | 2019-03-28 11:00:54 +0200 | |
---|---|---|
committer | 2019-04-04 16:33:03 +0300 | |
commit | c4d387d216e72911f80c1ebee91b73aba191b91b (patch) | |
tree | c12066b7a213d34ca7c84375fb4bb2d6f0b23138 /asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb | |
parent | ac3aca69dbeae29c9aeca2053adc7aedbb75e149 (diff) |
Make Cassandra port configurable.
SDC-BE & Onboarding - BE.
Reviewer: Evgenia A & Areli F.
Change-Id: Iaf86d647b0560764ef65d9148c85bffaf934992d
Issue-ID: SDC-2077
Signed-off-by: Tal Gitelman <tal.gitelman@att.com>
Diffstat (limited to 'asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb')
-rw-r--r-- | asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb index df4a55e34b..bbd048cb9e 100644 --- a/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb +++ b/asdctool/sdc-cassandra-init/chef-repo/cookbooks/cassandra-actions/templates/default/create_cassandra_user.sh.erb @@ -1,6 +1,8 @@ #!/bin/bash CASSANDRA_IP=<%= @cassandra_ip %> +#Port for Cassandra Thrift to listen for clients on +CASSANDRA_PORT=9160 CS_PASSWORD=<%= @cassandra_pwd %> SDC_USER=<%= @sdc_usr %> SDC_PASSWORD=<%= @sdc_pwd %> @@ -11,7 +13,7 @@ retry_num=1 is_up=0 while [ $is_up -eq 0 -a $retry_num -le 100 ]; do - echo "exit" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP > /dev/null 2>&1 + echo "exit" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT > /dev/null 2>&1 res1=$? if [ $res1 -eq 0 ]; then @@ -24,10 +26,10 @@ while [ $is_up -eq 0 -a $retry_num -le 100 ]; do let "retry_num++" done -cassandra_user_exist=`echo "list users;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP |grep -c $SDC_USER` +cassandra_user_exist=`echo "list users;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT | grep -c $SDC_USER` if [ $cassandra_user_exist -eq 1 ] ; then echo "cassandra user $SDC_USER already exist" else echo "Going to create $SDC_USER" - echo "create user $SDC_USER with password '$SDC_PASSWORD' nosuperuser;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP + echo "create user $SDC_USER with password '$SDC_PASSWORD' nosuperuser;" | cqlsh -u cassandra -p $CS_PASSWORD $CASSANDRA_IP $CASSANDRA_PORT fi
\ No newline at end of file |