EEV

EEV Demo Setup

1. Infrastructure Setup

1.1 Node Installation

Server Configuration: The cluster consists of three nodes, installed on server1.

  • Hardware Requirements:

    • CPU: 2
    • Memory: 8GB
    • Disk: 128GB
  • Operating System: Ubuntu-22.04

  • IP: 172.21.0.46

Step-1: Create node-1 using below command.

sudo virt-install \
  --name eev-in-demo1a-node01 \
  --os-variant ubuntu22.04 \
  --vcpus 2 \
  --memory 8192 \
  --location /data1/os-iso/ubuntu-22.04.4-live-server-amd64.iso,kernel=casper/vmlinuz,initrd=casper/initrd \
  --network bridge=virbr20,model=virtio,mac=00a:01:e1:20:02:01 \
  --network network=virho10,model=virtio,mac=0a:01:e1:10:02:01 \
  --disk size=128,pool=adm-images \
  --uuid 00000000-0000-0000-0000-0a01e1200201 \
  --graphics none \
  --extra-args 'console=ttyS0' \
  --debug

Step-2: Disk partition for the node.

  • /: 22 GB
  • /boot: 1 GB
  • SWAP: 5 GB
  • /data: 100 GB

Step-3: User Setup

  • Full Name: Devops Admin sayukth
  • Server Name: eev-in-demo1a-node01
  • User: devopsadmin
  • Password: <1!Devxxxx>

Note:

  • Select the SSH server option during the installation process.
  • Add User to Sudoers: Use visudo to add the following line at the end of the file:
    devopsadmin ALL=(ALL) NOPASSWD: ALL
    
  • Make static the IP address of this node through winbox.

1.2. Tech Stack Installation

1. Clone the GitHub Repository

Execute the following command to clone the repository containing the automation scripts:

git clone https://github.com/DevOps-Model/DevOps-Automation-Scripts.git

2. Navigate to the Repository

Change directory to the cloned repository:

cd DevOps-Automation-Scripts

3. Navigate to the eevConfigurationFiles Folder

Inside the repository, navigate to the eevConfigurationFiles folder:

cd eevConfigurationFiles

4. Modify Configuration Files

Make the necessary changes to the configuration files according to the project requirements. The files to be updated are:


4.1 install.conf

Edit the install.conf file and set the following values:

hostname = eev-in-demo1a-node01
tomcatServiceFileName = tomcat
tomcatListenPort = 8182
tomcatServiceFilePath = /etc/systemd/system/tomcat.service
tomcatBaseInstallationPath = /opt/eev/tomcat/

Command to edit the file:

vi install.conf

4.2 configuration.conf

Edit the configuration.conf file and set the following values:

mysqlNodeName=eev-in-demo1a-node01
wsrepClusterAddress=eev-in-demo1a-pxc01
wsrepClusterName=eev-in-demo1a-pxc01
wsrepNodeName=eev-in-demo1a-pxc01
redpandaHostName=eev-in-demo1a-ms-node01
scyllaHostName=eev-in-demo1a-sdc-node01
scyllaClusterName=eev-in-demo1a-ds-sdc
scyllaListenAddress=eev-in-demo1a-node01
scyllaClusterClusterRackdc=eev-in-demo1a-ds-sdc-rack01
nodeHostname=eev-in-demo1a-node01
scyllaDc=eev-in-demo1a-ds-sdc
scyllaRack=eev-in-demo1a-ds-sdc-rack01

Command to edit the file:

vi configuration.conf

4.3 databases.conf

Edit the databases.conf file and set the following values:

mysqlHostname=eev-in-demo1a-pxc-node01
mysqlDb=eldb_demo
qrtzDb=qrtz_eldb_demo
mysqlUserFile=/tmp/demo-resources-conf/resources/db/schema/demo/el_demo_user.sql
mysqlSchema=/tmp/demo-resources-conf/resources/db/schema/common/el_schema.sql
mysqlBaseData=/tmp/demo-resources-conf/resources/db/schema/common/el_base_data.sql
qrtzDemoUser=/tmp/demo-resources-conf/resources/db/schema/demo/qrtz_demo_user.sql
qrtzSchemas=/tmp/demo-resources-conf/resources/db/schema/common/qrtz_schema.sql
scyllaHostname=eev-in-demo1a-node01
scyllaDb=el_blob_demo
scyllaHostIp=eev-in-demo1a-sdc-node01
cqlPort=9042
cqlUserFile=/tmp/demo-resources-conf/resources/ds/schema/demo/el_demo_user.cql
cqlSchemaFile=/tmp/demo-resources-conf/resources/ds/schema/common/el_schema.cql

Command to edit the file:

vi databases.conf

5. Navigate Back to the Base Folder

After making the necessary changes, go back to the base folder:

cd ..

6. Run the TechStackInstallation Script

Execute the TechStackInstallation.py script to install the required tech stack:

python3 TechStackInstallation.py eev java tomcat git scylla redpanda mysql

7. Configure the Services

After installing the tech stack, configure the services using the following command:

python3 ConfigureScript.py eev configuration

8. Run Base Data

Once the services are configured, run the following command to initialize the base data:

python3 ConfigureScript.py eev

Finally, the tech stack is completely installed, configured, and initialized with the base data.

After the tech stack installation there is a small configuration change in the tomcat service i.e add CLASS_PATH of conf folder in catalina.sh file. we need add “$CATALINA_HOME/conf” in the below mentioned path

# Add on extra jar files to CLASSPATH
if [ ! -z "$CLASSPATH" ] ; then
  CLASSPATH="$CLASSPATH":
fi
CLASSPATH="$CLASSPATH""$CATALINA_HOME"/bin/bootstrap.jar:$CATALINA_HOME/log4j2/lib/*:$CATALINA_HOME/log4j2/conf:$CATALINA_HOME/conf

1.3 Hardening the Node

  1. Go to the Hardening folder inside the repository:
cd DevOps-Automation-Scripts/Hardening
  1. Execute the script to harden the node:
bash ubuntu.sh
  1. If you want to verify the hardening score, run the following command:
bash checkScore.sh
  1. To increase the hardening score, refer to the below documentation

2. Deployment of the application

  • Deployment of the application is automated through pipeline
  1. Webapp Source Code Checkout
    • Agent: Runs on a node labeled devops-node. Purpose: Ensures that the required repositories (eev-webserver, eev-devops, eev-webapp) exist in the workspace.
  2. After successful builds and tests, the pipeline would package the application using Maven or another build tool.
    • In eev-webserver
    /opt/maven/bin/mvn install package -DskipTests=true -Dtestng.dtd.http=true -Dsonar.skip=true -Dsnyk.skip=true
    Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/data/jenkins/java-tmp-dir
    
    • In eev-devops
    /opt/maven/bin/mvn clean install
    Picked up _JAVA_OPTIONS: -Djava.io.tmpdir=/data/jenkins/java-tmp-dir
    
    Also run devops conf file “com.merusphere.eev.webapp.conf.gen.demo.WebAppConfigGeneratorDemo”
  3. Executes deployment scripts or copies build artifacts (e.g., .jar, .war, or .zip files) to the target location.
    • Contains .war file, mysql and scylla file , few configuration files
    /tmp/demo-resources-conf
    
    • Contains the tomcat configuration files
    /tmp/demo-tomcat-conf/demo
    
  4. Run the mysql and scylla(.sql and .cql) based on the database version
  5. Place .war file and conf files in the catalina home path and restart tomcat service