-
Notifications
You must be signed in to change notification settings - Fork 3.9k
enabled_plugins file should be stored in /var/lib/rabbitmq #2234
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
Comments
Makes sense 👍 |
@lukebakken @michaelklishin I believe the broker won't start without a writable |
So the behavior that I now have in mind is: I believe this should be safe for upgrades, as with an existing read and writable file in /etc, the behavior is unchanged aside from the log messages. |
That sounds reasonable to me. |
OK! |
Work in progress is here: rabbitmq/rabbitmq-common#369 |
After some further consideration, if the file is present in |
I have solved the docker issue that I was running into, and the fix is here rabbitmq/rabbitmq-server-release#126 I believe these changes are now ready to go. |
#2298 handles the change in the broker, but I'll need to make a corresponding change to the cli to handle use of the |
We look for the enabled_plugins file at the deprecated location, and at the new location. If it exists only at the deprecated location, we attempt to use that file. If the deprecated location is read-only, we allow the cli command to fail (or not) as it always used to. Part of the changes intended to address rabbitmq/rabbitmq-server#2234
Now addressed in the CLI with rabbitmq/rabbitmq-cli#407 |
We look for the enabled_plugins file at the deprecated location, and at the new location. If it exists only at the deprecated location, we attempt to use that file. If the deprecated location is read-only, we allow the cli command to fail (or not) as it always used to. Part of the changes intended to address rabbitmq/rabbitmq-server#2234
We look for the enabled_plugins file at the deprecated location, and at the new location. If it exists only at the deprecated location, we attempt to use that file. If the deprecated location is read-only, we allow the cli command to fail (or not) as it always used to. Part of the changes intended to address rabbitmq/rabbitmq-server#2234
To elaborate on the CLI changes, based on @michaelklishin 's helpful input I decided to simplify the approach taken there. In the CLI, if the |
We look for the enabled_plugins file at the deprecated location, and at the new location. If it exists only at the deprecated location, we attempt to use that file. If the deprecated location is read-only, we allow the cli command to fail (or not) as it always used to. Part of the changes intended to address rabbitmq/rabbitmq-server#2234
I looked at the patches from @pjk25 and they look good to me. That said, I believe we still have a deeper issue with that file. And if users and us will have to go through some kind of migration plan, I would prefer we fix the actual problem. To me, this file has two incompatible uses:
Nobody should consider it a configuration file, but its location on Unix says the opposite and there is no other way for configuration management tools to configure RabbitMQ plugins. I'm sure this leads to some surprises like "I disabled that plugin using rabbitmq-plugins(8) but the plugin is back! WTF!" if the configuration management tool "fixed" the configuration. I think we should first split the two uses:
Now that we (almost) support many small files (#2277), we should think about a solution to:
What do you think? |
Assuming that configuration file would only need schema files from plugins, that could work. If we'd depend on schema files from enabled plugins, there's a chicken-and-egg problem. |
Conflicts between explicit operator actions and what deployment tools do are not specific to this file or RabbitMQ in general. I think this is more or less obvious to operators. |
If plugins can be enabled/disabled with the Configuring plugins via file rather than additional cli commands will be the most common path in the k8s world in my opinion, so I think it deserves first class support of some kind. What currently feels most "right" to me as a goal would be that The currently enabled plugins would continue to be written to |
Plugins are in the code path, enabled or not, and |
We have to persist that list somewhere, but I see what you mean. That's exactly my point: we should decouple the state recording from the configuration part. |
I suggest that we adopt a solution like this and consider changing the way plugin state is stored and preconfigured for 4.0. |
Before we get too fancy, just remember the original problem is that |
I just discovered that the management plugin expects to be able to determine the location from the env, and crashes with the current code. Looks like I have more to do before this is ready to go. |
My comment above can be disregarded. I was running mismatched branches in my build of the broker. |
Given docker-library/rabbitmq#410 (comment), I'm now tempted to say that the file should stay put for now. Basically, in the docker context, we should not assume What does everyone think about me closing this issue and related PRs? I think the |
Why not take these changes "all the way" at this point in time and separate config vs state correctly? This is the correct fix since we can't assume The |
My impression was that To fix this properly, I think we have to assume that the config files aren't writable, or at least offer a mode of behavior that supports it. That's the real k8s pattern as I see it - config files get injected read only. kubernetes/kubernetes#62099 (comment) & https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#add-configmap-data-to-a-specific-path-in-the-volume I don't know if that would be too big a change for 3.8.5. But, what if we
Once the public docker takes the new approach (it relies on |
Let's think of this from an operator's point of view.
Ensure that Or, create
Use the CLI command. Changes to the running set of plugins are saved in
I suspect this is a very rare scenario. Modify So having said all that I think the current set of changes suffice. |
The latter scenario is how most CI scripts work. They start a node and then use |
It's not yet clear to me where we landed on this. If we apply the change, it breaks the management variants of the public docker image. They would have to make some changes to the Dockerfiles, to support it. Maybe we are okay with that, but it wouldn't be my first choice, especially because there would still be some limitations for child docker files. If not for the above, I'd be in favor of merging these changes now. Maybe a suitable option is to contribute the necessary fix in advance to https://github.com/docker-library/rabbitmq. I'll take a look at what that would entail, and open an appropriate PR. |
I have opened docker-library/rabbitmq#416 |
[159039271]
System daemons should not expect to write to
/etc
. This causes issues in environments like docker where/etc
is frequently on a read-only FS.https://groups.google.com/d/topic/rabbitmq-users/DuxRP0zrMdA/discussion
It's unusual for an application to write to /etc, and as the above mailing list discussion shows, /etc is sometimes mounted read-only.
We should investigate supporting the plugins file first in /var/lib/rabbitmq, falling back to /etc/rabbitmq.
The text was updated successfully, but these errors were encountered: