I installed Splunk on my laptop (Windows 7 64 bit) and things worked fine . I stopped the Windows service and was playing around with some Python modules
Now i am able to start Splunkd from the command line IF I set the environment variables SPLUNK_HOME, SPLUNK_DB,PYTHONHOME . But if I start as a service it does not work (i.e. net start splunkd )
How do I set the enviroment variables ?
It sounds as if you corrupted the Splunk install a bit. I'd uninstall / reinstall to have those variables restored. You can also start splunk like this:
cd C:\Program Files\Splunk\bin
splunk.exe disable webserver
This should turn off the splunkweb, and then start Splunk correctly. Running splunkd.exe is not an option. If it still fails with a Python Error, add the Splunk Path back to the Environment Variable.
This is the error that I see in the logs
07-17-2013 15:12:23.681 +0530 ERROR loader - File "D:\Splunk\Python-2.7\Lib\site-packages\site.py", line 74, ..
07-17-2013 15:12:23.681 +0530 ERROR loader - raise ImportError("Couldn't find the real 'site' module")
07-17-2013 15:12:23.681 +0530 ERROR loader - ImportError: Couldn't find the real 'site' module
I can solve this problem by starting splunkd from the command line by setting SPLUNK_HOME, SPLUNKDB , PYTHONHOME and then start splunkd . The logs say that splunk has started
I understand that I should not be doing it . But as I mentioned :
I installed a couple of Python modules which caused changes to PYTHONPATH etc
So I have been trying to debug why it stopped and figured these .
You're saying again though that you're running "splunkd from a command line" - you shouldn't be running splunkd directly at all, ever, because you need to run splunk which takes care of setting up the environment variables and a bunch of other things before invoking splunkd.
No I am trying to run splunkd as a service . If I run from command line I figured out that I need to set certain environment variables . I would like to set these variables and then run as a service . The reason i would like to do this is because I can run splunkd from a command line but I cannot run splunkweb