Skip to main content

Non-Containerized Deployment

Introduction

This tutorial will demonstrate the non-containerized deployment of AREX.

Prerequisites

Before installing AREX, please make sure that the following prerequisites are in place:

  1. Redis: Prepare the connection string to connect to the Redis database. For example: redis://redis:6379/.
  2. MongoDB: Prepare the connection string to connect to MongoDB database. For example: mongodb://arex:iLoveArex@mongodb:27017/arex_storage_db.
  3. Java compilation environment: JDK8 or JDK11 is recommended.
  4. Maven: Version 3.6.3 or above.
  5. NODEJS: Version 18.16.0 or above.
  6. Tomcat: Version 9.
  • AREX UI Service: 1 core 1G RAM
  • AREX Storage Service: 2 cores 3G RAM
  • AREX Schedule Service: 2 cores 4G RAM
  • AREX API service: 2 cores 6G RAM
YOUR local IPRelated Service Components
1AREX UI10.5.1.100AREX-API,Storage,Schedule Service
2AREX Storage10.5.1.101MongoDB,Redis,AREX-API Service
3AREX Schedule10.5.1.102MongoDB,Redis,Storage,AREX-API Service
4AREX API10.5.1.103MongoDB,Redis,Storage Service,Front Service

Common Steps to Install a Java Application

  • Step 1: Install Java 8 or 11.
  • Step 2: Install Apache Tomcat server as an application server for AREX.
  • Step 3: Download the AREX source code and compile it into arex-some-components-service.war file.
  • Step 4: Copy the arex-some-components-service.war file to the webapps directory of Apache Tomcat.
  • Step 5: Start Apache Tomcat.
  • Step 6: Check whether Tomcat is running properly on URL http://localhost:8080.
  • Step 7: Start AREX from Apache Tomcat and get started.

Compile and Install AREX from Source

You need to compile and install AREX API service, Storage service, Schedule service, and finally the UI(nodejs) service individually.

API Service

  1. Clone AREX API Service Source Code.
git clone https://github.com/arextest/arex-api.git
  1. Compile.
cd arex-api
mvn clean package
  1. Check if the war file exists.
ls arex-web-api/target/ 
  1. Run the following command to copy arex-platform-web-service.war to the webapps directory of Tomcat.
cp arex-report/arex-api/target/arex-platform-web-service.war /usr/local/tomcat/webapps
  1. Edit server.xml with vim and save it.
<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true">

Add labels as key/value string pairs to the deployment of arex-platform-web-service as shown below, where the path indicates the URL path, the docBase indicates the path where located the war package, and the reloadable indicates hot reloading is supported or not.

<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="arex-platform-web-service" reloadable="true" />
  1. Set Environment Variables
export JAVA_OPTS="-Darex.mongo.uri=mongodb://arex:iLoveArex@mongodb:27017/arex_storage_db  -Darex.redis.uri=redis://redis:6379/  -Darex.storage.service.url=http://10.5.1.101 -Darex.ui.url=http://10.5.1.100"
  1. Start Tomcat

Schedule Service

  1. Clone Schedule Service Source Code.
git clone https://github.com/arextest/arex-replay-schedule.git
  1. Compile.
mvn clean package
  1. Check if the war file exists.
ls arex-schedule-web-api/target/ 
  1. Run the following command to copy arex-schedule-web-api.war to the webapps directory of Tomcat.
cp arex-schedule-web-api/target/arex-schedule-web-api.war /usr/local/tomcat/webapps
  1. Edit server.xml with vim and save it.
<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true">

Add labels as key/value string pairs to the deployment of arex-schedule-web-api.war, as shown below.

<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="arex-schedule-web-api.war" reloadable="true" />
  1. Set Environment Variables
export JAVA_OPTS="-Darex.mongo.uri=mongodb://arex:iLoveArex@mongodb:27017/arex_storage_db  -Darex.redis.uri=redis://redis:6379/  -Darex.storage.service.url=http://10.5.1.101 -Darex.api.service.api=http://10.5.1.103"
  1. Start Tomcat

Storage Service

  1. Clone Storage Service Source Code.
git clone https://github.com/arextest/arex-storage.git
  1. Compile.
mvn clean package
  1. Check if the war file exists.
ls arex-storage-web-api/target/ 
  1. Run the following command to copy arex-storage-web-api.war to the webapps directory of Tomcat.
cp arex-storage/arex-storage-web-api/target/arex-storage-web-api.war  /usr/local/tomcat/webapps
  1. Edit server.xml with vim and save it.
<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true">

Add labels as key/value string pairs to the deployment of arex-storage-web-api.war as shown below.

<Host name="localhost"  appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Context path="" docBase="arex-storage-web-api" reloadable="true" />
  1. Set Environment Variables
export JAVA_OPTS="-Darex.mongo.uri=mongodb://arex:iLoveArex@mongodb:27017/arex_storage_db  -Darex.redis.uri=redis://redis:6379/   -Darex.api.service.api=http://10.5.153.103"
  1. Start Tomcat

AREX NODEJS Service Installation

AREX UI Service Installation

  1. clone AREX UI Service Source Code.
git clone https://github.com/arextest/arex.git
  1. Compile.
npm install pnpm -g
pnpm install --loglevel verbose
pnpm run build
  1. Set Environment Variables.
export SERVICE_API_URL=http://10.5.1.103 SERVICE_SCHEDULE_URL=http://10.5.1.102 SERVICE_STORAGE_URL=http://10.5.1.101
  1. Start NODEJS Service.
node packages/arex/server.js

Now, all AREX services have been installed and can be used by accessing the AREX UI service (http://10.5.1.100) in browsers.