node services
Starts, stops, or restarts services on one or more server nodes. Permissions
required: ss
, fc
or a
.
To start or stop services, you must specify the service name, the action (start, stop, or restart), and the nodes on which to perform the action. You can specify the nodes in either of two ways:
- Use the
nodes
parameter to specify a space-delimited list of node names. - Use the
filter
parameter to specify all nodes that match a certain pattern. See Filters for more information.
Syntax
- CLI
-
maprcli node services [ -action start|stop|restart] [ -cldb start|stop|restart] [ -cluster <cluster> ] [ -fileserver start|stop|restart] [ -filter <filter> ] [ -hbmaster start|stop|restart] [ -hbregionserver start|stop|restart] [ -jobtracker start|stop|restart] [ -name <service> ] [ -nfs start|stop|restart] [ -nodes <node names> ] [ -tasktracker start|stop|restart] [ -webserver start|stop|restart] [ -zkconnect <ZooKeeper Connect String> ]
- REST
-
http[s]://<host>:<port>/rest/node/services?<parameters>
Parameters
To perform an action on a service, on a particular set of nodes, you must specify the following three parameters:
-
action
- the action to perform; starting, stopping, or restarting a service. -
node
orfilter
- the nodes on which to perform the action; either a list of nodes, or a filter that matches a set of nodes -
name
- the service on which to perform the action
The following table lists the parameters available with the node
services
command.
Parameter |
Description |
---|---|
action |
An action to perform on a service specified in the |
cldb |
Starts, stops, or restarts the cldb service. Values: start, stop, or restart |
cluster |
The cluster on which to run the command. |
fileserver |
Starts, stops, or restarts the fileserver service. Values: start, stop, or restart |
filter |
A filter specifying nodes on which to start or stop services. For fields to use with the filter, see the Fields table in the node list command. See Filters for more information about filters. |
hbmaster |
Starts, stops, or restarts the hbmaster service. Values: start, stop, or restart |
hbregionserver |
Starts, stops, or restarts the hbregionserver service. Values: start, stop, or restart |
jobtracker |
Starts, stops, or restarts the jobtracker service. Values: start, stop, or restart |
name |
A service on which to perform an action specified by the
|
nfs |
Starts, stops, or restarts the nfs service. Values: start, stop, or restart |
nodes |
A list of node names, separated by spaces. |
tasktracker |
Starts, stops, or restarts the tasktracker service. Values: start, stop, or restart |
webserver | Starts, stops, or restarts the web server service. Values: start, stop, or restart |
zkconnect |
Examples
Start the NodeManager Service
maprcli node services -name nodemanager -action start
Stop the ResourceManager Service
maprcli node services -name resourcemanager -action stop
Stop the ResourceManager Service
maprcli node services -name resourcemanager -action restart
Restart nfs server
maprcli node services -nodes hadoop1 -nfs restart
Restart nfs server using a filter
Using a filter is common, especially in HBase environments, where full restarts of region and master servers are needed.
maprcli node services -filter ["csvc==nfs"] -nfs restart
Start the
Hue Service maprcli node services -name hue -action start -nodes <node n>
Restart specified TaskTrackers in the Cluster
To restart TaskTrackers on specific nodes, provide the list of nodes in the
nodes
parameter.
maprcli node services -tasktracker restart -nodes <node 1> <node 2> <node 3>
Restart all TaskTrackers in the Cluster
Instead of specifying a list of all nodes in the cluster that are running the
TaskTracker service, you can use the filter parameter to restart every
tasktracker
by matching only nodes on which the TaskTracker is
configured. Remember that csvc
is the short name of the
configuredservice
field. See the Fields table on the
node list
page.
maprcli node services -tasktracker restart -filter '[csvc==tasktracker]'
Restart the hoststats service
Restart the hoststats service after making changes to the MapR Metrics database. You do not need to restart warden.
maprcli node services -name hoststats -action restart -nodes <nodes>
OR
maprcli node services -name hoststats -action restart -filter '[csvc==hoststats]'