We are using a pig script to export data into Cassandra from hive. The script will truncate the cassandra table and run export .
To perform TRUNCATE part, we are using the below command. But if that node is down at the moment , the script fails .
$ cqlsh -u user -p password host1 -e "USE randomkeyspace; CONSISTENCY ALL;TRUNCATE TABLE randomtable"
Is there any other way to run this job so that it can contact other host if host1 is down ?
Or else
can we use this -
host=("host1" "host2" "host3")
$ cqlsh -u user -p password $host -e "USE randomkeyspace; CONSISTENCY ALL;TRUNCATE TABLE randomtable"
Thanks!