Skip to main content

Quick Installation

Prerequisites

Before you begin using AREX, please ensure that you have installed the following applications:

Docker and Docker Compose.

Installing AREX

Firstly, clone the AREX repository using the git command:

git clone --depth 1 https://github.com/arextest/deployments.git 
cd deployments

Then, start AREX using docker-compose.

# Start
docker-compose up -d
# Stop
docker-compose down -v

Alternatively, you can also start it using Docker Compose 2.0.

# Start
docker compose -f docker-compose-2x.yml up -d
# Stop
docker compose -f docker-compose-2x.yml down -v

Upon completion of the installation, all components including the UI, Services, Database will be automatically installed. There is only one instance of each component, detailed as follows:

InstanceModel Name        Description                                                  
1        Scheduling Service (AREX-Schedule)Used to send replay requests and retrieve all responses for comparison.
1        AREX-APIProvides all API interfaces for the AREX frontend page.
1        Storage Service (AREX-Storage)  Offers functionality for AREX Agent to save recordings and retrieve responses in a Mock manner.
1        AREX UI (AREX)The AREX frontend interface.
1        MongoDBDatabase for data storage and configuration management.      
1        RedisHigh-speed playback cache.                                  

You can check the running status and ports of each service by executing the command docker-compose ps on the host machine running Docker.

[~ deployments]# docker-compose ps   
Name Command State Ports
------------------------------------------------------------------------------------------
arex-front docker-entrypoint.sh node ... Up 0.0.0.0:8088->8080/tcp
arex-mongodb docker-entrypoint.sh --auth Up 0.0.0.0:27017->27017/tcp
arex-redis docker-entrypoint.sh --app ... Up 0.0.0.0:6379->6379/tcp
arex-api catalina.sh run Up 0.0.0.0:8090->8080/tcp
arex-schedule catalina.sh run Up 0.0.0.0:8092->8080/tcp
arex-storage catalina.sh run Up 0.0.0.0:8093→8080/tcp

Commands to check service logs:

docker-compose logs
docker-compose logs arex
docker-compose logs arex-schedule-service // Check Schedule Service logs
docker-compose logs arex-api // Check API Service logs
docker-compose logs arex-storage-service // Check Storage Service logs

Registering the Application

AREX Agent is the core component for implementing service recording and playback. Before conducting playback testing, it is necessary to configure the AREX Agent for the application under test. For more details, see: Registering Application.

AREX Deployment Scenarios

Single AREX Service Deployment Scenario

If the recording and replay environment, that is, the production and test environments, can communicate with each other or there is a tool Zone, then deploy a single AREX service. As shown in the diagram below, data is recorded in the production environment and stored in AREX (MongoDB), and then played back in the test environment.

Single Service

Multi AREX Service Deployment Scenario

If the production and test environments cannot communicate with each other, meaning the recording environment and the replay environment are isolated, and the test environment cannot access the database in the production environment, then it is necessary to deploy multiple AREX services.

Multi-Service

Deployment Modes

  1. Deploy AREX A in the production environment to record data, which is then stored in AREX (MongoDB).
  2. Deploy AREX B in the test environment for data playback.
  3. The DBA should unidirectionally synchronize database data from AREX A to AREX B.
  4. Record data with the application in the AREX A environment, and perform playback with the application in the AREX B environment.

Version Upgrade and Update

When starting AREX with Docker Compose, you can check the current version in the environment variable file .env under the deployments repository. If you need to use a previous version, you can directly modify the AREX_VERSION in this file.

Go to the directory where docker-compose.yml is located and stop the original service before updating:

cd deployments 
docker-compose down -v

Note: If you do not wish to retain the existing MongoDB data or logs, manually delete the arex-data and arex-logs directories in the current running directory (please be cautious, as this action cannot be reversed!)

Update the deployments repository and restart AREX:

git pull 
docker-compose up -d

Multi-instance installation

Above we demonstrate how to install all AREX components including AREX UI, services, database by using the docker-compose.yml file provided by AREX.

If you want to install multiple instances according to your needs, you can use the provided docker-compose-distribute.yml file for a simple Out-of-the-box setup. Run the following command:

git clone https://github.com/arextest/deployments.git 
cd deployments
docker-compose -f docker-compose-distribute.yml up -d
# Stopping command
docker-compose -f docker-compose-distribute.yml down -v

# List running containers and their status
docker-compose -f docker-compose-distribute.yml ps

The default setup of the scheduling and storage service involves 2 instances, with the following specific components:

The default configuration of the scheduling service and storage service is 2 instances, with specific component instances as follows:

IDNumber of InstanceModel NameDescription
12Schedule ServiceA set of schedule APIs that provide replay send and retrieve all responses for comparison.
21API ServiceProvides all the interfaces that AREX-Front needs to use.
32Storage ServiceA set of remote storage APIs that provide Agent Hook Service to save records and get responses as mocks.
41AREX-FrontA visual web site that provide entry to all operations in your AREX.
51MongoDBData storage and configuration management database
61RedisHigh-speed playback cache
71NginxSchedule Load Balancing Services
81NginxStorage Load Balancing Services

You can modify the docker-compose-distribute.yml configuration file to deploy multiple instances of the AREX service according to your needs.