Deploying OpenSearch
OpenSearch is the open-source search engine and data store used to run the global search feature in NexJ CRM. You must install and configure OpenSearch before users can search for records across the application.
After installing OpenSearch, you need to integrate in into NexJ CRM. For more information, see Global search integration .
Software requirements for the global search feature
The latest supported version of OpenSearch.
OpenSearch Dashboards. Version associated with the OpenSearch distribution.
OpenJDK. The version of JDK shipped with your release is recommended. To use a different Java installation, set the
OPENSEARCH_JAVA_HOME
orJAVA_HOME
environment variable to the Java install location.
Deployment steps
You may need to install additional software, such as Docker and WSL, to complete the steps.
Install OpenSearch following the detailed steps described in the following topic: Installing OpenSearch - OpenSearch Documentation.
The recommended installation method is using Docker. For more information, see Docker - OpenSearch Documentation.
An alternative installation method for Linux is using a tarball. For more information, see Tarball - OpenSearch Documentation.
Installation on Windows from zip archive files:
Extract the provided archive files
opensearch-2.18.0-windows-x64.zip
andopensearch-dashboards-2.18.0-windows-x64.zip
to the desired folders.An OpenSSL executable is required to generate certificates for running OpenSearch with HTTPS and client certificate authentication. The executable is available from the Windows Subsystem for Linux (WSL) or third party software such as Cygwin.
(Optional) Proceed to test OpenSearch following the instructions at Windows - OpenSearch Documentation - Step 2: (Optional) Test OpenSearch.
Specify the desired minimum and maximum heap sizes in
opensearch-2.18.0\config\jvm.options
. A good starting point is to set both values to half of the available system memory, so set them to 4 GB if the host machine has 8 GB of memory.
Generate the self-signed certificate. For more information, see Generating self-signed certificates - OpenSearch Documentation. This certificate will be used for defining the
es:Elasticsearch
channel in the NexJ CRM environment file. When using the sample script described in the topic, in the “client cert” section, ensure that the value for CN isnexjesadmin
and the value for subjectAltName isDNS:nexjesadmin
. The sample script needs to be modified to run on Windows as a batch script. For example, change#
toREM
, remove the quotes around the string argument to theecho
command, changerm
todel
.For use on NexJ Model Server, the certificate must be in PKCS12 Base64 format. After running the sample script, run the following commands to generate the client certificate in that format. Enter a client certificate password when prompted and save it for future reference, as it will be needed when configuring the Elasticsearch channel in NexJ Studio.
BASHopenssl pkcs12 -export -in client.pem -inkey client-key.pem -out client.pfx -name client openssl base64 -in client.pfx -out client-base64.pfx
Enable client authentication following the instructions in Client certificate authentication - OpenSearch Documentation.
In
opensearch-<version>/config/opensearch.yml
, set the following to require client certificate authentication mode:plugins.security.ssl.http.clientauth_mode: REQUIRE
When updating
opensearch-<version>/config/opensearch.yml
for certificate settings, ensure the CN references the same names used during generation of the client certificate. Applicable settings includeplugins.security.authcz.admin_dn
andplugins.security.nodes_dn
.To enable auditing, follow the instructions included in Audit logs - OpenSearch Documentation.
Start the OpenSearch server and confirm that it starts up successfully.
Map the NexJ admin user to a role with admin access through the security configuration file. In the
roles_mapping.yml
file, under theall_access
role, add:users: - "nexjesadmin"
As detailed in https://opensearch.org/docs/latest/security/configuration/security-admin/, run the following command from
opensearch-<version>
to initialize the security indexes (on Windows runsecurityadmin.bat
instead):BASHcd ./plugins/opensearch-security/tools ./securityadmin.sh -cd ../../../config/opensearch-security/ -icl -nhnv -cacert ../../../config/root-ca.pem -cert ../../../config/admin.pem -key ../../../config/admin-key.pem
Restart the node for the security changes to take effect.
Follow the instructions for installing OpenSearch Dashboards at https://opensearch.org/docs/latest/install-and-configure/install-dashboards/index/.