-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Refactor data node startup, add startup mechanism for new node types #20181
Conversation
…ks for fresh installation of the Graylog cluster
…sn't do the fresh installation detection any more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, works fine and the code seems good to me. But it's still a draft and we need somebody from architecture to look at this, so only commenting, not approving for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A first quick review. Will do testing and a more detailed review next.
data-node/src/main/java/org/graylog/datanode/bootstrap/DatanodeBootstrap.java
Outdated
Show resolved
Hide resolved
data-node/src/main/java/org/graylog/datanode/commands/Datanode.java
Outdated
Show resolved
Hide resolved
data-node/src/main/java/org/graylog/datanode/bootstrap/DatanodeCmdLineTool.java
Outdated
Show resolved
Hide resolved
data-node/src/main/java/org/graylog/datanode/bootstrap/DatanodeCmdLineTool.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/bootstrap/CmdLineTool.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/commands/ExampleCommand.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/commands/ExampleCommandConfiguration.java
Outdated
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/commands/ServerCommandsProvider.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Bernd Ahlers <bernd@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! A few comments.
data-node/src/main/java/org/graylog/datanode/commands/Datanode.java
Outdated
Show resolved
Hide resolved
data-node/src/main/java/org/graylog/datanode/commands/Datanode.java
Outdated
Show resolved
Hide resolved
data-node/src/main/java/org/graylog/datanode/bootstrap/DatanodeBootstrap.java
Outdated
Show resolved
Hide resolved
data-node/src/main/java/org/graylog/datanode/bootstrap/DatanodeBootstrap.java
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/bindings/GraylogNodeModule.java
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/bindings/GraylogNodeModule.java
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/bindings/MongoDbConnectionModule.java
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/commands/AbstractNodeCommand.java
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/featureflag/ImmutableFeatureFlagsCollector.java
Outdated
Show resolved
Hide resolved
@bernd I addressed your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two pings in comments that haven't been answered. (or I didn't see it)
data-node/src/main/java/org/graylog/datanode/bootstrap/DatanodeBootstrap.java
Show resolved
Hide resolved
graylog2-server/src/main/java/org/graylog2/bindings/GraylogNodeModule.java
Outdated
Show resolved
Hide resolved
# Conflicts: # data-node/src/main/java/org/graylog/datanode/bindings/PreflightChecksBindings.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! 🙏
install(new ServerStatusBindings(configuration.withCapabilities())); | ||
|
||
bind(EncryptedValueService.class).asEagerSingleton(); | ||
bind(InputConfigurationBeanDeserializerModifier.class).toInstance(InputConfigurationBeanDeserializerModifier.withoutConfig()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moesterheld: For the server, this binding breaks the saving of inputs that contain encrypted values. You can reproduce it by creating an AWS CloudTrail
where you only set the title (and node) and leave everything else empty. You can save it, but afterwards the inputs page is broken and you have to remove the input manually from MongoDB.
We should either go back to a just-in-time binding (for the server) or do a regular singleton scope binding. I didn't test the latter but it should be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @thll , I will fix this and try to add an automated test that covers this somehow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Yeah, having some kind of integration test for this would be great as the cause is very subtle and hard to find.
Description
Modifies the CmdLineTool to allow configurable startup of new node types.
A
GraylogNodeConfiguration
interface configures certain whether certain common startup features should be run.For a node incorporating the features we deem as common, a
CommonNodeConfiguration
is provided which sets these flags as default.Data node startup has been changed to use the refactored CmdLineTool directly, setting the necessary features as required by the data node. Additionally, bootstrapping of the data node has been revamped. This does not completely decouple the startup logic from Graylog startup, but uses a common codebase instead of the previously duplicated code.
An example node is currently included in the PR to showcase how new node types can be created (
ExampleCommand
). This should be removed before merging./nocl
Motivation and Context
solves #18908
solves #18011
How Has This Been Tested?
run data node, Graylog, certutil, journal commands manually
Screenshots (if appropriate):
Types of changes
Checklist: