This page (revision-21) was last changed on 23-Apr-2022 17:06 by Harry Metske

This page was created on 23-Apr-2022 17:05 by Harry Metske

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
21 23-Apr-2022 17:06 11 KB Harry Metske to previous

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 72 removed one line
* edit {{./conf/cassandra-env.sh}} (at the bottom of the file) : uncomment and fill in : '' JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=10.0.4.12" '' %%small (this makes it possible to run nodetool against remote hosts) %%
At line 222 removed 43 lines
And insert with the ''cqlsh -2'' utility :
{{{
cssndra@ubuntu1:~$ cqlsh -2
Connected to Test Cluster at localhost:9160.
[cqlsh 2.3.0 | Cassandra 0.0.0 | CQL spec 2.0.0 | Thrift protocol 19.35.0]
Use HELP for help.
cqlsh> USE demo_keyspace ;
cqlsh:demo_keyspace> INSERT INTO users ( key, name, password, whatevercolumn) VALUES ( '12345' , 'harry' , 'wachtwoordje' , 'blablabla fjkdsjf l4j 2k43u');
cqlsh:demo_keyspace>
}}}
And a stupid shell script to insert bulk data :
%%prettify
{{{
#!/bin/bash
#
num=$1
let n=0
TMPFILE=/tmp/$RANDOM.cql
echo "use demo_keyspace;" > $TMPFILE
while [ $n -lt $num ]
do
# echo $n
CQL="INSERT INTO users ( key, name, password, whatevercolumn) VALUES ( '99${n}' , 'harry${n}' , 'wachtwoordje${n}' , 'blablabla fjkdsjf ${n} ${n} ${n}2k43u');"
echo $CQL >> $TMPFILE
let n=n+1
done
echo "echoing inserts to cqlsh..."
cqlsh -2 -f $TMPFILE
echo "listing users..."
cat <<EOF | cassandra-cli
use demo_keyspace;
list users;
EOF
rm $TMPFILE
}}}
%%