Commit Graph

1269 Commits

Author SHA1 Message Date
Michael Klishin bffc5d519c
Correct a couple of typos 2023-05-02 16:48:14 +04:00
Michael Klishin c9221bd717
Improve rabbitmq-queues {add,delete}_member error messages
when target queue was not found.
2023-05-02 13:28:29 +04:00
Michael Klishin d5f16d4ce6
mix format 2023-05-02 13:08:31 +04:00
Michael Klishin e8cb0c4947
rabbitmq-queues add_member: improve error reporting 2023-05-02 12:14:48 +04:00
Michael Klishin 29d17f05cd
rabbitmq-queues add_member: extract the correct argument
during execution environment validation.
2023-05-02 12:14:26 +04:00
Michael Klishin 247452de5d
rabbitmq-queues add_member: add a missing import 2023-05-02 11:08:00 +04:00
Michael Klishin d4a2d48cea
rabbitmq-queues: validate cluster membership of the argument
Specifically of the node where new replicas should be
placed.

Closes #8007
2023-05-02 10:55:31 +04:00
Michael Klishin 26ebd5c061
Merge pull request #7970 from rabbitmq/mk-silence-remote-shell-dialyzer-on-otp-26
CLI: more OTP 26 compatibility for remote_shell
2023-04-24 21:44:51 +04:00
Michael Klishin 57cd750a1a mix format 2023-04-24 21:16:41 +04:00
Michael Klishin 4e41246415 CLI: more OTP 26 compatibility for remote_shell
shell:start_interactive/1 takes a {node(), mfa()}, not
{node(), atom(), atom(), non_neg_integer()}
2023-04-24 20:54:13 +04:00
Michael Klishin ddf7926941 CLI: make input ordering preditable when formatting a table
if the input is given as a map.

