Clone Node Installation

What is Clone Node?

A clone node is a MockMotor node without a UI (“headless”) that synchronizes the configuration from the admin in near-realtime.

You can increase the capacity of a MockMotor installation by adding more clone nodes on additional hardware.

Each clone node listens on the same ports as the admin (but on a different hostname). By load-balancing the requests to those extra clone nodes, you can support load tests with much higher TPS and volumes.

A clone must be able to connect to the admin’s clustered port (7082 by default) over TCP.

Downloading the Package from Admin

The clone package is obtained from admin’s clone download URL.

From the planned clone work directory, execute:

curl -k http://ADMIN_HOST:PORT/console/clone | tar xvz

Here ADMIN_HOST:PORT is the location of your MockMotor admin UI.

For example, if you access MockMotor at https://mockmotor.internal.co:7081/console, the download URL will be https://mockmotor.internal.co:7081/console/clone.

After unpacking, the working directory will contain the admin instance files:

mm@mmtest:/home/mockmotor$ ls -l
total 88572
-rw-r--r--  1 mm   mm        283 Jan 24 00:46 mockmotor.config.xml.template
-rw-r--r--  1 mm   mm   90320560 Jan 24 00:46 mockmotor.jar
-rwxr-xr-x  1 mm   mm       1759 Jan 24 00:46 startMockMotor.sh
-rwxr-xr-x  1 mm   mm         85 Jan 24 00:46 stopMockMotor.sh
-rwxr-xr-x  1 mm   mm        166 Jan 24 00:46 updateMockMotorClone.sh

Default Configuration

The mockmotor.config.xml.template is the MockMotor configuration template that contains settings that permits the clone to connect to the admin server.

<config xmlns="http://mockmotor.com/config">
    <clusterPort>7082</clusterPort>
    <parentHost>mockmotor.internal.co</parentHost>
    <parentPort>7082</parentPort>
</config>

The configuration template sets:

The source port for cluster communications is 7082.
The parent (admin) host for cluster communications is the admin hostname.
The parent (admin) port for cluster communications is 7082.

Private Key Password

If the admin MockMotor configured to use a custom certificate and private key for HTTPS port, the clone instances are using the same certificate.

However, if the private key has a password, that password is NOT sent in the configuration template for security reasons. Anyone inside the network can call the /console/clone URL on admin, and MockMotor can’t send the password with the clone package to everyone and their aunt.

Instead, the admin must enter the private key password into the clone’s configuration file mockmotor.config.xml manually before starting the clone:

<config xmlns="http://mockmotor.com/config">
    ...
    <pem>[PRIVATE KEY HERE]</pem>
    <pemPassword>[ENTER PEM PASSWORD HERE]</pemPassword>
</config>