Splunk Enterprise

Command error: 'init' is not a valid command when trying to create Search Head Cluster

mninansplunk
Path Finder

When trying to create a Search Head Cluster on Ubuntu 20.04 with Splunk Enterprise 8.2.2.2 I receive a init error.  It seems splunk is not able to use init on my system.

If I run the following command on my first search head server:

splunk_admin@server1:/opt/splunk/bin$ sudo ./splunk init

Command error: 'init' is not a valid command. Please run 'splunk help' to see the valid commands.

The full comand to intialize the search does  not work either.  I just posted the command with init since Splunk can not see it or have proper rights to it?

Other commands seem to work:

splunk_admin@server:/opt/splunk/bin$ sudo ./splunk list

Command error: Additional arguments are needed for the 'list' command. Please type "splunk help list" for usage and examples.

Running command under root:

root@server1:/opt/splunk/bin# ./splunk init

Command error: 'init' is not a valid command. Please run 'splunk help' to see the valid commands.

Splunk Enterprise is running under splunk account.

splunk_admin@server1:/opt/splunk/bin$ sudo ps -elf|grep splunkd
1 S splunk 39839 1 2 80 0 - 158573 ep_pol 08:20 ? 00:10:33 splunkd -p 8089 start
1 S splunk 39840 39839 0 80 0 - 25243 ep_pol 08:20 ? 00:00:14 [splunkd pid=39839] splunkd -p 8089 start [process-runner]
0 S splunk 40102 39840 0 80 0 - 47271 poll_s 08:20 ? 00:00:42 /opt/splunk/bin/splunkd instrument-resource-usage -p 8089 --with-kvstore
0 S splunk_+ 115584 108329 0 80 0 - 1608 pipe_w 15:22 pts/0 00:00:00 grep --color=auto splunkd

Any advice on solving this issue will be greatly appreciated. 

 

 

 

 

 

Labels (1)
0 Karma

tgendron_splunk
Splunk Employee
Splunk Employee

sorry there was a typo in the above reply 

splunk@so2:/opt/splunk$ splunk  shcluster_config 

should read

splunk@so2:/opt/splunk$ splunk  init shcluster_config ...

0 Karma

tgendron_splunk
Splunk Employee
Splunk Employee

I ran into this also and found that I had a syntax error in the command, once I fixed that it ran. I would say that the error message is misleading at best. 

This produced the "Command error: 'init' is not a valid command...."

splunk@so2:/opt/splunk$ splunk  shcluster_config 

The correct syntax in my case was  this: 

splunk@so2:/opt/splunk$ splunk init  shcluster-config....

What changed above was the _ to a - in shcluster-config 

My guess is that if any part of the command is not right,  it says "init is not invalid command." 

 

HTH. 

 

 

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...