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

maprcli service list
    -node <node name>

REST

http[s]://<host>:<port>/rest/service/list?<parameters> 

Parameters

Parameter

Description

node

The node for which to list services

Output Fields

FieldDescription
memallocatedThe amount of system memory allocated to the service.
nameService name.
stateCurrent state of the service. See Service States.
logpathPath to the log files for the service.
displaynameDisplay name of the service in the MCS.

Service States

The following table lists the service states with their descriptions:

StateDescription
0Not configured. The package for the service is not installed and/or the service is not configured (configure.sh has not run).
1Configured. The package for the service is installed and configured.
2Running. The service is installed, started by the warden, and is currently running.
3Stopped. The service is installed and configure.sh has run, but the service is not running.
4Failed. The service is installed and configured, but not running.
5Stand by. The service is installed and is in standby mode, waiting to take over in case of failure of another instance. Mainly used for JobTracker warm standby.

Examples

CLI Example

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

[root@qa-node102 ~]# maprcli service list -node qa-node102.qa.lab
 
memallocated  name             state  logpath                             displayname       
16904.0       fileserver       2      /opt/mapr/logs/mfs.log              FileServer        
4830.0        resourcemanager  2      /opt/mapr/hadoop/hadoop-2.5.1/logs  ResourceManager   
              nfs              4      /opt/mapr/logs/nfsserver.log        NFS Gateway       
4000.0        webserver        2      /opt/mapr/logs/adminuiapp.log       Webserver         
3864.0        cldb             2      /opt/mapr/logs/cldb.log             CLDB              
              nodemanager      0      /opt/mapr/hadoop/hadoop-2.5.1/logs  NodeManager       
              tasktracker      0      /opt/mapr/hadoop/hadoop-2.5.1/logs  TaskTracker       
483.0         historyserver    2      /opt/mapr/hadoop/hadoop-2.5.1/logs  JobHistoryServer  
              jobtracker       0      /opt/mapr/hadoop/hadoop-2.5.1/logs  JobTracker        
Auto          hoststats        2      /opt/mapr/logs/hoststats.log        HostStats  
 

REST Example

The following output is an example of the service information returned when you issue the service list REST API call:

https://qa-node102.qa.lab:8443/rest/service/list?node=qa-node102.qa.lab

{"timestamp":1417740267677,"timeofday":"2014-12-04 04:44:27.677 GMT-0800","status":"OK","total":9,"data":[{"name":"fileserver","state":2,"memallocated":"16904.0","logpath":"/opt/mapr/logs/mfs.log","displayname":"FileServer"},{"name":"resourcemanager","state":2,"memallocated":"4830.0","logpath":"/opt/mapr/hadoop/hadoop-2.5.1/logs","displayname":"ResourceManager"},{"name":"webserver","state":2,"memallocated":"750.0","logpath":"/opt/mapr/logs/adminuiapp.log","displayname":"Webserver"},{"name":"cldb","state":2,"memallocated":"3864.0","logpath":"/opt/mapr/logs/cldb.log","displayname":"CLDB"},{"name":"nodemanager","state":2,"memallocated":"325.0","logpath":"/opt/mapr/hadoop/hadoop-2.5.1/logs","displayname":"NodeManager"},{"name":"tasktracker","state":2,"memallocated":"325.0","logpath":"/opt/mapr/hadoop/hadoop-2.5.1/logs","displayname":"TaskTracker"},{"name":"historyserver","state":2,"memallocated":"483.0","logpath":"/opt/mapr/hadoop/hadoop-2.5.1/logs","displayname":"JobHistoryServer"},{"name":"jobtracker","state":2,"memallocated":"4830.0","logpath":"/opt/mapr/hadoop/hadoop-2.5.1/logs","displayname":"JobTracker"},{"name":"hoststats","state":2,"memallocated":"Auto","logpath":"/opt/mapr/logs/hoststats.log","displayname":"HostStats"}]}
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).