The following article is a generic Splunk step-by-step guide to upgrading your Splunk Enterprise environment. The links below are important to consult before starting your upgrade. Knowing what version of Splunk you are running is also important to planning your upgrade. Certain updates could require two version updates to get to the most current version of Splunk.
Splunk Upgrade Documentation Splunk Distributed Environment Upgrade Documentation Splunk Indexer Cluster Upgrade Documentation Splunk Search Head Upgrade Documentation
Once you've determined what version of Splunk you are running and the upgrade path you are taking. You will need the download for the version of Splunk. The link below takes you to the most current Splunk download. However, if you wish to upgrade to a different version you can use the "Older Releases" tab to find the version you are looking for.
Splunk Enterprise Downloads Splunk Enterprice Downloads - Older Releases
Plan on taking a backup of your $SPLUNK_HOME/etc/ to the directory of your choice. Ensure that there is enough space on that directory to accommodate the backup. An example command can the found below. The first path after the "-cvf" is the path of storage and the second path is the location of the directory you wish to back up. The Splunk service should be stopped before backing up the /etc/ directory. This should be done on every host before starting the upgrade!
tar -cvf /tmp/splunk_clusterManagerApps.tgz /opt/splunk/etc/
- Cluster Manager
- Monitoring Console
- Search Heads
- Indexers
- Heavy Forwarder
Login to you Cluster Manager console and follow those backup steps prior to beginning the upgrade. You will need to use an account that has proper permission to perform the upgrade end-to-end
/opt/splunk/bin/splunk/stop
This will include all files in /etc/system and /etc/apps. Be aware that /tmp will have additional permission than creating a directory specifically for the back.
tar -cvf /tmp/splunk_clusterManagerApps.tgz /opt/splunk/etc/
Splunk provides the command below that you can put in the console. It is a good idea to navigate to the location where the download should be stored
wget -O splunk-9.0.0.1-9e907cedecb1-linux-2.6-x86_64.rpm "https://download.splunk.com/products/splunk/releases/9.0.0.1/linux/splunk-9.0.0.1-9e907cedecb1-linux-2.6-x86_64.rpm"
If you get an error that wget is not installed the following command should be able to get it installed. The "-y" accepts the install so there is no manual acceptance to download it
yum -y install wget
Because this is an upgrade, nothing needs to be uninstalled and reinstalled. The rpm file can be placed anywhere and the following command can be run to install the upgrade.
rpm -Uvh splunk-9.0.0.1-9e907cedecb1-linux-2.6-x86_64.rpm
Now that the update is applied the Splunk service can be started again.
/opt/splunk/bin/splunk start --accept-license --answer-yes
The steps above can be repeated to update the Monitoring Console
We can do a peer by peer upgrade. Taking one search head down at a time to allow for some search functionally during the upgrade time. The steps are the exact same as above.
- Stop the Splunk Service
- Take a back up
- Download the new Splunk version
- Extract the version
- Start the Splunk service
Before starting the indexer upgrading it is imperative that the Cluster Manager be put in Maintenance Mode. This step prevents unnecessary bucket fix-ups during the upgrade.
/opt/splunk/bin/splunk enable maintenance-mode
/opt/splunk/bin/splunk show maintenance-mode
Once the Cluster Manager is confirmed to be in maintenance mode, proceed with the upgrade process on a peer by peer basis.
Use the following command to stop the Splunk service.
/opt/splunk/bin/splunk offline
This ensures that whatever the indexer is currently working on is completed in a way that minimizes disruptions to searchable data. Follow the steps repeated on the other peers for the upgrade process. Once all the indexers are updated, the Cluster Manage needs to be taken off maintenance mode
/opt/splunk/bin/splunk disable maintenance-mode
/opt/splunk/bin/splunk show maintenance-mode
Follow the upgrade steps like the other Splunk hosts
- Stop the Splunk Service
- Take a back up
- Download the new Splunk version
- Extract the version
- Start the Splunk service
Follow the upgrade steps like the other Splunk hosts
- Stop the Splunk Service
- Take a back up
- Download the new Splunk version
- Extract the version
- Start the Splunk service