Getting Data In

| rest /services/cluster/master/peers

_smp_
Builder

I have a SH cluster and an Index cluster all running 7.1.7. I'm trying to access the cluster/master/peers endpoint by executing this search:

| rest /services/cluster/master/peers

When I run this on a SH, I get this error:

REST Processor: Failed to fetch REST endpoint uri=https://127.0.0.1:8089/services/cluster/master/peers?count=0 from server https://127.0.0.1:8089. Check that the URI path provided exists in the REST API.
When I run it on the CM, I get this error:
Unexpected status for to fetch REST endpoint uri=https://127.0.0.1:8089/services/cluster/master/peers?count=0 from server=https://127.0.0.1:8089 - Service Unavailable
Either way, this message gets logged by each of the indexer peers no matter where I run the rest command:
10-16-2019 09:28:39.947 -0500 INFO ClusterMasterPeerHandler - master is not enabled on this node

Anyone know why I can't access this rest endpoint?

0 Karma
1 Solution

anthonymelita
Contributor

The rest endpoint you're hitting there is for indexer clustering and will only work on an indexer cluster master. If you are trying to get the status of all distributed search peers then use |rest /services/search/distributed/peers/

Also if you want to avoid errors from downstream search peers, then you should specify the splunk_server=
For the case of getting indexer cluster peers you would do like
|rest /services/cluster/master/peers splunk_server=ClusterMasterNameGoesHere and then it won't try to distribute the rest command to all search peers, and avoid them throwing errors.

View solution in original post

anthonymelita
Contributor

The rest endpoint you're hitting there is for indexer clustering and will only work on an indexer cluster master. If you are trying to get the status of all distributed search peers then use |rest /services/search/distributed/peers/

Also if you want to avoid errors from downstream search peers, then you should specify the splunk_server=
For the case of getting indexer cluster peers you would do like
|rest /services/cluster/master/peers splunk_server=ClusterMasterNameGoesHere and then it won't try to distribute the rest command to all search peers, and avoid them throwing errors.

_smp_
Builder

Thank you very much for the response. It does not work when I run the command on the CM - I posted the error above. But it does work when I add splunk_server=.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...