These instructions describe the installation process on a CentOS 7 system.
The following software packages will be installed first.
- JDK 8 (tested with OpenJDK and Oracle JDK)
- Maven
- Cassandra
- git
Enter the following commands in a terminal session.
-
Install the Maven and JDK packages.
# yum install java-1.8.0-openjdk # yum install maven
-
Install Cassandra.
Make sure that
/etc/yum.repos.d/datastax.repo
contains the following:[datastax] name = DataStax Repo for Apache Cassandra baseurl = http://rpm.datastax.com/community enabled = 1 gpgcheck = 0
Execute the command:
# yum install dsc30
-
Make sure that git is installed.
# yum install git
-
Configure and start Cassandra.
Edit
/etc/cassandra/conf/cassandra.yaml
as follows.- Find the
authenticator
parameter and set it toPasswordAuthenticator
. - Set
authorizer
toCassandraAuthorizer
. - Save the changed file.
Execute this command to start Cassandra:
# service cassandra start
Start the Cassandra shell,
cqlsh
.$ cqlsh -u cassandra -p cassandra
Create a new user:
cassandra@cqlsh> CREATE USER 'test' WITH PASSWORD 'test123' SUPERUSER;
Note: If you'd like to use a different set of credentials, make sure to change the default values in
src/main/resources/application.properties
before building the project.
UseCtrl-D
to leavecqlsh
. - Find the
-
Clone this repo and change the current directory.
$ git clone https://github.com/vboldyrev-test/rsatask $ cd rsatask
-
Build the project.
$ mvn install
-
Run the application.
$ java -jar /target/rsa-task-1.0-SNAPSHOT.jar
Note: By default, Tomcat is configured to listen for HTTP requests on port 8080.
You can use additional command line options
--cassandra.contactPoint
and--cassandra.port
to override the defaults for accessing a remote Cassandra instance.If you want to be able to access the application from the outside, you need to specify a firewall rule with the following command:
# firewall-cmd --zone=public --add-port 8080/tcp --permanent
-
Usage of the application.
Point your browser to
http://localhost:8080
.Note: If you want to use the application from a remote machine, replace
localhost
with the appropriate hostname or IP address.