Deployment Architecture

targetRepositoryLocation in serverclass.conf - Global only or can it be overridden?

msarro
Builder

Pretty simple question. According to the serverclass.conf spec here:
http://docs.splunk.com/Documentation/Splunk/6.0/Admin/Serverclassconf
that some global properties can be overridden at lower levels (serverClass or app).

I'd like to override targetRepositoryLocation for one specific serverClass (pooled search heads vs non-pooled search heads are each in their own serverClass and have different */apps directories). Can this be done? Despite saying "all overridable properties are marked as such" not a lot seems to be marked as whether or not it is overridable.

1 Solution

yannK
Splunk Employee
Splunk Employee

You can redefine per class.

I saw an example where each class was linked to a folder, then all apps to deploy were store per folder, and deployed using a method like:

[serverClass:myclass]
targetRepositoryLocation=/mylocation/myclass/
whitelist.0=mywhitelist
[serverClass:myclass:app:*]

View solution in original post

woodcock
Esteemed Legend

There is a bug in serverclass.spec that causes Splunk Deployment Server to give the following FALSE error logs:

Checking conf files for problems...
                Invalid key in stanza [serverClass:site1_indexers] in /opt/splunk/etc/system/local/serverclass.conf, line XXX: targetRepositoryLocation  (value:  $SPLUNK_HOME/etc/master-apps).
                Invalid key in stanza [serverClass:site1_indexers] in /opt/splunk/etc/system/local/serverclass.conf, line XXX+1: targetRepositoryLocationPolicy  (value:  rejectAlways).

You can confirm that it actually works by running /opt/splunk/bin/splunk btool serverclass list --debug| grep targetRepository which will give you this (which clearly indicates functional configurations):

/opt/splunk/etc/system/default/serverclass.conf targetRepositoryLocation = $SPLUNK_HOME/etc/apps
/opt/splunk/etc/system/local/serverclass.conf   targetRepositoryLocation = $SPLUNK_HOME/etc/master-apps
/opt/splunk/etc/system/local/serverclass.conf   targetRepositoryLocationPolicy = rejectAlways

You can also confirm by checking the target Cluster Master destination which will clearly show that it does indeed pull in CM apps to $SPLUNK_HOME/etc/apps/ as well as Indexer apps (via a different serverclass using the targetRepository* settings) to $SPLUNK_HOME/etc/master-apps/.

It is unfortunate the both the documentation and the spec files are in error. I am going to open a support case to get this mess cleared up.

0 Karma

yannK
Splunk Employee
Splunk Employee

You can redefine per class.

I saw an example where each class was linked to a folder, then all apps to deploy were store per folder, and deployed using a method like:

[serverClass:myclass]
targetRepositoryLocation=/mylocation/myclass/
whitelist.0=mywhitelist
[serverClass:myclass:app:*]

msarro
Builder

Great, that's all I needed!

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...