mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
* mq broker: let an embedding command own the broker's start failure and shutdown startQueueServer now returns an error when the broker cannot start instead of exiting, binds its port before creating the broker so one that cannot serve never registers with the master, and stops when an optional shutdownCtx is cancelled. Profiling setup moves to weed mq.broker, since an embedded broker read the standalone command's profile flags. weed mq.broker and weed server -mq.broker still exit on a start failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: run a message queue broker beside the gateway by default weed s3 now starts a broker on -mq.broker.port (17777) once it has reached its filer, using the masters and filer group the filer reports. The broker is its own gRPC server: it binds the gateway's -ip.bind, advertises the address the gateway registers with the master, and joins the cluster like any other broker. It stops with the gateway. A broker that cannot start, say because the port is taken, is logged and the gateway keeps serving. -mq.broker=false turns it off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * server: start the message queue broker with the S3 gateway weed server -s3 now runs a broker beside its gateway, started by the gateway once it reaches the filer. -mq.broker=false leaves it out. An explicit -mq.broker or -mq.agent still starts the broker on its own, and then the gateway does not start a second one. Only that explicit broker exits the server when it cannot start; the one that comes with -s3 is logged, so a host already running a broker on the port keeps its gateway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mini: run the message queue broker beside the S3 gateway weed mini now starts a broker with its S3 gateway on -mq.broker.port (17777, below the Linux ephemeral range), binding and advertising mini's -ip.bind and -ip like the other services. The port joins mini's port layout, so a taken port moves to the next free one unless it was given explicitly. The broker stops with the gateway, before the filer it flushes to. -mq.broker=false or -s3=false leaves it out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: start the message queue broker with the S3 gateway weed filer -s3 now runs a broker beside its gateway on -s3.mq.broker.port (17777), the same way weed server -s3 does: it binds and advertises where the gateway does, takes the filer's -dataCenter and -rack, stops with the gateway, and a broker that cannot start is logged while the gateway keeps serving. -s3.mq.broker=false leaves it out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mini: list the message queue broker when it is running The S3 gateway now binds its broker's port before it starts serving, as it does for the Iceberg and Lance listeners, and records whether the bind worked. Once mini sees the S3 port answer, the result is final: the progress board shows the broker ready or failed, and the welcome banner lists its address only when it bound. With -mq.broker=false or -s3=false neither shows it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: keep the default broker off the gateway's own ports The broker binds before the gateway binds its ports, so a gateway started with -port=17777, -port.grpc=17777 or -port=7777 (gRPC port 17777) lost its port to the default broker and exited. weed s3, weed server -s3 and weed filer -s3 now compare the broker port with the gateway's HTTP, HTTPS, gRPC, Iceberg, Lance and metrics ports first. A default broker port that clashes skips the broker with a warning; a broker port given on the command line that clashes is an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mini: reserve explicitly set gRPC ports before placing other ports Mini only kept derived gRPC ports free while it placed the other services, so the broker's default port could take an explicit -s3.port.grpc=17777 and push the S3 gRPC server to another port. An explicit gRPC port is now reserved too: the default broker moves off it, and an explicit broker port on it is rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * server: keep the default broker off the ports of the servers it starts With -volume.port=7777 the volume gRPC port is 17777, the default broker port. The volume server binds its gRPC port only after a master answers, so the broker could take it first and the whole process exited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mini: keep an explicit gRPC reservation when a derived one moves When the filer's HTTP port was taken and moved, dropping its old derived gRPC port also dropped an explicit -s3.port.grpc on the same port, so an explicit -mq.broker.port could share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * server: bind the broker beside S3 where the gateway binds With -ip.bind=0.0.0.0 -s3.ip.bind=127.0.0.1 the broker that comes with the gateway listened on every interface. It now takes the gateway's bind and advertised address, as under weed s3 and weed filer -s3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * server: keep the default broker off the volume public port Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * mq broker: report a bad TLS config instead of exiting The embedded broker loaded grpc.msg_broker TLS through LoadClientTLS and LoadServerTLS, which exit on a bad config, so a cert without a key or without grpc.ca took the whole S3 gateway down. The broker now loads TLS before binding through the error-returning loaders, exported from the security package as TryLoadClientTLS and TryLoadServerTLS, and returns the error like any other start failure: the gateway logs it and keeps serving, while weed mq.broker and weed server -mq.broker still exit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * s3: start the gateway's broker by default only with broker TLS Without grpc.msg_broker TLS the broker accepts any peer, so the broker beside weed s3, weed server -s3 and weed filer -s3 now starts on its own only when grpc.msg_broker has a cert and key in security.toml. Otherwise it stays off and the gateway logs one line saying so and that -mq.broker=true (-s3.mq.broker=true for the filer) runs it without TLS. An explicit true starts it either way and an explicit false keeps it off. weed mini, a single-process dev setup, keeps its broker on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: keep the default broker off the ports of the servers it starts weed filer -s3 checked the broker port only against the gateway's ports, so with -webdav -webdav.port=17777 the broker could bind 17777 first and WebDAV then took the whole filer down. The check now also covers the filer's own HTTP, gRPC and read-only ports, its metrics port, and the WebDAV, IAM and SFTP ports when those run, as weed server does. A default broker port that clashes skips the broker with a warning; a clashing -s3.mq.broker.port is an error before the servers start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * server: keep the default broker off the filer read-only and debug ports The port check beside -s3 left out -filer.port.public and, with -debug, -debug.port, so a broker on 17777 could still take a port the filer or the debug server binds. Both are now in the list. WebDAV, SFTP and IAM were already covered when enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>