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:
- Redis: Prepare the connection string to connect to the Redis database. For example:
redis://redis:6379/
. - MongoDB: Prepare the connection string to connect to MongoDB database. For example:
mongodb://arex:iLoveArex@mongodb:27017/arex_storage_db
. - Java compilation environment: JDK8 or JDK11 is recommended.
- Maven: Version 3.6.3 or above.
- NODEJS: Version 18.16.0 or above.
- Tomcat: Version 9.
Minimum & Recommended Configurations
- 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 IP | Related Service Components | ||
---|---|---|---|
1 | AREX UI | 10.5.1.100 | AREX-API,Storage,Schedule Service |
2 | AREX Storage | 10.5.1.101 | MongoDB,Redis,AREX-API Service |
3 | AREX Schedule | 10.5.1.102 | MongoDB,Redis,Storage,AREX-API Service |
4 | AREX API | 10.5.1.103 | MongoDB,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
- Clone AREX API Service Source Code.
git clone https://github.com/arextest/arex-api.git
- Compile.
cd arex-api
mvn clean package
- Check if the
war
file exists.
ls arex-web-api/target/
- 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
- 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" />
- 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"
- Start Tomcat
Schedule Service
- Clone Schedule Service Source Code.
git clone https://github.com/arextest/arex-replay-schedule.git
- Compile.
mvn clean package
- Check if the
war
file exists.
ls arex-schedule-web-api/target/
- 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
- 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" />
- 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"
- Start Tomcat
Storage Service
- Clone Storage Service Source Code.
git clone https://github.com/arextest/arex-storage.git
- Compile.
mvn clean package
- Check if the
war
file exists.
ls arex-storage-web-api/target/
- 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
- 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" />
- 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"
- Start Tomcat
AREX NODEJS Service Installation
AREX UI Service Installation
- clone AREX UI Service Source Code.
git clone https://github.com/arextest/arex.git
- Compile.
npm install pnpm -g
pnpm install --loglevel verbose
pnpm run build
- 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
- 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.