If you are getting this error
An error occurred: Could not create Splunk settings directory at '/root/.splunk'
Then make sure you run the process as the user you typically run splunk from. splunk in my case.
sudo su splunk
$ /opt/splunk/bin/splunk reload deploy-server
Your session is invalid. Please login.
Splunk username: admin
Login successful, running command...
... View more