References #7931, #7921
2023-04-24 14:50:31 +04:00
Michael Klishin cec151df59
Introduce a way to update virtual host metadata using CLI tools (#7914)
Introduce 'ctl update_vhost_metadata'

that can be used to update the description, tags or default queue type of
any existing virtual hosts.

Closes #7912, #7857.

#7912 will need an HTTP API counterpart change.
2023-04-18 02:54:37 +04:00
Michael Klishin f1a922a17c Virtual host limit: error type naming
vhost_precondition_failed => vhost_limit_exceeded

vhost_limit_exceeded is the error type used by
definition import when a per-vhost is exceeded.
It feels appropriate for this case, too.
2023-04-01 23:11:48 +04:00
Simon Unge 574ca55a3f See #7777. Use vhost_max to stop vhost creation in rabbitmq 2023-03-31 12:18:16 -07:00
Rin Kuryloski 0be0b7f82d
Merge pull request #7692 from rabbitmq/rin/rabbitmq-cli-branch-switching
fix up bazel build of rabbitmq_cli when branch switching
2023-03-30 08:46:49 +02:00
Michael Klishin 2b1a80f1e9
Merge pull request #7717 from rabbitmq/rabbitmq-server-7716
CLI: correctly override DocGuide.virtual_hosts path segment
2023-03-22 10:32:28 +04:00
Michael Klishin 4741b7a6f7 CLI: define a couple more doc guides 2023-03-22 10:31:55 +04:00
Michael Klishin 94cae1d3ed CLI: correctly override DocGuide.virtual_hosts path segment
Closes #7716
2023-03-22 10:21:04 +04:00
Rin Kuryloski 5d27b3c246 Fix a compiler warning in the cli 2023-03-21 15:24:27 +01:00
markus812498 e676ab7067 added :streams to the help command scopes 2023-03-09 15:01:05 +13:00
Loïc Hoguin 74ce1a4bcc
Fix rabbitmq-diagnostics remote_shell for 26.0 (#7441) 2023-02-27 15:27:32 +01:00
Luke Bakken f420487e5e
Add documentation for hashing passwords
Fixes #7432

Adds HTTP API documentation as well as `rabbitmqctl hash_password` docs.

Add `rabbitmqctl` docs
2023-02-26 15:16:38 -08:00
Luke Bakken d9d6e1bef6
Move rabbit_password to rabbit_common
This allows `rabbitmqctl hash_password` to run without having RabbitMQ up.

Follow-up to:
* #5957
* #7003
2023-02-25 09:53:46 -08:00
Luke Bakken b0d2f94eed
Remove RABBITMQ_ERLANG_COOKIE warning
Fixes #7262
2023-02-22 13:09:01 -08:00
Jean-Sébastien Pédron 42bcd94dce
rabbit_db_cluster: New module on top of databases clustering
This new module sits on top of `rabbit_mnesia` and provide an API with
all cluster-related functions.

`rabbit_mnesia` should be called directly inside Mnesia-specific code
only, `rabbit_mnesia_rename` or classic mirrored queues for instance.
Otherwise, `rabbit_db_cluster` must be used.

Several modules, in particular in `rabbitmq_cli`, continue to call
`rabbit_mnesia` as a fallback option if the `rabbit_db_cluster` module
unavailable. This will be the case when the CLI will interact with an
older RabbitMQ version.

This will help with the introduction of a new database backend.
2023-02-22 15:28:04 +01:00
Rin Kuryloski 609171ec70 Rename the tanzu cli scope to vmware
And update other references to commercial editions
2023-02-16 13:49:54 +01:00
Michael Klishin d0dc951343
Merge pull request #7058 from rabbitmq/add-node-lists-functions-to-clarify-intent
rabbit_nodes: Add list functions to clarify which nodes we are interested in
2023-02-13 23:06:50 -03:00
David Ansari 575f4e78bc Remove compatibility for feature flag stream_queue
Remove compatibility code for feature flag `stream_queue`
because this feature flag is required in 3.12.

See #7219
2023-02-13 15:31:40 +00:00
Jean-Sébastien Pédron d65637190a
rabbit_nodes: Add list functions to clarify which nodes we are interested in
So far, we had the following functions to list nodes in a RabbitMQ
cluster:
* `rabbit_mnesia:cluster_nodes/1` to get members of the Mnesia cluster;
  the argument was used to select members (all members or only those
  running Mnesia and participating in the cluster)
* `rabbit_nodes:all/0` to get all members of the Mnesia cluster
* `rabbit_nodes:all_running/0` to get all members who currently run
  Mnesia

Basically:
* `rabbit_nodes:all/0` calls `rabbit_mnesia:cluster_nodes(all)`
* `rabbit_nodes:all_running/0` calls `rabbit_mnesia:cluster_nodes(running)`

We also have:
* `rabbit_node_monitor:alive_nodes/1` which filters the given list of
  nodes to only select those currently running Mnesia
* `rabbit_node_monitor:alive_rabbit_nodes/1` which filters the given
  list of nodes to only select those currently running RabbitMQ

Most of the code uses `rabbit_mnesia:cluster_nodes/1` or the
`rabbit_nodes:all*/0` functions. `rabbit_mnesia:cluster_nodes(running)`
or `rabbit_nodes:all_running/0` is often used as a close approximation
of "all cluster members running RabbitMQ". This list might be incorrect
in times where a node is joining the clustered or is being worked on
(i.e. Mnesia is running but not RabbitMQ).

With Khepri, there won't be the same possible approximation because we
will try to keep Khepri/Ra running even if RabbitMQ is stopped to
expand/shrink the cluster.

So in order to clarify what we want when we query a list of nodes, this
patch introduces the following functions:
* `rabbit_nodes:list_members/0` to get all cluster members, regardless
  of their state
* `rabbit_nodes:list_reachable/0` to get all cluster members we can
  reach using Erlang distribution, regardless of the state of RabbitMQ
* `rabbit_nodes:list_running/0` to get all cluster members who run
  RabbitMQ, regardless of the maintenance state
* `rabbit_nodes:list_serving/0` to get all cluster members who run
  RabbitMQ and are accepting clients

In addition to the list functions, there are the corresponding
`rabbit_nodes:is_*(Node)` checks and `rabbit_nodes:filter_*(Nodes)`
filtering functions.

The code is modified to use these new functions. One possible
significant change is that the new list functions will perform RPC calls
to query the nodes' state, unlike `rabbit_mnesia:cluster_nodes(running)`.
2023-02-13 12:58:40 +01:00
Michael Klishin 7b5e8a9955
ctl add_vhost: minor improvements to help output 2023-02-09 15:12:51 -05:00
Michael Klishin ab99ccfa45
Introduce a CLI command that grants permissions to all virtual hosts
Closes #1000
2023-02-06 13:07:09 -05:00
Rin Kuryloski 0ac62a4a3b Forward-port dialyzer related rabbitmq_cli fixes from #7122 2023-02-01 23:21:10 +01:00
Michael Klishin 6fd7b983d8
Merge pull request #7135 from rabbitmq/mk-report-total-core-count-cluster-status
List CPU core count in 'rabbitmq-diagnostics cluster_status'
2023-02-01 06:45:41 -05:00
Michael Klishin 1f902fd016
mix format 2023-01-31 20:57:11 -05:00
Michael Klishin cee705b99f
List CPU core count in 'rabbitmq-diagnostics cluster_status'
Both to simplify troubleshooting in some cases and to make it
easier to spot licensing irregularities.
2023-01-31 20:37:44 -05:00
Michael Klishin 2cf2133a44
Fix one more issue reported by CLI tools Dialyzer
(cherry picked from commit 5d8ba2f32a)
2023-01-31 17:47:24 -05:00
Rin Kuryloski bdb2046185
Add rabbitmq_cli dialyze to bazel (#7066)
* Add rabbitmq_cli dialyze to bazel

and fix a number of warnings

Because we stop mix from recompiling rabbit_common in bazel, many
unknown functions are reported, so this dialyzer analysis is somewhat
incomplete.

* Use erlang dialyzer for rabbitmq_cli rather than mix dialyzer

Since this resolves all of the rabbit functions, there are far fewer
unknown functions.

Requires yet to be released rules_erlang 3.9.2

* Temporarily use pre-release rules_erlang

So that checks can run on this PR without a release

* Fix additional dialyzer warnings in rabbitmq_cli

* rabbitmq_cli: mix format

* Additional fixes for ignored return values

* Revert "Temporarily use pre-release rules_erlang"

This reverts commit c16b5b6815.

* Use rules_erlang 3.9.2
2023-01-31 15:05:52 +01:00
Simon Unge 03617f681c See #5957. Accept empty arg and prompt for password 2023-01-26 11:46:24 -08:00
Alexey Lebedeff a9b44f017c Fix all dialyzer warnings in `rabbitmq_stomp` 2023-01-25 16:13:10 +01:00
Simon Unge 67bc94ed16 See #5957. CLI command to generate hashed password from cleartext password 2023-01-23 14:47:29 -08:00
Rin Kuryloski 08d641a1a9 Fix dialyzer warnings revealed from previous commit 2023-01-19 17:29:29 +01:00
Michael Klishin 9d69a4b325
CLI: mix format 2023-01-16 09:24:37 -08:00
Michael Klishin 226a7603e8
diagnostics check_port_connectivity: support --address
For scenarios where node hostname resolution on the invoking
host is not a suitable option and a particular address
should be tried instead.

Closes #6853.
2023-01-16 09:24:37 -08:00
Alexey Lebedeff 2c4e4fb691 Fix all dialyzer warnings in rabbitmq_stream
There are some elixir-related messages about undefined functions, but
they don't produce warnings (yet).
2023-01-16 17:11:24 +01:00
Rin Kuryloski d3794cf2c0 Conform vhost tags to a list when set with the cli in all cases
`rabbitmqctl add_vhost myvhost --tags "my_tag"` would not previously
conform "my_tag" to a list before setting vhost metadata, which could
cause crashes when the list was read.
2023-01-13 10:06:11 +01:00
Jean-Sébastien Pédron 8bad27b16d
rabbitmq_cli: Fix typo where we set `rabbit`'s `data_dir` environment variable
The application name was incorrect, leading to errors when trying to use
this data dir as part of the `forget_cluster_node` command.
2023-01-12 15:33:31 +01:00
Michael Klishin ec4f1dba7d
(c) year bump: 2022 => 2023 2023-01-01 23:17:36 -05:00
Michal Kuratczyk 4160dac33e
Check if stream coordinator is quorum critial 2022-12-22 10:02:13 +01:00
Arnaud Cogoluègnes d3caa1cdaa
Merge pull request #6440 from rabbitmq/stream-balancing
Streams rebalancing
2022-12-14 16:51:30 +01:00
Arnaud Cogoluègnes 41c6e55c2a
Fix typos 2022-12-13 11:01:35 +01:00