Join our official collaboration hub!
Setting Up Cassandra
Prerequisites
Install Oracle Java Standard Edition 8 and Python 2.7 from your distro's package manager.
We are going to install all the necessary software under /opt directory which has sufficient disk space (ideally 1 TB) and is mounted on an SSD.
Download Apache Cassandra 3.11.6 from this official download link and unarchive directly under /opt.
Edit the config file (/opt/apache-cassandra-3.11.6/conf/cassandra.yaml)
Update the listen address appropriately,
listen_address: localhost
Also tweak the below settings appropriately per the instructions provided in the config file. The below sample values are good for a 12 core machine
concurrent_reads: 32
concurrent_writes: 96
concurrent_counter_writes: 32
Also explicitly set the max threads configuration as below,
native_transport_max_threads: 256
To facilitate the highly concurrent application, make the following system configurations, it primarily is meant to help Cassandra operate optimally.
/etc/security/limits.conf
* - memlock unlimited
* - nofile 100000
* - nproc 32768
* - as unlimited
/etc/sysctl.conf
vm.max_map_count = 1048575
Set the PATH environment variable as follows in your .bashrc file:
export PATH=$PATH:/opt/apache-cassandra-3.11.6/bin
Cassandra can be started using the following command
$cassandra
To stop Cassandra, we can simply get the processID and kill it.
$ps -ef |grep cassandra
$kill -9 <pid>
Login to CQL shell (cqlsh) and execute the contents of the schema.cql file that was included in the release.
Setting Up Neo4j
Installation
Download the official (3.5.20) release of Neo4j from here and unarchive the same under /opt.
Note: Only Neo4j version "3.5.x" is officially supported. The packaged Neo4j driver does NOT support versions 4.x.x.
Edit the config file at /opt/neo4j-community-3.5.20/conf/neo4j.conf and add the following at the bottom of the file
dbms.connector.bolt.thread_pool_min_size=20
dbms.connector.bolt.thread_pool_max_size=2048
dbms.connector.bolt.thread_pool_keep_alive=5m
Also uncomment and update the following entry appropriately,
dbms.connector.default_listen_address=0.0.0.0
Login to the Neo4j web console (http://localhost:7474/) and execute the following:
CREATE CONSTRAINT ON (n:mnode) ASSERT n.v IS UNIQUE;
You can verify if the constraints have been applied correctly by querying
$ :schema
And you should see the following output,
Indexes ON :mnode(v) ONLINE (for uniqueness constraint) Constraints ON ( mnode:mnode ) ASSERT mnode.v IS UNIQUE
Set the PATH environment variable as follows in your .bashrc file:
export PATH=$PATH:/opt/apache-cassandra-3.11.6/bin:/opt/neo4j-community-3.5.20/bin
neo4j can be started and stopped using the following command/s
$neo4j [start/stop/restart]Other packages
Using the appropriate package manager for your Linux distribution install the below packages. For example on Arch variants run,
sudo pacman -S libsecp256k1
sudo pacman -S leveldb