csirtgadgets / massive-octo-spice

DEPRECATED - USE v3 (bearded-avenger)
https://github.com/csirtgadgets/bearded-avenger-deploymentkit/wiki
GNU Lesser General Public License v3.0
227 stars 60 forks source link

CIF::Storage::ElasticSearch: Node -> localhost:9200 is a static var #375

Closed giovino closed 8 years ago

giovino commented 8 years ago

We need set dynamically at install OR picked up from a config after the fact.

2015-12-09T04:47:26,966Z][30811][FATAL][CIF::Router:100]: unable to start router, no storage handle...
[2015-12-09T04:47:26,966Z][30811][WARN][main:189]: retrying in 5secs...
[2015-12-09T04:47:31,966Z][30811][DEBUG][CIF::Storage::ElasticSearch:102]: checking handle...
[2015-12-09T04:47:31,966Z][30811][INFO][CIF::Storage::ElasticSearch:103]: storage node: localhost:9200
[2015-12-09T04:47:31,969Z][30811][FATAL][CIF::Storage::ElasticSearch:112]: [NoNodes] ** No nodes are available: [http://localhost:9200], called from sub Search::Elasticsearch::Transport::try {...}  at /usr/share/perl5/Try/Tiny.pm line 81.

this is failing in a cluster install.

giovino commented 8 years ago

Interestingly changing this value does not seem to address this issue:

/opt/cif/lib/perl5/CIF/Storage$ grep NODE ElasticSearch.pm 
    NODE                => '192.168.1.201:9200',
    default => sub { [ NODE ] },
$ sudo service apache2 restart
 * Restarting web server apache2
$ sudo service cif-router restart
 * Stopping cif-router                                                                                                                                                                                              [ OK ] 
 * Starting cif-router                         
[2015-12-09T04:58:49,176Z][31654][FATAL][CIF::Router:100]: unable to start router, no storage handle...
[2015-12-09T04:58:49,176Z][31654][WARN][main:189]: retrying in 5secs...
[2015-12-09T04:58:54,177Z][31654][DEBUG][CIF::Storage::ElasticSearch:102]: checking handle...
[2015-12-09T04:58:54,177Z][31654][INFO][CIF::Storage::ElasticSearch:103]: storage node: localhost:9200
[2015-12-09T04:58:54,178Z][31654][FATAL][CIF::Storage::ElasticSearch:112]: [NoNodes] ** No nodes are available: [http://localhost:9200], called from sub Search::Elasticsearch::Transport::try {...}  at /usr/share/perl5/Try/Tiny.pm line 81.
giovino commented 8 years ago

it's probably getting set here.. https://github.com/csirtgadgets/massive-octo-spice/blob/develop/src/bin/cif-router#L23

it's not clear to me env variables are the way to go. as a non-"cif" users.. you cannot sudo service cif-services restart

wesyoung commented 8 years ago

we probably need to put the vars in /etc/defaults/cif and export them in the init scripts, similar to:

https://github.com/csirtgadgets/bearded-avenger/blob/master/deployment/ansible/roles/app/files/cif-router#L56 https://github.com/csirtgadgets/bearded-avenger/blob/master/deployment/ansible/roles/app/files/defaults

was think'ing i had done them, but i was thinking v3 instead of v2 :(