service list

Lists all services on the specified node, the memory allocated for each service, the state of each service, and log path for each service.

Syntax

CLI
/opt/mapr/bin/maprcli service list
    -node <node name>
    [ -cluster <cluster name> ]
    [ -zkconnect <ZooKeeper connect string> ]
    [ -output terse|verbose ]
REST
Request Type GET
Request URL
http[s]://<host>:<port>/rest/service/list?<parameters>

Parameters

Parameter

Description

cluster The cluster on which to run the command. If this parameter is omitted, the command is run on the same cluster where it is issued. In multi-cluster contexts, you can use this parameter to specify a different cluster on which to run the command.
node The node for which to list services. Default: localhost. If this is not specified, the /etc/hosts file must include the IP address or hostname for the localhost.
output Whether the output should be terse or verbose. Default: verbose.
zkconnect A ZooKeeper connect string, which specifies a list of the hosts running ZooKeeper, and the port to use on each, in the format: '<host>[:<port>][,<host>[:<port>]...]'. To obtain zookeeper connection strings, use the maprcli node listzookeepers command.

Output Fields

Field Description
memallocated The amount of system memory allocated to the service.
name Service name.
state Current state of the service. See Service States.
logpath Path to the log files for the service.
displayname Display name of the service in the MCS.

Service States

The following table lists the service states with their descriptions:

State Description
0 Not configured. The package for the service is not installed and/or the service is not configured (configure.sh has not run). This state is also returned for all the services if you run the command without specifying a node.
1 Configured. The package for the service is installed and configured.
2 Running. The service is installed, started by the warden, and is currently running.
3 Stopped. The service is installed and configure.sh has run, but the service is not running.
4 Failed. The service is installed and configured, but not running.
5 Stand by. The service is installed and is in standby mode, waiting to take over in case of failure of another instance.

Examples

CLI Example

The following output is an example of the service information returned when you run the service list command without specifying the node:

