-
Notifications
You must be signed in to change notification settings - Fork 1
3. Apache Cassandra
Source : https://cassandra.apache.org/doc/latest/getting_started/installing.html
-
Add Cassandra Debian Repository
$ echo "deb http://www.apache.org/dist/cassandra/debian 36x main" | sudo tee -a /etc/apt/sources.list.d/cassandra.sources.list
-
Import the Cassandra Repository key
$ curl https://downloads.apache.org/cassandra/KEYS | sudo apt-key add -
-
Update the APT index
$ sudo apt update
-
If there's an error "GPG error: http://www.apache.org 36x InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A278B781FE4B2BDA"
$ sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-key A278B781FE4B2BDA && sudo apt update
-
Install Cassandra using APT
$ sudo apt-get install cassandra
-
Enable Cassandra Service
$ sudo systemctl enable cassandra.service
-
Start Cassandra Service
$ sudo systemctl start cassandra.service
-
Configuring Apache Cassandra, edit
/etc/cassandra/cassandra.yaml
file, change theauthenticator
,rpc_address
, andbroadcast_rpc_address
like the following value below:authenticator: PasswordAuthenticator ... rpc_address: 0.0.0.0 ... broadcast_rpc_address: localhost
-
Restart Cassandra Service
$ sudo systemctl restart cassandra.service
-
Login to cassandra with default user
$ cqlsh -u cassandra -p cassandra
NB : when there is an error "Connection error: ('Unable to connect to any servers', {'127.0.0.1': TypeError ('ref () does not take keyword arguments',)})" please use the following syntax:
$ sudo apt install python-pip $ pip install cassandra-driver $ export CQLSH_NO_BUNDLED=true
-
Create new Apache Cassandra user with the following command:
CREATE USER admin WITH PASSWORD 'password' SUPERUSER;
-
Import Apache Cassandra keyspace, copy file
cassandraQueryScript.cql
to defense center. For the file, you can download it from here: https://raw.githubusercontent.com/dimasmamot/fp_work_dir/master/cassandraQueryScript.cql -
Run with the following command to import the keyspace:
$ cqlsh -u admin -f cassandraQueryScript.cql
-
Login using admin
$ cqlsh -u admin
-
Use kaspa keyspace
use kaspa;
-
Add a new account for kaspa
INSERT INTO kaspa.user (username, company, email, first_name, group, last_name, password_hash, time_joined) VALUES ('admin', 'admin', '[email protected]', 'admin', 'admin', 'admin', '$6$rounds=656000$aS2RFKm/fkVcHWi1$QaltqzL92qlShWP9hG2vWIHZ1qCzRnIXApavcCBvaewGQGZArBNvQRazfMabJonZaXzmwMwuodGFYAV3h5Pzw0', toTimeStamp(now()));
-
Done