简体   繁体   中英

Jhipster-Logstash does not start correctly

I use the command docker-compose up to deploy all in docker machine. That s works fine, but when i stop all the instance of docker and restart manually, i have an issue with logstash:

{:timestamp=>"2016-07-12T08:06:11.710000+0000", :message=>"Pipeline main started"}
{:timestamp=>"2016-07-12T08:06:11.815000+0000", :message=>"Pipeline main has been shutdown"}
{:timestamp=>"2016-07-12T08:06:14.723000+0000", :message=>"stopping pipeline", :id=>"main"}
{:timestamp=>"2016-07-12T08:07:47.582000+0000", :message=>"Pipeline main started"}
{:timestamp=>"2016-07-12T08:07:47.692000+0000", :message=>"Pipeline main has been shutdown"}
{:timestamp=>"2016-07-12T08:07:50.585000+0000", :message=>"stopping pipeline", :id=>"main"}

So i have the same issue when i deploy in kubernetes and can t use docker-compose.

I've just faced with similar problem.

Without -ti

    # docker run --rm logstash:2.3.4 logstash --debug --verbose -e 'input { stdin { } } output { stdout { } }'
    {:timestamp=>"2016-08-03T03:24:48.618000+0000", :message=>"starting agent", :level=>:info}
    {:timestamp=>"2016-08-03T03:24:48.629000+0000", :message=>"starting pipeline", :id=>"main", :level=>:info}
    {:timestamp=>"2016-08-03T03:24:48.816000+0000", :message=>"Starting pipeline", :id=>"main", :pipeline_workers=>1, :batch_size=>125, :batch_delay=>5, :max_inflight=>125, :level=>:info}
    {:timestamp=>"2016-08-03T03:24:48.827000+0000", :message=>"Pipeline main started"}
    {:timestamp=>"2016-08-03T03:24:48.848000+0000", :message=>"Input plugins stopped! Will shutdown filter/output workers.", :level=>:info}
    {:timestamp=>"2016-08-03T03:24:48.953000+0000", :message=>"Pipeline main has been shutdown"}
    {:timestamp=>"2016-08-03T03:24:51.834000+0000", :message=>"stopping pipeline", :id=>"main"}
    {:timestamp=>"2016-08-03T03:24:51.843000+0000", :message=>"Closing inputs", :level=>:info}
    {:timestamp=>"2016-08-03T03:24:51.844000+0000", :message=>"Closed inputs", :level=>:info}

With -ti

    # docker run -ti --rm logstash:2.3.4 logstash --debug --verbose -e 'input { stdin { } } output { stdout { } }'
    starting agent {:level=>:info}
    starting pipeline {:id=>"main", :level=>:info}
    Settings: Default pipeline workers: 1
    Starting pipeline {:id=>"main", :pipeline_workers=>1, :batch_size=>125, :batch_delay=>5, :max_inflight=>125, :level=>:info}
    Pipeline main started
    ^CSIGINT received. Shutting down the agent. {:level=>:warn}
    stopping pipeline {:id=>"main"}
    Closing inputs {:level=>:info}
    Closed inputs {:level=>:info}
    ^CSIGINT received. Terminating immediately.. {:level=>:fatal}

Looks like you don't have any configured inputs other then stdin .

So if you start it using composer you have to set tty: true

# cat docker-compose.yml 
version: '2'
services:
    logstash:
        image: logstash:2.3.4
        command: logstash --verbose --debug
        tty: true

Result will be

# docker logs -f sync_logstash_1
starting agent {:level=>:info}
starting pipeline {:id=>"main", :level=>:info}
Settings: Default pipeline workers: 1
Starting pipeline {:id=>"main", :pipeline_workers=>1, :batch_size=>125, :batch_delay=>5, :max_inflight=>125, :level=>:info}
Pipeline main started

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM