Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long wait on first time set up on existing SELKS5 #8

Open
pevma opened this issue Nov 30, 2018 · 13 comments
Open

Long wait on first time set up on existing SELKS5 #8

pevma opened this issue Nov 30, 2018 · 13 comments

Comments

@pevma
Copy link
Member

pevma commented Nov 30, 2018

When I try to run /opt/selks/Scripts/Setup/selks-first-time-setup_stamus.sh on an already set up SELKS5 - there is very long hang on the Moloch init par tof the script. But if I execute the scripts in /opt/selks/Scripts/Setup/selks-first-time-setup_stamus.sh one by one - it works fine no issue.

@Jeroen0494 - have you experienced something similar ?

@Jeroen0494
Copy link
Contributor

This is correct, you need to type in "INIT" to manually confirm to wipe the database. This is done by Moloch on purpose so you don't accidentally wipe your database.

@Jeroen0494
Copy link
Contributor

Jeroen0494 commented Nov 30, 2018

On line 40 of the Moloch setup script you could do something like this:
yes INIT | /data/moloch/db/db.pl http://localhost:9200 init
I don't have a system to test it out on though, I'm not claiming this actually works and I shan't be responsible for the consequences...

@pevma
Copy link
Member Author

pevma commented Nov 30, 2018

Nope - in my case it does not as - just hangs there - see screenshot below:

screenshot from 2018-11-30 13-30-13

@Jeroen0494
Copy link
Contributor

That particular step always takes a while for me to if I have a lot of data in Elasticsearch, but it would never just 'hang'. Could you make the script more verbose by adding "set -x" to the top?

@pevma
Copy link
Member Author

pevma commented Nov 30, 2018

Ya - ok - so I experience the same, if there is data in ES it wait there a lot. Not sure why?

@Jeroen0494
Copy link
Contributor

Jeroen0494 commented Nov 30, 2018

So after waiting long enough, the command does complete? I don't see you typing 'INIT' in the screenshot above, does this command actually execute?

The init command wipes all Moloch data in Elasticsearch via the API, including indexed PCAP files. If you have a lot of network traffic (and a lot of Elasticsearch data) this command takes a while. It also wipes the user database.

@pevma
Copy link
Member Author

pevma commented Nov 30, 2018

Yes - on both points. It just it takes while to come to the question of "type INIT" - the end user may keep wondering what is happening....

@Jeroen0494
Copy link
Contributor

Jeroen0494 commented Nov 30, 2018

Hmm, that is weird. If I run the script as-is on a working system the question for INIT comes up immediately. And I have never experienced extreme slowness before that question comes up. My only thought would be the timeout in the curl command in the if-statement.

Moloch checks the status of Elasticsearch too, btw. So maybe you can even remove the curl, because this would mean double the waiting time.

@pevma
Copy link
Member Author

pevma commented Nov 30, 2018

That first curl check - comes out very fast - no wait time it just returns if ES is up or not, so i doubt it is because of it.
Ok then it is probably because of my VM set up maybe - if no one else experiences it ...

@Jeroen0494
Copy link
Contributor

Hi Peter,

So I ran the first-time-setup script on an already configured system for some testing and it just hung there until I typed INIT, but it never asked for me to type it. Somehow the moloch init script doesn't forward it's output to the current terminal session, making it seem like the script froze.
I'm off for the holidays but maybe this gives you some more information for testing in the meantime.

Jeroen

@pevma
Copy link
Member Author

pevma commented Dec 28, 2018

ok.
Thanks for the follow up.
I think this should be fixed by - 2914453

@Jeroen0494
Copy link
Contributor

Hi Peter,

Can this issue be closed?

@pevma
Copy link
Member Author

pevma commented Jun 21, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants