Hi, just want to ask why im getting this error and how to make this right :
An error occurred: Could not create Splunk settings directory at '/root/.splunk'.
Ialways get that when i am reloading the Splunk Deployment server
It's basically: Splunk is not running as root (which is good), but you're logged in as root (which is not so good).
When you try to login (which is required to reload the deployment server), Splunk saves your login (which would be a cookie if you we're using a browser) in a folder in your home directory (/root/.splunk/). But as Splunk does not run as root, it has no permissions to do that, therefore the error message.
Solution: Do not work as root, especially not while editing files on a non-root Splunk, it will bring you into trouble.
I'd suggest using a normal user, you could use the user Splunk is running at.
Hope that helps!
It's basically: Splunk is not running as root (which is good), but you're logged in as root (which is not so good).
When you try to login (which is required to reload the deployment server), Splunk saves your login (which would be a cookie if you we're using a browser) in a folder in your home directory (/root/.splunk/). But as Splunk does not run as root, it has no permissions to do that, therefore the error message.
Solution: Do not work as root, especially not while editing files on a non-root Splunk, it will bring you into trouble.
I'd suggest using a normal user, you could use the user Splunk is running at.
Hope that helps!
./splunk reload deploy-server
ERROR: Couldn't determine $SPLUNK_HOME or $SPLUNK_ETC; perhaps one should be set in environment
Try this, it depends on your system environment:
source /opt/splunk/bin/setSplunkEnv
That will set the variables and also allow you to issue Splunk commands from any folder, just by starting with splunk...
. You could then put that line into your .bashrc
or .bash_profile
or whatever your system runs when you login. 😉
That doesn't work on my side.
But I Finally know the answer :
We are login to our Username (e.g: FirstName.LastName)
and for us to do the command
./splunk reload deploy-server
We need to log in as a user in the splunk :
sudo su splunk
./splunk reload deploy-server
(this prompt me to enter my splunk credentials)
and then it will RUN the command
if is do SUDO = An error occurred: Could not create Splunk settings directory at '/root/.splunk'.
if no SUDO =Couldn't determine $SPLUNK_HOME or $SPLUNK_ETC; perhaps one should be set in environment
how can i reload the deployment server ?
How can i do that in CLI ?
to run the command ./splunk reload deploy-server
I see this answer but i cant really understand it : https://answers.splunk.com/answers/211892/could-not-create-splunk-settings-directory-at-root.html
can somebody tell me the procedure ?