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:
-
In NexJ Studio, in the Deployment layer's Environment tab, open the environment file for the current deployment.
-
In the Overview tab, ensure that Type is set to Generic.
-
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\modeld2
1
Remote
\\hostname\nexj\modeld\{node1,node2}
or
\\hostname\nexj\modeld\node1,\\hostname\nexj\modeld\node22
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/modeld2
1
Remote
ssh://hostname/opt/nexj/modeld/{node1,node2}
or
ssh://hostname/opt/nexj/modeld/node1,ssh://hostname/opt/nexj/modeld/node22
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.
-
If you are deploying a Model Server cluster, on the Clustering/Session tab, select the Distributed (Enable Clustering) checkbox.
-
Save the updated environment file.
-
If using SSH, do the following:
-
Click Window > Preferences . The Preferences dialog opens.
-
Click NexJ Studio > Remote Deployment > SSH .
-
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.
-
In the Personal key field, do one of the following:
-
If basic authentication is enabled in the environment file, select the Use password from the .server file (basic authentication) .
-
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.
-
-
-
Copy the appropriate database driver, such as
jtds-1.2.2-9.jarorojdbc14.jar, to your project'slibdirectory. -
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.jarorojdbc14.jar, to the<SERVER_HOME>\jvmdirectory 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/extfolder . 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