Best Practice Editing MarkLogic Server Environment Variables
20 July 2020 03:49 PM
In some cases it is required to change the default environment variables of a MarkLogic Server installation or configuration
Making Changes to Defaults
When changes to the default configurations need to be made, we recommend using /etc/marklogic.conf to make those changes. The file will not exist in a default installation, and should be manually created. We recommend the file only contain the variables that are being changed or added. This file will also be unaffected by MarkLogic upgrades.
Note: We do not recommend making changes to /etc/sysconfig/MarkLogic, as this file is part of the MarkLogic installation package, and it may be replaced or changed during a MarkLogic upgrade with no notification. Any direct file customizations will be overwritten and lost, which can result in various problems when the MarkLogic service is restarted.
During startup, MarkLogic will first source it's own environment variable file, and then it will source /etc/marklogic.conf, which ensures the locally defined variables take precedence.
Changing the Default Data Directory
A common use of the /etc/marklogic.conf file is to change the default data directory (/var/opt/MarkLogic).
If that file exists when the server is first initialized, then MarkLogic will run from the custom location. If MarkLogic has already been initialized, then you may need to stop the service and manually move /var/opt/MarkLogic to your custom location.
Using the MarkLogic AMI
When using the MarkLogic AMI, without using the MarkLogic Cloud Formation template, it is necessary to create /etc/marklogic.conf to disable the Managed Cluster feature.
If this is done after the instance is launched, then you may encounter the issue mentioned in the KB SVC_SOCHN Warning During Start Up on AWS.
Common Configurable Variables