Working version 25.11 25.08 25.05 25.02 24.11 23.11 Cloud Enterprise
Working version 25.11 25.08 25.05 25.02 24.11 23.11 Cloud Enterprise

Deploying Model Server

You can deploy NexJ Model Server to a locally addressable location (somewhere on the network) or to a remote location. You can either use NexJ Studio or the command line to deploy.

When you deploy Model Server , a file is created for each node in the SERVER_HOME  directory. The file specifies the node name . By default, nodes are named node=<node1>, node=<node2>, ..., node=<nodeN> for deployments to multiple locations. You can change a node's value if you want to give the node a meaningful name, for example, report_server. Nodes require a unique name. For more information about NexJ-specific system properties, see Specifying JVM arguments and system properties .

Before you deploy Model Server, you must install any prerequisites as mentioned in Preparing the host machine.

Deploying through NexJ Studio

Use these steps to deploy through NexJ Studio using only an environment file to specify the relevant values. If you want to use environment variables from a properties file, follow the instructions in Specifying environment properties through a properties file.

To deploy Model Server using NexJ Studio:

  1. In NexJ Studio, in the Deployment layer's Environment tab, open the environment file for the current deployment.

  2. In the Overview tab, ensure that Type is set to Generic.

  3. In the Deployment Location field, specify the folder directories or SSH folder directories for all the server nodes. For example, to deploy to two Model Server nodes, specify the directories as follows:

    Operating System

    Nodes

    Servers

    Remote/local deployment

    Example

    Windows

    2

    2

    Remote

    \\hostname1\nexj\modeld,\\hostname2\nexj\modeld

    2

    1

    Remote

    \\hostname\nexj\modeld\{node1,node2}
    or
    \\hostname\nexj\modeld\node1,\\hostname\nexj\modeld\node2

    2

    1

    Local

    D:\nexj\modeld\node1,D:\nexj\modeld\node2
    or
    D:\nexj\modeld\{node1,node2}

    Linux

    2

    2

    Remote

    ssh://hostname1/opt/nexj/modeld,ssh://hostname2/opt/nexj/modeld

    2

    1

    Remote

    ssh://hostname/opt/nexj/modeld/{node1,node2}
    or
    ssh://hostname/opt/nexj/modeld/node1,ssh://hostname/opt/nexj/modeld/node2

    2

    1

    Local

    /opt/nexj/modeld/node1,/opt/nexj/model/node2
    or
    /opt/nexj/modeld/{node1,node2}


    When running two or more nodes on the same server, ensure the port.offset property is specified so ports from different nodes do not conflict with each other. The default offset for the port is relative to the port in the HTTP server URL. For example, if the HTTP server URL is http://host.domain.ext:7080/nexj and the port offset is 100, the JVM will listen to port 7180 for HTTPS traffic.

    For more information about specifying system properties, see Specifying JVM arguments and system properties.


  4. If you are deploying a Model Server cluster, on the Clustering/Session tab, select the Distributed (Enable Clustering) checkbox.

  5. Save the updated environment file.

  6. If using SSH, do the following:

    1. Click  Window  >  Preferences . The  Preferences  dialog opens.

    2. Click  NexJ Studio  > Remote Deployment  >  SSH .

    3. In the  Known hosts file  field, enter the path to the known hosts file. The known hosts file allows  NexJ Studio  to authenticate the server.

    4. In the Personal key  field, do one of the following:

      1. If basic authentication is enabled in the environment file, select the  Use password from the .server file (basic authentication) .

      2. If basic authentication is not enabled in the environment file, in the  Identity file field, enter the path to the private key for the client.

  7. Copy the appropriate database driver, such as jtds-1.2.2-9.jar or ojdbc14.jar, to your project's lib directory.

  8. Click the  Deploy Model  button Unknown Attachment . The server instance or cluster is installed in the directories that you specified. 

    In case the database driver that you copied in the previous step does not get deployed, be sure to copy the appropriate database driver, such as jtds-1.2.2-9.jar or ojdbc14.jar, to the < SERVER_HOME>\jvm directory for each deploy location that you specified earlier in the Deployment Location field. If you are using Java 8 or lower, you can, alternatively, add the database driver to the $JAVA_HOME/jre/lib/ext  folder .  If using SSH, tools such as sftp or scp may be required to copy the database driver. For more information about required database drivers, see Required database drivers in the NexJ CRM Release Notes.


The Model Server instance or cluster is deployed, and a BUILD SUCCESSFUL message displays in the Console.

The deploy directory contains the following directories:

Directory

Contains

bin

modeld.bat, modeld-svc.bat, modeld.sh files

conf

jvm.conf, log4j.properties, modeld.conf files

data/<node>

Persistent data in <node>

jvm

Framework JAR files

log

Log outputs

model

Model JAR files

tmp

Temporary working files

win32-x64

64-bit executable file

win32-x86

32-bit executable file

Deploying using command line

Use these steps to deploy through the command line using only an environment file to specify the relevant values. If you want to use environment variables from a properties file, follow the instructions in Specifying environment properties through a properties file.

Specifying environment properties through a properties file