In this article, you will learn how to install Cassandra-web on CentOS 8. #centlinux #linux #cassandra
Cassandra Web is a web interface to Apache Cassandra with AngularJS and server-sent events. Cassandra Web is free and open source and its source is available at GitHub.
Cassandra Web is very simple application with limited features, but it fulfills the purpose of monitoring of complete Apache Cassandra cluster via a single web interface.
Recommended Online Training: Learn Bash Shell in Linux for Beginners
Although it is not necessary to install Cassandra Web on a Apache Cassandra node. But for the sake of simplicity, we are installing the Cassandra Web on the same machine, on which you have installed Apache Cassandra.
You are required Rubygems package manager to install Cassandra Web on Linux. Therefore, install the Ruby on CentOS 8 with related packages by using dnf command.
# dnf install -y rubygems ruby-devel
To install Cassandra Web by using rubygems, you need the make and compilation packages. You can install all the required packages by using a single dnf command.
# dnf install -y make gcc gcc-c++ redhat-rpm-config
Now, you are ready to install Cassandra-web interface. You can execute the following gem command to install it on our Linux server.
# gem install cassandra-web Building native extensions. This could take a while... Successfully installed eventmachine-1.2.7 Fetching: thin-1.7.2.gem (100%) Building native extensions. This could take a while... Successfully installed thin-1.7.2 Fetching: ione-1.2.4.gem (100%) Successfully installed ione-1.2.4 Fetching: cassandra-driver-3.2.4.gem (100%) Building native extensions. This could take a while... Successfully installed cassandra-driver-3.2.4 Fetching: cassandra-web-0.5.0.gem (100%) Successfully installed cassandra-web-0.5.0 5 gems installed
Ruby Bundler gem is also required by the web user interface. Install it by executing gem command.
# gem install bundler Fetching: bundler-2.1.4.gem (100%) Successfully installed bundler-2.1.4 1 gem installed
Cassandra-web interface runs at default port 3000/tcp. Therefore, you have to allow incoming traffic through this port in Linux firewall.
# firewall-cmd --permanent --add-port=3000/tcp success # firewall-cmd --reload success
To access the Apache Cassandra nodes, Web interface requires an Admin user.
Create a database user for this purpose as follows.
# cqlsh -u ahmer -p Ahmer@1234 Connected to Test Cluster at 127.0.0.1:9042. [cqlsh 5.0.1 | Cassandra 3.11.7 | CQL spec 3.4.4 | Native protocol v4] Use HELP for help. ahmer@cqlsh> CREATE ROLE cassweb WITH PASSWORD = 'Cassweb@1234' AND SUPERUSER = true AND LOGIN = true; ahmer@cqlsh> exit
Start the Cassandra-web interface by using the following command syntax.
If you have running the Apache Cassandra database on another node then you have to change the hosts address from the following command according to your environment.
# cassandra-web --hosts '127.0.0.1' --port '9042' --username 'cassweb' --password 'Cassweb@1234' I, [2020-08-01T13:14:42.011519 #52137] INFO -- : Establishing control connection I, [2020-08-01T13:14:42.131120 #52137] INFO -- : Refreshing connected host's metadata I, [2020-08-01T13:14:42.171751 #52137] INFO -- : Completed refreshing connected host's metadata I, [2020-08-01T13:14:42.173263 #52137] INFO -- : Refreshing peers metadata I, [2020-08-01T13:14:42.176922 #52137] INFO -- : Completed refreshing peers metadata I, [2020-08-01T13:14:42.177016 #52137] INFO -- : Refreshing schema I, [2020-08-01T13:14:42.284935 #52137] INFO -- : Schema refreshed I, [2020-08-01T13:14:42.285016 #52137] INFO -- : Control connection established I, [2020-08-01T13:14:42.285665 #52137] INFO -- : Creating session I, [2020-08-01T13:14:42.556420 #52137] INFO -- : Session created Thin web server (v1.7.2 codename Bachmanity) Maximum connections set to 1024 Listening on 0.0.0.0:3000, CTRL+C to stop
Open URL http://cassandra-01.centlinux.com:3000 in a web browser e.g Google Chrome.
Cassandra-web does not provide any user authentication. However, you can configure HTTP basic authentication to control access to Cassandra-web interface.
Click on system_schema.
Cassandra-web interface is working fine.
To automate startup of Cassandra-web application, you can create a simple Systemd service.
Create a Systemd service file for Cassandra-web by using vim text editor.
# vi /usr/lib/systemd/system/cassweb.service
Add following lines of code therein.
[Unit] Description=Cassandra Web [Service] Type=simple ExecStart=cassandra-web --hosts '127.0.0.1' --port '9042' --username 'cassweb' --password 'Cassweb@1234' [Install] WantedBy=multi-user.target
Enable and start Cassandra-web Service.
# systemctl enable --now cassweb.service Created symlink /etc/systemd/system/multi-user.target.wants/cassweb.service â /usr/lib/systemd/system/cassweb.service.
Cassandra Web service has been started.
In this article, you have learned, how to install Cassandra-web on CentOS 8. Cassandra: The Definitive Guide: Distributed Data at Web Scale 2nd Edition (PAID LINK) by Jeff Carpenter is a very good book and we strongly recommend that you should read it.
Puppy Linux is a fast, lightweight OS designed for speed and simplicity, perfect for old…
Learn how to change Apache document root in Linux by following this step-by-step guide. Adjust…
Discover how to change Apache port in Linux easily. Follow our simple guide to modify…
Learn how to create a virtual host in Apache Server with this comprehensive guide. Set…
Discover 10 practical tasks for the RHCSA exam with step-by-step solutions. Boost your Linux skills…
Discover the ultimate Fail2ban configuration guide. Learn how to set up, customize, and optimize Fail2ban…
This website uses cookies.