Table of Contents Previous Next


13 Database Management : 13.4 Controlling the Database Server

Where x specifies the server version.
If your cluster resides on CentOS version 7.x, you can use the systemctl command to control the service. The systemctl command must be in your search path and must be invoked with superuser privileges. To use the command, open a command line, and enter:
systemctl action service_name
service_name specifies the name of the service.
action specifies the action taken by the service command. Specify:
start to start the service.
stop to stop the service.
restart to stop and then start the service.
status to discover the current status of the service.
On CentOS version 6.x, you can control a service at the command line with the service command. The Linux service controller mechanism allows you to start and stop the server gracefully. Using the service command to change the status of a service allows the service controller to keep track of the server status (the pg_ctl command does not alert the service controller to changes in the status of a server).
service service_name action
The Linux service command invokes a script (with the same name as the service). If your Linux distribution does not support the service command, you can call the script directly by entering:
/etc/init.d/service_name action
service_name specifies the name of the service.
action specifies the action taken by the service command. Specify:
start to start the service.
stop to stop the service.
condstop to stop the service without displaying a notice if the server is already stopped.
restart to stop and then start the service.
condrestart to restart the service without displaying a notice if the server is already stopped.
try-restart to restart the service without displaying a notice if the server is already stopped.
status to discover the current status of the service.

13 Database Management : 13.4 Controlling the Database Server

Table of Contents Previous Next