Admin Manual

 


Configure automatic load balancing

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

Configure automatic load balancing

You can configure Splunk so that forwarders sending data to indexers are automatically load balanced across multiple Splunk indexers. This means that if an indexer goes down or is otherwise unavailable (network or power issues, for example), a forwarder needing to send data to an indexer will be directed to the next indexer that is available.

You can either define a static list of available indexers in outputs.conf on each forwarder, or specify a single indexer name in outputs.conf on each forwarder and define the list of indexers that respond to that name in DNS. Each option has its benefits:

How it works

Output settings for forwarders are configured in outputs.conf. Since there is no default copy of outputs.conf, you can create a standard outputs.conf that applies to all your forwarders and then copy it into $SPLUNK_HOME/etc/system/local/ on each forwarding instance. You can use a copy of outputs.conf.spec as a starting point, but be sure to thoroughly review and edit it to meet your deployment's needs. The information in outputs.conf.spec tells you what the default values are for the options.

To set up automatic load balancing for a given forwarder, you specify a global configuration stanza in outputs.conf (described below), and then define one or more target groups of indexers. Any configuration you set in the global stanza applies to all receiving indexers unless you specify a different configuration for an individual indexer or target group of indexers. Configurations you define for specific indexers or groups of indexers override anything you've defined at a higher level. You can then enable and configure automatic load-balancing in either the global stanza or on a per-target group basis.

Why multiple target groups? If you have more than one target group of indexers, a given forwarder will send a copy of its data to both target groups. This can be useful in situations where you have two different sets of Splunk indexers. For example, if you are planning to upgrade your Splunk deployment to a newer version, and want to test the new version alongside your existing deployment, this configuration allows you to send the same data to both sets of indexers. Or maybe you just want a backup instance of your indexed data.

Note: If you drop a copy of outputs.conf into $SPLUNK_HOME/etc/system/local/ and don't specify anything but the stanza headings, Splunk will write some default values into the file. The values in the examples below don't necessarily reflect those defaults.

Global configuration

The global configuration is set in the [tcpout] stanza. The global configuration applies unless it is overridden by the configurations for the specific target group(s) or individual servers:

[tcpout]
defaultGroup = my_indexers
disabled = false 
prependKeyToRaw = <key>

Things to know:

Target group configuration

Set target group-specific details in a stanza named for that target group:

[tcpout:my_indexers]
disabled = false
autoLB = true
autoLBFrequency = 10
server = fflanda-lb.fflanda.com:9995

What the DNS record looks like

If you use fully qualified domain names, and have three indexers for forwarders to distribute their data to, your DNS record would look like this:

fflanda-lb        A       10.10.10.1
fflanda-lb        A       10.10.10.2
fflanda-lb        A       10.10.10.3

and the nslookup output would look like this:

$ nslookup fflanda-lb
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   fflanda-lb.fflanda.com
Address: 10.10.10.2
Name:   fflanda-lb.fflanda.com
Address: 10.10.10.3
Name:   fflanda-lb.fflanda.com
Address: 10.10.10.1

and after the time specified in autoLBFrequency passes, the nslookup output would look like this (the order changes):

$ nslookup fflanda-lb
Server:         127.0.0.1
Address:        127.0.0.1#53

Name:   fflanda-lb.fflanda.com
Address: 10.10.10.3
Name:   fflanda-lb.fflanda.com
Address: 10.10.10.1
Name:   fflanda-lb.fflanda.com
Address: 10.10.10.2

If the connection to an indexer is disrupted or unavailable

Optional attributes for target groups

These attributes are optional. You can set these attributes in the global stanza, or on a per-target group basis:

Queue settings for target groups

When forwarders send data, the data enters a queue as it leaves the forwarder. If no indexers are available to receive the data, this stanza determines what is done with the queued up data. You can set these attributes in the global stanza, or on a per-target group basis:

Backoff settings for target groups

If an indexer in a target group becomes unreachable, you can configure the forwarder to retry the connection. If a connection must be retried, a forwarder uses backoffAtStartup or initialBackoff as the number of seconds to wait. After this time expires, the forwarder doubles the number of seconds over and over again until reaching maxBackoff. When this is reached, the forwarder stops doubling the number of seconds inbetween retries and uses the same maxBackoff seconds. It retries at this frequency maxNumberOfRetriesAtHighestBackoff times or forever if that value is -1.

So if the initialBackoff is set to 2 seconds, maxBackoff is set to 20 seconds, and maxNumberOfRetriesAtHighestBackoff is set to -1, then the forwarder will retry the connection at 2, 4, 8, and 16 seconds. The next increment will be 20 seconds, and it will retry at this frequency indefinitely until the connection is made.

This documentation applies to the following versions of Splunk: 4.0 , 4.0.1 , 4.0.2 , 4.0.3 , 4.0.4 , 4.0.5 , 4.0.6 , 4.0.7 , 4.0.8 , 4.0.9 , 4.0.10 , 4.0.11 View the Article History for its revisions.


You must be logged into splunk.com in order to post comments. Log in now.

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.

Feedback submitted, thanks!