# /opt/mapr/bin/maprcli service list -json
{
	"timestamp":1555048050131,
	"timeofday":"2019-04-11 10:47:30.131 GMT-0700 PM",
	"status":"OK",
	"total":10,
	"data":[
		{
			"name":"fileserver",
			"state":0,
			"logpath":"/opt/mapr/logs/mfs.log",
			"displayname":"FileServer"
		},
		{
			"name":"resourcemanager",
			"state":0,
			"logpath":"/opt/mapr/hadoop/hadoop-2.7.4/logs",
			"displayname":"ResourceManager"
		},
		{
			"name":"filemigrate",
			"state":0,
			"logpath":"/opt/mapr/filemigrate/filemigrate-1.0.0/logs",
			"displayname":"FileMigrate"
		},
		{
			"name":"cldb",
			"state":0,
			"logpath":"/opt/mapr/logs/cldb.log",
			"displayname":"CLDB"
		},
		{
			"name":"nfs4",
			"state":0,
			"logpath":"/opt/mapr/logs/nfs4/nfs4server.log",
			"displayname":"NFS4 Gateway"
		},
		{
			"name":"mastgateway",
			"state":0,
			"logpath":"/opt/mapr/logs/mastgateway.log",
			"displayname":"MASTGatewayService"
		},
		{
			"name":"nodemanager",
			"state":0,
			"logpath":"/opt/mapr/hadoop/hadoop-2.7.4/logs",
			"displayname":"NodeManager"
		},
		{
			"name":"gateway",
			"state":0,
			"logpath":"/opt/mapr/logs/gateway.log",
			"displayname":"GatewayService"
		},
		{
			"name":"hoststats",
			"state":0,
			"logpath":"/opt/mapr/logs/hoststats.log",
			"displayname":"HostStats"
		},
		{
			"name":"apiserver",
			"state":0,
			"logpath":"/opt/mapr/apiserver/logs/apiserver.log",
			"displayname":"APIServer"
		}
	]

REST Example

The following output is an example of the service information returned when you issue the service list REST API call, without specifying a node:

# curl -k -X GET 'https://abc.sj.us:8443/rest/service/list' --user mapr:mapr
{"timestamp":1529380971417,"timeofday":"2018-06-18 09:02:51.417 GMT-0700 PM","status":"OK","total":9,"data":[{"name":"fileserver","state":0,"logpath":"/opt/mapr/logs/mfs.log","displayname":"FileServer"},{"name":"resourcemanager","state":0,"logpath":"/opt/mapr/hadoop/hadoop-2.7.0/logs","displayname":"ResourceManager"},{"name":"cldb","state":0,"logpath":"/opt/mapr/logs/cldb.log","displayname":"CLDB"},{"name":"nfs4","state":0,"logpath":"/opt/mapr/logs/nfs4/nfs4server.log","displayname":"NFS4 Gateway"},{"name":"mastgateway","state":0,"logpath":"/opt/mapr/logs/mastgateway.log","displayname":"MASTGatewayService"},{"name":"nodemanager","state":0,"logpath":"/opt/mapr/hadoop/hadoop-2.7.0/logs","displayname":"NodeManager"},{"name":"gateway","state":0,"logpath":"/opt/mapr/logs/gateway.log","displayname":"GatewayService"},{"name":"hoststats","state":0,"logpath":"/opt/mapr/logs/hoststats.log","displayname":"HostStats"},{"name":"apiserver","state":0,"logpath":"/opt/mapr/apiserver/logs/apiserver.log","displayname":"APIServer"}]}

The following output is an example of the service information returned when you run the service list command after specifying a node:

/opt/mapr/bin/maprcli service list -node 10.10.82.29 -json
{
	"timestamp":1555049507312,
	"timeofday":"2019-04-11 11:11:47.312 GMT-0700 PM",
	"status":"OK",
	"total":10,
	"data":[
		{
			"name":"fileserver",
			"state":2,
			"memallocated":"8382.0",
			"logpath":"/opt/mapr/logs/mfs.log",
			"displayname":"FileServer"
		},
		{
			"name":"resourcemanager",
			"state":2,
			"memallocated":"2395.0",
			"logpath":"/opt/mapr/hadoop/hadoop-2.7.4/logs",
			"displayname":"ResourceManager"
		},
		{
			"name":"filemigrate",
			"state":4,
			"logpath":"/opt/mapr/filemigrate/filemigrate-1.0.0/logs",
			"displayname":"FileMigrate"
		},
		{
			"name":"cldb",
			"state":2,
			"memallocated":"1916.0",
			"logpath":"/opt/mapr/logs/cldb.log",
			"displayname":"CLDB"
		},
		{
			"name":"nfs4",
			"state":2,
			"memallocated":"2048.0",
			"logpath":"/opt/mapr/logs/nfs4/nfs4server.log",
			"displayname":"NFS4 Gateway"
		},
		{
			"name":"mastgateway",
			"state":2,
			"memallocated":"2395.0",
			"logpath":"/opt/mapr/logs/mastgateway.log",
			"displayname":"MASTGatewayService"
		},
		{
			"name":"nodemanager",
			"state":2,
			"memallocated":"325.0",
			"logpath":"/opt/mapr/hadoop/hadoop-2.7.4/logs",
			"displayname":"NodeManager"
		},
		{
			"name":"gateway",
			"state":2,
			"memallocated":"239.0",
			"logpath":"/opt/mapr/logs/gateway.log",
			"displayname":"GatewayService"
		},
		{
			"name":"hoststats",
			"state":2,
			"memallocated":"Auto",
			"logpath":"/opt/mapr/logs/hoststats.log",
			"displayname":"HostStats"
		},
		{
			"name":"apiserver",
			"state":2,
			"memallocated":"1000.0",
			"logpath":"/opt/mapr/apiserver/logs/apiserver.log",
			"displayname":"APIServer"
		}
	]
}

REST Example

The following output is an example of the service information returned when you issue the service list REST API call, after specifying a node:

# curl -k -X GET 'https://abc.sj.us:8443/rest/service/list' --user mapr:mapr
            {"timestamp":1529380971417,"timeofday":"2018-06-18 09:02:51.417 GMT-0700 PM","status":"OK","total":9,"data":[{"name":"fileserver","state":0,"logpath":"/opt/mapr/logs/mfs.log","displayname":"FileServer"},{"name":"resourcemanager","state":0,"logpath":"/opt/mapr/hadoop/hadoop-2.7.0/logs","displayname":"ResourceManager"},{"name":"cldb","state":0,"logpath":"/opt/mapr/logs/cldb.log","displayname":"CLDB"},{"name":"nfs4","state":0,"logpath":"/opt/mapr/logs/nfs4/nfs4server.log","displayname":"NFS4 Gateway"},{"name":"mastgateway","state":0,"logpath":"/opt/mapr/logs/mastgateway.log","displayname":"MASTGatewayService"},{"name":"nodemanager","state":0,"logpath":"/opt/mapr/hadoop/hadoop-2.7.0/logs","displayname":"NodeManager"},{"name":"gateway","state":0,"logpath":"/opt/mapr/logs/gateway.log","displayname":"GatewayService"},{"name":"hoststats","state":0,"logpath":"/opt/mapr/logs/hoststats.log","displayname":"HostStats"},{"name":"apiserver","state":0,"logpath":"/opt/mapr/apiserver/logs/apiserver.log","displayname":"APIServer"}]}
Note: When you configure high availability for the ResourceManager, the status of standby ResourceManager service differs based on the selected failover implementation. When the cluster uses manual or automatic failover for the ResourceManager, standby ResourceManagers have a state equal to 2 (running). When the cluster uses zero configuration failover for the ResourceManager, standby ResourceManagers have a state equal to 5 (stand by).