7321N/A<?
xml version="1.0" encoding="UTF-8"?>
7321N/A ! This work is licensed under the Creative Commons 7321N/A ! Attribution-NonCommercial-NoDerivs 3.0 Unported License. 7321N/A ! To view a copy of this license, visit 7321N/A ! or send a letter to Creative Commons, 444 Castro Street, 7321N/A ! Suite 900, Mountain View, California, 94041, USA. 7321N/A ! You can also obtain a copy of the license at 7321N/A ! See the License for the specific language governing permissions 7321N/A ! and limitations under the License. 7321N/A ! If applicable, add the following below this CCPL HEADER, with the fields 7321N/A ! enclosed by brackets "[]" replaced with your own identifying information: 7321N/A ! Portions Copyright [yyyy] [name of copyright owner] 7321N/A ! Copyright 2011-2015 ForgeRock AS. 7321N/A<
chapter xml:
id='chap-server-process' 7321N/A <
title>Managing Server Processes</
title>
7321N/A <
para>Using the OpenDJ Control Panel, you can start and stop local servers.
7321N/A You can also start and stop OpenDJ using command-line tools, and use the
7321N/A operating system's capabilities for starting OpenDJ at boot time.</
para>
7321N/A <
para>This chapter demonstrates how to start and stop server processes
7321N/A with command line tools and using operating system capabilities. This
7321N/A chapter also describes what OpenDJ directory server does during startup
7321N/A and shutdown, and how it recovers following an abrupt shutdown such as
7321N/A happens during a system crash or when you kill the server process using
7321N/A <
section xml:
id="start-server">
7321N/A <
title>Starting a Server</
title>
7321N/A <
indexterm><
primary>Start server</
primary></
indexterm>
7321N/A <
para>Use one of the following techniques.</
para>
7321N/A xlink:
href="reference#start-ds-1" 7321N/A ><
command>start-ds</
command></
link> command.
7321N/A$ <
userinput>start-ds</
userinput>
7321N/A Alternatively, you can specify the <
option>--no-detach</
option>
7321N/A option to start the server in the foreground.
7321N/A <
para>(Linux) If OpenDJ directory server was installed from a .deb or .rpm
7321N/A package, then service management scripts were created at setup time.</
para>
7321N/A <
para>Use the <
command>service opendj start</
command> command.</
para>
7321N/Acentos# <
userinput>service opendj start</
userinput>
7321N/A<
computeroutput>Starting opendj (via systemctl): [ OK ]</
computeroutput>
7321N/Aubuntu$ <
userinput>sudo service opendj start</
userinput>
7321N/A<
computeroutput>$Starting opendj: > SUCCESS.</
computeroutput>
7321N/A (UNIX) Create an RC script by using the
7321N/A xlink:
href="reference#create-rc-script-1" 7321N/A ><
command>create-rc-script</
command></
link> command,
7321N/A and then use the script to start the server.
7321N/A <
para>Unless you run OpenDJ as root, use the --userName
7321N/A <
replaceable>userName</
replaceable> option to specify the user
7321N/A who installed OpenDJ.</
para>
$ <
userinput>sudo create-rc-script \
--userName mark</
userinput>
<
para>For example, on Linux if you run OpenDJ as root, you can use the
RC script to start the server at system boot, and stop the server at
$ <
userinput>sudo
update-rc.d opendj defaults</
userinput>
(Windows) Register OpenDJ as a Windows Service by using the
xlink:
href="reference#windows-service" ><
command>windows-service</
command></
link> command,
and then manage the service through Windows administration tools.
<
para>By default OpenDJ saves a compressed version of the server
configuration used on successful startup. This ensures that the server
provides a "last known good" configuration, which can be used as a reference
or copied into the active configuration if the server fails to start with the
current active configuration. It is possible, though not usually recommended,
to turn this behavior off by changing the global server setting
<
literal>save-config-on-successful-startup</
literal> to
<
literal>false</
literal>.</
para>
<
section xml:
id="stop-server">
<
title>Stopping a Server</
title>
<
indexterm><
primary>Stop server</
primary></
indexterm>
<
para>Use one of the following techniques.</
para>
xlink:
href="reference#stop-ds-1" ><
command>stop-ds</
command></
link> command.
<
screen>$ stop-ds</
screen>
<
para>(Linux) If OpenDJ directory server was installed from a .deb or .rpm
package, then service management scripts were created at setup time.</
para>
<
para>Use the <
command>service opendj stop</
command> command.</
para>
centos# <
userinput>service opendj stop</
userinput>
<
computeroutput>Stopping opendj (via systemctl): [ OK ]</
computeroutput>
ubuntu$ <
userinput>sudo service opendj stop</
userinput>
<
computeroutput>$Stopping opendj: ... > SUCCESS.</
computeroutput>
<
para>(UNIX) Create an RC script, and then use the script to stop
$ <
userinput>sudo create-rc-script \
--userName mark</
userinput>
<
para>(Windows) Register OpenDJ as a Windows Service, and then manage
the service through Windows administration tools.</
para>
<
section xml:
id="restart-server">
<
title>Restarting a Server</
title>
<
indexterm><
primary>Restart server</
primary></
indexterm>
<
para>Use one of the following techniques.</
para>
<
para>Use the <
command>stop-ds</
command> command.</
para>
$ <
userinput>stop-ds --restart</
userinput>
<
para>(Linux) If OpenDJ directory server was installed from a .deb or .rpm
package, then service management scripts were created at setup time.</
para>
<
para>Use the <
command>service opendj restart</
command> command.</
para>
centos# <
userinput>service opendj restart</
userinput>
<
computeroutput>Restarting opendj (via systemctl): [ OK ]</
computeroutput>
ubuntu$ <
userinput>sudo service opendj restart</
userinput>
<
computeroutput>$Stopping opendj: ... > SUCCESS.
$Starting opendj: > SUCCESS.</
computeroutput>
<
para>(UNIX) Create an RC script, and then use the script to stop
$ <
userinput>sudo create-rc-script \
--userName mark</
userinput>
<
para>(Windows) Register OpenDJ as a Windows Service, and then manage
the service through Windows administration tools.</
para>
<
section xml:
id="crash-recovery">
<
title>Server Recovery</
title>
<
primary>Replication</
primary>
<
secondary>Crash recovery</
secondary>
<
para>OpenDJ tends to show resilience when restarting after a crash or after
the server process is killed abruptly. OpenDJ might have to replay the last
few entries in a transaction log. Generally OpenDJ returns to service
<
para>You can find Berkeley Java Edition database recovery messages in the
database log file, such as
shows two example messages from that log, the first written at the beginning
of the recovery process, the second written at the end of the process.</
para>
<
programlisting language="none">
underway, found end of log
<
para>What can take some time during server startup is preloading database
content into memory when the server starts. Objects cached in memory do not
survive a crash. By default, OpenDJ does not cache objects in memory before
starting to accept client requests. You can however set a
><
literal>preload-time-limit</
literal></
link> for the database cache of your
backend if you do want to load objects into the database cache before
OpenDJ begins accepting client connections.</
para>