Docker stop and start


#1

hello folks,
i’m new using docker and manageiq,

I deployed the container and it went well, but i need to put it in production, but every time I give a stop and start the container does not come back…
someone knows what can be?

thank you


#2

Are you talking about the manageiq/manageiq image on dockerhub?

This is not an answer to your question, but something you might want to be aware of:
There is some rearchitecturing going on to make ManageIQ deployable on Kubernetes. If you are a RedHat customer, you can deploy CloudForms on Openshift, but I don’t know, how much of this made it back upstream (because it relies on Openshift Features not present in Kubernetes)


#3

I’m having problems with this image (manageiq / manageiq)

I have a docker installed on Ubuntu server, and I’m trying to upload this image, I can upload it and configure what I want, but if the container falls, I can not upload it again …


#4

Hi @Erick_Cesar_Franca_S,

Could you more explain about:

and maybe can you write the syntax to run ManageIQ on docker?

Thanks,
Ary


#5

According to docker logs the /usr/bin/entrypoint-script in the container crashes, when the container is stopped and restarted.

stacktrace Error something seems wrong, we need at least two parameters to check service status
== Checking MIQ database status ==

** DB already initialized

/usr/local/lib/ruby/gems/2.4.0/gems/dalli-2.7.6/lib/dalli/ring.rb:45:in `server_for_key': No server available (Dalli::RingError)
        from /usr/local/lib/ruby/gems/2.4.0/gems/dalli-2.7.6/lib/dalli/client.rb:236:in `alive!'
        from /usr/local/lib/ruby/gems/2.4.0/gems/dalli-2.7.6/lib/rack/session/dalli.rb:19:in `initialize'
        from /usr/local/lib/ruby/gems/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/middleware/session/abstract_store.rb:32:in `initialize'
        from /usr/local/lib/ruby/gems/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/middleware/session/mem_cache_store.rb:22:in `initialize'
        from /usr/local/lib/ruby/gems/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/middleware/stack.rb:35:in `new'
        from /usr/local/lib/ruby/gems/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/middleware/stack.rb:35:in `build'
        from /usr/local/lib/ruby/gems/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/middleware/stack.rb:100:in `block in build'
        from /usr/local/lib/ruby/gems/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/middleware/stack.rb:100:in `each'
        from /usr/local/lib/ruby/gems/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/middleware/stack.rb:100:in `inject'
        from /usr/local/lib/ruby/gems/2.4.0/gems/actionpack-5.0.7/lib/action_dispatch/middleware/stack.rb:100:in `build'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/engine.rb:508:in `block in app'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/engine.rb:504:in `synchronize'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/engine.rb:504:in `app'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/application/finisher.rb:37:in `block in <module:Finisher>'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/initializable.rb:30:in `instance_exec'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/initializable.rb:30:in `run'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/initializable.rb:55:in `block in run_initializers'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `each'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `call'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each'
        from /usr/local/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/initializable.rb:54:in `run_initializers'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/application.rb:352:in `initialize!'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/railtie.rb:193:in `public_send'
        from /usr/local/lib/ruby/gems/2.4.0/gems/railties-5.0.7/lib/rails/railtie.rb:193:in `method_missing'
        from /var/www/miq/vmdb/config/environment.rb:5:in `<top (required)>'
        from /usr/local/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /var/www/miq/vmdb/lib/workers/bin/evm_server.rb:1:in `<main>'
{"@timestamp":"2018-12-19T15:23:24.342737 ","hostname":"e4cc2769e6ac","pid":5,"tid":"bf2f84","level":"info","message":"MIQ(Vmdb::Loggers.apply_config) Log level for azure.log has been changed to [WARN]"}
{"@timestamp":"2018-12-19T15:23:24.343445 ","hostname":"e4cc2769e6ac","pid":5,"tid":"bf2f84","level":"info","message":"MIQ(Vmdb::Loggers.apply_config) Log level for vim.log has been changed to [WARN]"}
{"@timestamp":"2018-12-19T15:23:24.649582 ","hostname":"e4cc2769e6ac","pid":5,"tid":"bf2f84","level":"info","message":"MIQ(SessionStore) Using session_store: ActionDispatch::Session::MemCacheStore"}
{"@timestamp":"2018-12-19T15:23:24.859508 ","hostname":"e4cc2769e6ac","pid":5,"tid":"bf2f84","level":"debug","message":"Dalli::Server#connect 127.0.0.1:11211"}
{"@timestamp":"2018-12-19T15:23:24.861271 ","hostname":"e4cc2769e6ac","pid":5,"tid":"bf2f84","level":"warning","message":"127.0.0.1:11211 failed (count: 0) Errno::ECONNREFUSED: Connection refused - connect(2) for \"127.0.0.1\" port 11211"
}

If you REALLY have get this working with docker, you will have to debug the start-scripts in the container and make sure everything is properly restarted.
You probably want to have a look at /usr/bin/appliance-initialize.sh, /usr/bin/entrypoint and /usr/bin/check-dependent-services.sh

Why don’t you use the Appliance Images?
According to the ManageIQ Homepage these images are meant for development, and not for production


#6

I added the following code:
su postgres -c "pg_ctl -D {APPLIANCE_PG_DATA} start" test ? -ne 0 && echo “!! Failed to start postgresql service” && exit 1 sleep 30 pidof memcached test $? -ne 0 && /usr/bin/memcached -u memcached -p 11211 -m 64 -c 1024 -l 127.0.0.1 -d

in the files:
/usr/bin/appliance-initialize.sh
/var/www/miq/vmdb/docker-assets/appliance-initialize.sh

between lines 19 and 20.

and it was ok, I was able to start it after stopping it.
Now my server has just crashed, I have already made some changes, and I can not start my container any more, among several messages that the log has these here:

{"@timestamp":"2018-12-13T20:30:24.627572 ",“hostname”:“65d96f96dfac”,“pid”:8,“tid”:“f1d114”,“level”:“warning”,“message”:“EVM is already running (PID=8)”}

Error something seems wrong, we need at least two parameters to check service status
== Checking MIQ database status ==
** DB already initialized
pg_ctl: another server might be running; trying to start server anyway
server starting
LOG: could not bind IPv6 socket: Cannot assign requested address
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG: redirecting log output to logging collector process
HINT: Future log output will appear in directory “pg_log”.