Cassandra NoSQL database installation on Windows - 8.0.1.1029 version

This article describes the process for installing a Cassandra NoSQL database on a Windows server where you plan to install TestRail Server 8 or later.

Prerequisites

To install the Cassandra database, you have to install some required components:

  1. Oracle JDK 8
  2. Python 2.7
  3. Cassandra driver for TestRail

1. Install JDK 8

Download the installer using the appropriate link. It is crucial to ONLY use version 1.8.0_202

https://www.oracle.com/pl/java/technologies/javase/javase8-archive-downloads.html

After installation, verify the Java version installed by entering 'java -version' on your cmd.

The JDK is successfully installed if 'java -version' outputs something like this:

java version "1.8.0_202"
Java(TM) SE Runtime Environment (build 1.8.0_202-b08)
Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)

Next, add the JDK 8 path to system Environment Variables. 

Go to Advanced system settings and select Environment Variables.

 

Create a new variable under System variables.

image5.png

 

Write the name of the variable (JAVA_HOME) and browse the directory where the jdk is installed. Usually C:\\Program Files\\Java\\jdk1.8.0_202, and click OK.

image10.png

 

Then, under System Variables select the Path variable, and click Edit.

image8.png

 

Click New to add the ‘\bin’ directory of your JDK install to the System PATH variable (usually C:\Program Files\Java\jdk1.8.0_202), select it and click OK.

image1.png

 

2. Install Python 2.7 

Download the Python 2.7 installer from the official Python website.

Run the installer and follow the instructions. 

After completing the installation, extend your PATH for Python as well. Once again, go to the Environment Variables screen and double-click on the existing PATH system variable.

Select New and then Browse for the installation path of Python. Click Ok to finish.

 

3. Cassandra driver for TestRail 

Download the 'php_cassandra.dll' and 'uv.dll' files from https://idera.egnyte.com/fl/9RcZnmda05.
These exact files are required to run TestRail on Windows. You can verify the version you have by running 'php -v' on the cmd.

Copy the 'php_cassandra.dll' driver to your PHP's directory (usually C:\php\ext or similar). Next, activate the extension by adding the following line to your PHP.ini file. You can find the PHP.ini file in your PHP installation directory (usually C:\php\ext or similar).

extension=cassandra.dll

 

Do not include the ‘php_’ prefix or the ‘.dll’ extension in the INI file contents. Copy the ‘uv.dll’ driver to your PHP’s root directory (usually C:\php or similar), but there is no need to register 'uv.dll' in your php.ini file.

Install Cassandra

 

Currently, Cassandra 3.11 is the ONLY supported Cassandra version for Server installations.

  1. Download Cassandra 3.11 from https://cassandra.apache.org/_/download.html
  2. Extract the downloaded file to a path you prefer. 
  3. Configure the environment variables for Cassandra.

    Cassandra_Environment_variables.png

  4. Create a new system variable named CASSANDRA_HOME and point the Variable Value to the location of the unzipped Apache Cassandra folder. For example, C:\Cassandra\apache-cassandra-3.11.14

    image4.png

  5. Extend your PATH for the bin folder for Cassandra engine. Double click on the existing PATH system variable.
  6. Click New and add the ‘\bin’ directory of your Cassandra install to the System PATH variable. For example, C:\Cassandra\apache-cassandra-3.11.14\bin. Click OK to finish.

    image3.png

  7. Make sure you have a cassandra-lucene-index-plugin-*.jar installed in your Cassandra Home lib directory (Usually :\Cassandra\apache-cassandra-3.11.14\lib). If you don’t, you can download the .jar file from the official maven repository. We suggest you use cassandra-lucene-index-plugin-3.11.1.0.jar for Cassandra 3.11.14 and then copy the file to the directory.

Now you are ready to start the Cassandra database for the first time. Open a Windows Command Prompt and type `cassandra`.

Once Cassandra is running, open another Windows Command Prompt and type:

cqlsh

You should get the following output:

Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.14 | CQL spec 3.4.4 | Native protocol v4]
 Use HELP for help.
 cqlsh>

To install TestRail, it is necessary to create a Cassandra keyspace. Create one running the following CQL query:

CREATE KEYSPACE IF NOT EXISTS testrail WITH REPLICATION={'class': 'SimpleStrategy', 'replication_factor': 1};

Next, you need to create the ‘cassandra’ service. Create a ‘\daemon’ subdirectory in your cassandra’s '\bin' directory (usually C:\Cassandra\apache-cassandra-3.11.14\bin\).

Download the files at https://downloads.apache.org/commons/daemon/binaries/windows/commons-daemon-1.3.3-bin-windows.zip and extract them.

The 'prunsrv.exe' executable is available in 2 different versions for different architectures. The version in the top-level directory is for 32-bit (x86) architectures. The lower level directories are for AMD/EMT 64-bit systems. Copy the appropriate ‘prunsrv.exe’ file into the newly created '\daemon' folder.

Run the command prompt and change directory to the 'cassandra\bin' directory. Create the service by typing 'cassandra.bat -install'.

Run services.msc and start the cassandra service manually. If the service fails to start, right click the service and click Properties. In the Log On tab, change the value of Log on as: to 'Local System account' and click OK. Start the service.

image9.png

This installation of Cassandra uses ‘cassandra’ as user and ‘cassandra’ as password. If you do not wish to change these credentials, restart the Cassandra database service. 

If you wish to create a new user, you must edit the cassandra.yaml file found inside the conf folder (usually C:\Cassandra\apache-cassandra-3.11.14\conf).

Then, edit the file by making changes to the authenticator and authorizer directives. Comment the line authenticator: AllowAllAuthenticator and add the following line, so it looks like this:

#authenticator: AllowAllAuthenticator
authenticator: org.apache.cassandra.auth.PasswordAuthenticator

Next comment the line authorizer: AllowAllAuthorizer and add the following line so it looks like this:

#authorizer: AllowAllAuthorizer
authorizer: org.apache.cassandra.auth.CassandraAuthorizer

Finally, restart Cassandra.

Connect to Cassandra using the default username and password:

cqlsh -u cassandra -p cassandra

Then, create a Cassandra TestRail user and password.

cassandra@cqlsh> create user 'username' with password 'password';

Grant all privileges to the TestRail user.

cassandra@cqlsh> GRANT ALL ON KEYSPACE testrail to 'testrail';

You can then exit Cassandra.

Was this article helpful?
0 out of 0 found this helpful