rabbitmq / rabbitmq-autocluster

RabbitMQ peer discovery and cluster formation plugin, supports RabbitMQ 3.6.x
BSD 3-Clause "New" or "Revised" License
241 stars 54 forks source link

Docker image build #36

Closed adrianchifor closed 7 years ago

adrianchifor commented 7 years ago

Hi, I was following the steps in https://github.com/rabbitmq/rabbitmq-autocluster/tree/master/examples/k8s_statefulsets to build the Docker image but I get the following error when starting the service on k8s:

14:36:44.684 [error] Failed to enable plugin "rabbitmq_autocluster": it may have been built with an incompatible (more recent?) version of Erlang

BOOT FAILED
===========

Error description:
    init:start_em/1
    init:start_it/1
    rabbit:start_it/1 line 454
    rabbit:broker_start/0 line 326
    rabbit_plugins:prepare_plugins/1 line 285
    rabbit_plugins:'-prepare_plugins/1-lc$^1/1-1-'/1 line 285
    rabbit_plugins:prepare_dir_plugin/1 line 449
throw:{plugin_built_with_incompatible_erlang,"rabbitmq_autocluster"}
Log file(s) (may contain more information):
   <stdout>

{"init terminating in do_boot",{plugin_built_with_incompatible_erlang,"rabbitmq_autocluster"}}

I build it using erlang 20.0 and elixir 1.4.5. I saw after that the dev requirements mention erlang 17.5 but I wasn't able to find an elixir version that works with erlang 17.5 so I'm not sure how you guys are building it.

Is the Docker image at https://hub.docker.com/r/gsantomaggio/rabbitmq-autocluster/ built using the same steps from the master branch?

michaelklishin commented 7 years ago

The image uses Dockerfile from the stable branch.

The error means that the plugin failed to load, most likely because it was compiled on a different version of Erlang from that on which RabbitMQ is running.

michaelklishin commented 7 years ago

master targets RabbitMQ master. I'd recommend using the stable branch unless you know what you're doing and why you want RabbitMQ master.

adrianchifor commented 7 years ago

@michaelklishin thanks for the info. What version of elixir are you guys using when running make dist ?

michaelklishin commented 7 years ago

@adrianchifor stable targets RabbitMQ 3.6.x which doesn't use Elixir at all.

michaelklishin commented 7 years ago

0.8.0 was produced on Erlang/OTP 19.3.6.

michaelklishin commented 7 years ago

I think @Gsantomaggio know what may be going on. At least one of the images that use this plugin is currently on Erlang 18, which isn't guaranteed to load bytecode files produced by 19.3. We are not aware of any cases where 20 would be unable to load bytecode produced by 19.

Gsantomaggio commented 7 years ago

hi @adrianchifor

https://hub.docker.com/r/gsantomaggio/rabbitmq-autocluster/ is/was my personal temporary image.

we are moving the image here: https://hub.docker.com/r/pivotalrabbitmq/rabbitmq-autocluster/

So if you want to test this example: https://github.com/rabbitmq/rabbitmq-autocluster/tree/stable/examples/k8s_statefulsets

you can to skip the make and build image steps.

you can use pivotalrabbitmq/rabbitmq-autocluster image instead of rabbitmq-autocluster in the rabbitmq.yaml file.

We will update the example soon.

adrianchifor commented 7 years ago

@Gsantomaggio excellent, thanks a lot!

michaelklishin commented 7 years ago

@adrianchifor done in #37.