How do I change the PID file directory?
Deephaven uses standard Linux PID (Process ID) files, which are stored by default in the directory /etc/deephaven/run
.
This guide demonstrates how to change the PID file location. The examples assume that the new directory is /etc/deephaven/pidfileDir
, so adjust the commands accordingly for the desired directory.
Change the PID file directory
First, stop all Deephaven processes.
sudo -u irisadmin monit stop all
If necessary, create the new PID file directory (pidfileDir
, in this case) and ensure that the new PID file directory is writable by irisadmin:dbmergegrp.
sudo -u irisadmin mkdir /etc/deephaven/pidfileDir
sudo -u irisadmin ls -l /etc/deephaven
sudo -u irisadmin chmod 775 /etc/deephaven/pidfileDir
sudo -u irisadmin touch /etc/deephaven/pidfileDir/testfile
sudo -u irisadmin rm /etc/deephaven/pidfileDir/testfile
Update the host configuration to specify the new PID file directory:
sudo vi /etc/sysconfig/illumon
Add an environment variable to the hostconfig file:
export PIDROOT=/etc/deephaven/pidfileDir
Perform the rest of the steps as irisadmin
.
sudo su - irisadmin
Update the monit files to specify the new location. Some of these files are links (the auth
and conf
ones), and any substitute commands must ensure that the backing files are updated rather than adding or replacing them with new files created in the local directory, or upgrades will remove the changes. For example:
cd /etc/monit.d/deephaven/auth
sed --follow-symlinks -i -e 's+/etc/deephaven/run+/etc/deephaven/pidfileDir+g' *.conf
cd /etc/monit.d/deephaven/config
sed --follow-symlinks -i -e 's+/etc/deephaven/run+/etc/deephaven/pidfileDir+g' *.conf
cd /etc/monit.d/deephaven/service
sed -i -e --follow-symlinks 's+/etc/deephaven/run+/etc/deephaven/pidfileDir+g' *.conf
The sed
commands are editing the files to replace /etc/deephaven/run
with the new path.
Edit iris-environment.prop
to add:
pidFileDirectory=/etc/deephaven/pidfileDir
To edit a properties file you will need to export the file, make edits, and import the changed file. The example below uses an arbitrary directory (/tmp/propfiles
):
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig properties export iris-environment.prop --directory /tmp/propfiles --etcd
vi /tmp/propfiles/iris-environment.prop
sudo -u irisadmin /usr/illumon/latest/bin/dhconfig properties import /tmp/propfiles/iris-environment.prop --etcd
Reload monit’s configuration and restart it.
monit reload
monit start all