CI Cache and Queue Setup
  • 24 Jun 2024
  • 2 Minutes to read
  • Dark
    Light
  • PDF

CI Cache and Queue Setup

  • Dark
    Light
  • PDF

Article summary

Overview

In this document we will see how to set up the Cross Identity’s Cache system.

Cache Server – Installation

HazelCast is a caching server where you can set up an independent server.

Note:

As per the architecture finalized, identify the server where the respective component is to be installed and configured.

Pre-requisites:

  1. Server with a sudo non-root user.

  2. If you have a firewall enabled, configure it to allow traffic on the ports used by Hazelcast.

  3. Ensure connectivity between Hazelcast servers and App servers (Tomcat).

  4. Ensure connectivity between hazelcast and database.  

The following are the steps to install standalone Hazelcast server setup:

  1. Download the hazelcast-3.12.8.zip in the /opt directory:

    Information:

    This package will be shared with a document.

  2. List the files using 1s command.

  3. Unzipping the file using unzip hazelcast-3.12.8.zip command.

  4. List the unzipped file using 1s command.

  5. Add the classpath using the following command:

    export CLASSPATH=${CLASSPATH}:${PWD}:hazelcast-3.12.8/lib/hazelcast- 3.12.8.jar

  6. Go to the bin directory /opt/hazelcast-3.12.8/bin/ and edit hazelcast.xml file, search for word dev and change the group name to your environment name onprem (prod, qa, and so on).

    <group>

    <name> dev <name> // change dev to onprem;  

    </group>

  7. Create a log file under /opt directory using the following command:

    cd hazelcast-3.12.8

    mkdir logs

  8. Type ll to display log folder:

  9. Go inside / bin directory and copy the following command:

    bash /opt/hazelcast-3.12.8/bin/start.sh > /opt/hazelcast- 3.12.8/logs/log.txt 2>&1 &

    cd ..

    cd logs

  10. Type ll to display log file:

Start the Hazelcast server using the below command:

./start.sh > /opt/hazelcast-3.12.8/logs/log.txt 2>&1 &

Cache Server – Configuration

  1. Go to MySQL database and perform the database query as follows:

Information:

5701 port is listening, make sure you open 5701-5800 ports between CI and HazelCast Server. Also, in fluidiam_config_properties table update Hazelcast server IP, Groupname and server count.

hazelcast_public_ip1: enter Hazelcast server ip groupName: enter the groupname (onprem, uat, prod etc)

hazelcast_servers_count: 1 (as we are setting up this as standalone)

use CID_databasename;

select * from fluidiam_config_properties;

update fluidiam_config_properties set config_value = <Hazelcast_serverIP> where config_key= ‘hazelcast_public_ip1’;

insert into fluidiam_config_properties (config_key,config_value) values('groupName','onprem');

insert into fluidiam_config_properties (config_key,config_value) VALUES('hazelcast_servers_count','1');

select * from fluidiam_config_properties;

Optional:

If there are more than one Cache node (Hazelcast node), execute the following commands in the same table:

INSERT INTO fluidiam_config_properties (config_key, config_value)

VALUES ('hazelcast_public_ip2', <hazelcast_node2_IP>);

Update the count of servers based on the number of nodes.

UPDATE fluidiam_config_properties

SET config_value = '2'

WHERE config_key = 'hazelcast_servers_count';

Outcome

The expected outcome would be a configured and running Hazelcast caching server integrated with Cross Identity's Cache system.

Operations and Maintenance

  1. To start the Hazelcast server:

    • Navigate to Hazelcast installation directory

    • Start Hazelcast server

         ./start.sh

  2. To stop the Hazelcast server:

    • Navigate to Hazelcast installation directory

    • Start Hazelcast server

      ./stop.sh

  3. Check Hazelcast cluster status:

    • Use Hazelcast Management Center or

    • Connect to Hazelcast instance using a client tool

    • Alternatively, you can use the hazelcast-client script

    • Located in the bin directory to connect to the cluster

        ./hazelcast-client

  4. View Hazelcast logs:

    • Navigate to the logs directory

    • View the Hazelcast log file      

       cat log.txt


Was this article helpful?