Installing Multiple Node Servers

This document explains how to install a second node.js server (for scalability purposes) on an existing installation. The additional server shares the same MongoDB repository as the first one.

Note: This procedure describes a Windows installation, but the same principles can be applied to any operating system on which the X3 Web server is usable.

Described below is a typical situation:

Operations on X3ServerA

  1. Open a cmd window.
  2. Go to the Syracuse installation directory, and type the following commands:
    cd syracusecd certs_toolscertgen.bat
  3. Select Create new certificate and private key.
  4. Enter the server name (X3ServerB in our example).
  5. Enter the server name for the tcp connection (X3ServerB in our example).
  6. Enter the validity in days (5000 for example).
  7. Enter the passphrase for the new private key.
  8. Re-enter the passphrase for the new private key.
  9. Enter the passphrase for the private key of the CA certificate.
  10. Enter the port of the Syracuse server where you want to transfer the certificate.
    For example, you can enter 8124 (which will generate an error message because it is not installed yet).
    The following operations will run:
    Generate key pair ...Generate certificate ...Write private key output/testserver.key ...Write certificate output/testserver.crt ...Write public key output/testserver.pem ...Transfer data to xxxserver:8124 ...Cannot connect to xxserver: java.net.UnknownHostException: X3ServerBPress RETURN to continueFinished
  11. Return to your cmd window and type:
    cd output
  12. Make sure x3serverb.crt, x3serverb.key and x3serverb.pem were generated.
  13. Copy x3serverb.pem in the runtime keys subfolder.
  14. Copy x3serverb.crt, x3serverb.key and ca.cacrt on X3ServerB (for example in c:\sage\cert\x3serverb).

Operations on X3ServerB

  1. Start the Syracuse server installation.
  2. Select New installation.
  3. Enter the installation path.
  4. Enter X3ServerA in the Host Name field, and enter the correct port for MongoDB.
    An information message is displayed: This MongoDB is used and already has a database with the name ‘syracuse’ ! Do you want to continue?
  5. Click OK to validate.
  6. Enter X3ServerA in the Host Name field, and enter the correct port for Elasticsearch.
  7. Enter the path where you copied the certificate files (for example in c:\sage\cert, without x3serverb at the end).
    Caution: Make sure you clear Simplified certificates installation for a single server.
  8. Complete the installation process, and check for errors in the logs:
    Server name X3SERVERBError: Nanny already installed Error: Nanny already installedat start (C:\Sage\Syracuse\syracuse\bin\node_modules\syracuse-load\lib\balancer.js:512:12)at __streamline$run (C:\Sage\Syracuse\syracuse\bin\node_modules\streamline\lib\fibers-fast\runtime.js:56:14)
    Disregard this error.
  9. Before executing the next command, make sure X3ServerB is running the same version as X3ServerA.
    If X3ServerA is on version 6 + hotfix, make sure you also install the hotfix on X3ServerB.
  10. Open a cmd window. You must be connected with the account that runs the node.js server.
  11. Go to the Syracuse installation directory and type the following commands:
    cd syracusepassphrase.cmd “passphrase”
    The passphrase for the new private key is the same one you entered when generating the certificate
    You can now connect to your additional server.