...
- You will be installing the latest Apache Cassandra release - 3.10. Since this is a database that will be shared by all Syndeia users in your group / organization, you must install it on a shared machine (on-premise or cloud) that can be accessed by the Syndeia installations on the user machines. Cassandra can be installed on any modern OS like Windows, Linux or Mac. We recommend a machine with minimum 8 GB of RAM (more the better). With dedicated hardware, there is no reason to use less than 8GB or 16GB, and you often see clusters with 32GB or more per node.
- Go to the Cassandra download site - http://cassandra.apache.org/download/ - and download the compressed .tar.gz file. Unzip the compressed file and include the resulting folder in your PATH environment variable (for Windows). For example, the resulting folder after unzipping may be C:\apache-cassandra-3.10 (on Windows) or /home/apache-cassandra-3.10 (on Linux or Mac), and its contents will be as below. Let’s refer to this folder location as <Cassandra Installation> in the remainder of this document.
- Now lets let's setup Cassandra so that you can access, start, and stop it from any folder.
- For Windows: Either create a new environment variable called CASSANDRA_HOME which points to <Cassandra Installation>, or you may edit the PATH environment variable and append <Cassandra Installation> at the end of it.
For Linux / Mac: Add the following lines to your ~/.profile file:.
Code Block export CASSANDRA=/home/apache-cassandra-3.10 export PATH=$PATH:$CASSANDRA/bin
- For Windows: Either create a new environment variable called CASSANDRA_HOME which points to <Cassandra Installation>, or you may edit the PATH environment variable and append <Cassandra Installation> at the end of it.
Once you’ve done this, open a command prompt (terminal) and type
Code Block cassandra -f
You’ll see a lot of output being printed at the terminal and at the end of it you’ll see
–the following:
08 StartingCode Block theme Confluence INFO 09:16:
904208 Starting listening for CQL clients on localhost/127.0.0.1:
9042 (unencrypted)...
INFO 09:16:09 Not starting RPC server as requested. Use JMX (StorageService->startRPCServer()) or nodetool (enablethrift) to start it
The
highlightedfirst line above means that Cassandra is running on the default port number 9042.
“command
If you encounter“command cassandra not
found”found” or a similar error, then there is some problem with the environment variable not being properly set (because the OS is not able to find cassandra (.bat or .sh file). In that case you can navigate to the
C:\ apache-cassandra-3.10<Cassandra Installation>\bin folder and then run the above command.
To double check if Cassandra is running, run the following command in another terminal window -
Code Block nodetool status
You should see an output such as below. This indicates that Cassandra is up and running.
- DataStax are the creators of DataStax Enterprise, the commercially supported version of Apache Cassandra. They have a tool called DataStax DevCenter which can be used to visually that provides a rich UI (beyond command line tools) to connect to a running instance of Cassandra. Using this tool, you can create keyspaces, run CQL queries etc. However, to download DevCenter, you’ll first need to create an account on the DataStax site, and then go to https://academy.datastax.com/downloads/ops-center to download DevCenter. Once you run DevCenter, you’ll need to create a connection to the server where Cassandra is running, and then you may run queries in the editor as shown in the below images –.
DataStax DevCenter Connections pane –
DataStax DevCenter Schema pane –
DataStax DevCenter query editor – By default, Cassandra is configured to let any user access the database without asking for any username / password combination. To change this behaviourbehavior, we you need to modify the cassandra.yaml file located in C:\ apache-cassandra-3.10 <Cassandra Installation>\conf folder. Search for the string – “authenticator:“authenticator” in the file. You’ll notice that the default value is set to – AllowAllAuthenticator. As is mentioned in the comments (in the yaml file) starting with # character, AllowAllAuthenticator performs no checks and is used to disable authentication. Change this value to PasswordAuthenticator. Similarly, search for the string – “authorizer“authorizer:” (this section is exactly below the authenticator section described above). The default value is set to AllowAllAuthorizer which allows any action to any user and is used to disable authorization. Change this value to CassandraAuthorizer. Now, Cassandra will ask for username / password combination to login to it and the admin will have to create different usernames and grant them proper access rights to (view/update/delete tables / keyspaces etc.Please read the documentation to create database roles, users and permissions in Apache and keyspaces) to all Syndeia users who will be using the database.
Read the documentation here - https://docs.datastax.com/en/cql/3.3/cql/cql_using/useSecureRoles.html - to create roles, users, and permissions in Cassandra. Here are a few examples to accomplish the above –commands.
Code Block theme Confluence firstline 1 CREATE USER IF NOT EXISTS sandy WITH PASSWORD 'Ride2Win@' NOSUPERUSER;
CREATE ROLE IF NOT EXISTS team_manager WITH PASSWORD = 'RockIt4Us!';
GRANT MODIFY ON KEYSPACE cycling TO team_manager;
GRANT DESCRIBE ON ALL ROLES TO sys_admin;
Syndeia uses syndeia_general keyspace to store repositories repository-related information and a SysML project-specific keyspace to store connections connection-related information. To find all the repositories the following command may be run –
Code Block select * from syndeia_general.repositories;
If the keyspace has already been selected in the dropdown in DevCenter query editor (see screenshot above), then the keyspace name may be omitted –and the following command may be used.Code Block select * from repositories;
Similarly, all the connections may be viewed by –selecting the project-specific keyspace from the dropdown menu in the DevCenter query editor and executing the following command.
connections;Code Block select * from
Cassandra can be installed on any modern OS like Windows, Linux or Mac. Ideally the machine should have 4 GB of RAM (at the minimum) but the more memory, the better. So with dedicated hardware there is no reason to use less than 8GB or 16GB, and you often see clusters with 32GB or more per node.connections;