Commit Graph

27 Commits

Author SHA1 Message Date
Matthias Oesterheld
769b6c0a21 use dependency injection for process and state machine tracer (#19118)
* use dependency injection for process and state machine tracer

* fix forbidden annotations

* move removal logic from tracer to process

* add state machine exception handling

* call reset via statemachine, not process

* do not start os process during configure

* temporary fix of tests

* move start/stop process triggers to state machine

* use state machine instead of process

* fix watchdog test

* move removal tracer test to process and remove tracer

* set statemachine for tracer directly

* trigger `PREPARED` instead of `STARTING` after provisioning, startup is handled by Graylog

* add restart transition for reconfiguring test data node

* add missing transition

* make `fire` with errorEvent private

* remove static process variable

* set tracer in `createNew`

* provide default implementation

* revert to default attempts_count
2024-05-13 06:27:34 +02:00
Matthias Oesterheld
91ded55629 Initial refactoring of data node process/state machine (#19101)
* rename state machine to DataNodeStateMachine to make clear it is not only handling the process anymore

* initial refactoring of packages and classes:
clearly separate processing and opensearch-related classes

* Make ManageableProcess independent from OpensearchStateMachine
2024-04-19 07:23:07 +02:00
Jan Heise
89f1699bd5 DataNode: Added OpenSearch heap setting (#18866)
* added heap setting

* fixed missing property propagation

* fix propagation in insecure startup
2024-04-03 11:50:34 +02:00
Jan Heise
81acc1b60e changing config parameters to Object so we can support yml lists etc. in opensearch.yml (#18799)
Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
2024-03-27 16:40:24 +01:00
Matthias Oesterheld
0a887859ea Move lock file check for data dir to later step (#18636)
* do not write/check for lock file in data dir during preflight test

* remove unnecessary directory read check, handled by validator

* add lockfile check to startup

* remove unused exception

* fix compatibility check url

* add more information and show data node list on restart step

* ignore PROCESS_STOPPED event when in WAITING_FOR_CONFIGURATION state to avoid ugly exception

* fix test and show MigrationDatanodeList
2024-03-15 15:20:53 +01:00
Tomas Dvorak
e620eeb59d Support for searchable snapshots in datanode (#18357)
* Support for searchable snapshots in datanode

* Added changelog

* Code cleanup, extracted s3 repository configuration

* fixed installing of s3 repo plugin

* code cleanup

* Install opensearch plugins from predownloaded zip archives

* fixed configuration key

* output datanode logs in DatanodeSearchableSnapshotsIT if startup fails

* transfer predownloaded opensearch plugins to the datanode docker image

* Set default node.search.cache.size to 10gb

* javadoc, code cleanup

* code cleanup

* fix s3 configuration enabled check, added test

* Add md5 checksum to the s3 repository download
2024-02-27 10:18:58 +01:00
Jan Heise
22504a96e6 DataNode: Process State Machine Refactoring (#18036)
* create a provider for the state machine, inject it

* added license

* fixing provider class
2024-01-31 09:25:16 +01:00
Jan Heise
ac4caca1b4 DataNode: Added new state so that we don't automatically start (#17952)
* added new states

* fix error message

* adding new state to test

* removed doubled line

* start if insecure has been chosen

* adding jump

* always start if everything's confgured

* fixing test
2024-01-29 12:59:37 +01:00
Othello Maurer
8ce9b3f532 Transition from javax to jakarta (#17765)
* Bump jersey version 2.37 -> 3.1.5

* javax.ws.rs:javax.ws.rs-api -> jakarta.ws.rs:jakarta.ws.rs-api

* Ban javax.ws.rs:javax.ws.rs-api dependency

* com.fasterxml.jackson.jaxrs -> com.fasterxml.jackson.jakarta.rs

* javax.validation -> jakarta.validation

* Remove exclusion of hibernate-validator

* jackson-module-jsonSchema -> jackson-module-jsonSchema-jakarta

* Bump hibernate-validator 6.2.5.Final -> 8.0.1.Final

* javax.annotation-api -> jakarta.annotation-api

* Add TODO for banning javax.validation:* dependencies

* Use jakarta.annotation.* where possible

* javax.inject -> jakarta.inject

* Temporarily disable merging master into PR branch when building

* Add javax.persistence to forbidden APIs

* Revert "Temporarily disable merging master into PR branch when building"

This reverts commit dadbeecc0f.

* Fix imports after merge

* Add changelog

* Fix imports after merge

* Add upgrade notes

* javax -> jakarta after merge
2024-01-16 14:07:12 +01:00
Matthias Oesterheld
076db1a460 Publish and show data node state information (#17382)
* publish data node status

* add paginated datanode service

* changelog

* adjust changelog

* adjust NodeImplTest

* refactor initial separation of server node and data node

* fix backward compatibility

* refactor separation of server node and data node

* add timezone

* add new service tests

* add entity tests

* inject DataNodeDto NodeService
2023-11-28 15:02:27 +01:00
Matthias Oesterheld
c6101f395c Remove a data node from the cluster (#17248)
* service, rest & permissions for data node management

* add tests

* add reset data node event

* add states and transitions for node removal
add node removal functionality

* changelog

* add datanode permissions to permission list

* add audit event types to list

* add custom thread factory

* add node removal integration test
refactor rest calls in ITs

* wait for primary shard node availability

* refactor duplicate code

* simplify node retrieval

* add `@OnlyInSecuredNode` annotation and request filter
move delete endpoint to management controller and secure it
adjust IT
change javadoc

* stabilize tests
2023-11-20 13:33:26 +01:00
Jan Heise
d709ae84da DataNode: using hostname as node name default (#17025)
* using the hostname as the default node-name, if none was specified explicitly

* using the hostname as the default node-name, if none was specified explicitly

* using the hostname as the default node-name, if none was specified explicitly

* nodeName is either set explicitly in the conf file or will be the result of the hostname setting otherwise

* small refactoring
2023-10-24 11:01:20 +02:00
Tomas Dvorak
bede9d3206 Refactored all usages of directories used by datanode and managed opensearch (#16905)
* Refactored all usages of directories used by datanode and managed opensearch

* add datanode directories preflight check

* code cleanup

* fixed OpensearchSecurityConfiguration

* Fixed DatanodeDirectories logging

* code cleanup
2023-10-13 08:16:58 +02:00
Jan Heise
9ef803b2b1 DataNode: Fixing discovery process for new nodes (#16661)
* fixing discovery process for new nodes

* only write discovery seeds on start of the opensearch process depending on the list of active nodes.

* fix dependent init

* fix method call to not depend on pre-initialized members

* fixing parameter map creation

* fixing test and using correct parameter

* fixing test, fixing default roles

* fixing tests
2023-09-26 15:20:20 +02:00
Jan Heise
cc52dcb5b0 DataNode: using JWT for authentication/authorisation (#16334)
* jwt implementation, adding preflight + versionprobe

* adding JWT auth to anomaly detection client, some minor refactorings

* added missing license

* added provider, refactorings

* fixing small bugs

* set smaller default expiration

* using the correct OpenSearch distro for the erchitecture

* added config options

* small refactorings, fixing tests, adding dependencies for running tests from inside IntelliJ

* fixing import to correct Duration class

* removing unnecessary debug output

* fixing tests

* fixing tests

* adding JWT to Cluster test

* fixing path

* fixing path problems

* fix architecture logic for DatanodeContainerizedBackend

* fixing path problems

* fixing JWT settings in tests

* fixing JWT settings in tests

* fixing cluster test

* fixing cluster test

* fixing cluster test

* adding missing jwt token

* small refactoring to force thread-safety on creation

* the datanode uses mongodb - so the closing sequence needs to be adjusted

* moving config changes into config file, keep only change that has to be done by code

* adding breaking change info for JWT and clock synchronization.

* renaming config settings

* renaming config settings

* removed debug settings that are no longer in use

* renamed provider/annotation to be more precise

* lowering log level

* smaller refactorings/renamings

* keep config change in code until PR is merged, remove code in a follow-up PR

* moved changelog file to correct folder

* clock synchronsation

Co-authored-by: Dennis Oelkers <dennis@graylog.com>

* added jwt auth into changes after merge

* upped the timeout

* log curl connection information in DatanodeOpensearchWait

* replacing with jwt auth

* changing wait strategy

* fixing imports

* remove uname/pwd from opensearch rest base url

* propagate jwt token provider to http rest client callback, obtain fresh token every time

* inject IndexerJwtAuthTokenProvider in DatanodeConfigurationProvider

* remove rest uname/pwd from datanode configuration

---------

Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com>
Co-authored-by: Dennis Oelkers <dennis@graylog.com>
2023-09-12 11:48:44 +02:00
Dennis Oelkers
b4d1b06dbe Disabling auto-creation for data node. (#16413) 2023-09-11 12:37:47 +02:00
luk-kaminski
e7025a9da8 Insecure startup of OS in datanode only if explicitly configured (#16108)
* Insecure startup of OS in datanode only if explicitly configured

* Data node can be started without starting OS, just to be discovered by pre-flight mode
2023-08-07 17:21:08 +02:00
Tomas Dvorak
e39a53ed2d Refactoring/opensearch security setup (#16087)
* Start datanode jersey only after ssl configuration resolved, listen to change events

* Adapted DatanodeSecuritySetupIT to work with https version of the datanode interface

* simplify hostnames in DatanodeSecuritySetupIT

* code cleanup

* added changelog

* code cleanup

* disable security plugin and perf analyzer in matrix tests opensearch

* Fixed datanode jersey service

* Fixed opensearch instance env

* Opensearch security setup refactored

* code cleanup

* removed commented out code from datanodes JerseyService

* add fqdn to the http cert in the DatanodeSecuritySetupIT

* configure truststore only if the security is enabled

* code cleanup

* reintroduced root certificate finder

* adjusted class and methods visibility of RootCertificateFinder
2023-08-02 14:33:50 +02:00
Jan Heise
34d5b47d2a Include Graylog CA into places where we connect to the DataNode (#15925)
* first version adding gl CA

* adding custom trutstore

* fixed SSLContext

* fixed SSLContext for connectivity check

* fix comments

* fixed imports

* reverting altnames tmp change

* reverting altnames tmp change

* fixed preflightconfig, fixed hostname-verifier

* added credentials to target string, set hostname

* added credentials from target string

* only add TrustManager if https is requested

* fixing tests

* add another alt name

* change creation of restBaseUrl

* DatanodeSecuritySetupIT adaptation for stable hostname of the datanode

* trying to fix naming/binding for docker

* adding another alt name

* added s to http

* changing exception

* more debug output

* change test

* change test

* adding debug

* switch back to http

* more debugging

* more debugging

* added exception to retryer

* fixed boolean eval

* going to the next step on FAILED, too

* fixing if clause

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* cleanup

* removed wrong credentials provider

* added name verifying

* fix alt name handling

* removed unneccessary hostname verifier

* reverted DefaultX509TrustManager

* removed link to DefaultX509TrustManager because it's used in different contexts, singleton for SSL related stuff so we don't instantiate it all the time

* full rollback DefaultX509TrustManager

* reverted change on logging

* revert VersionProbe, unnecessary changes

* DatanodeSecuritySetupIT fixed, separated bind address and hostname

* changed to lambda

* changed to lambda

* small refactorings in csrsigner

* added test for CustomCAX509TrustManager

* added binding for CaService into Preflight

* fixing bindings

* fixing bindings

---------

Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com>
2023-07-21 12:59:55 +02:00
Jan Heise
cfb3386908 DataNode: CA upload/generation or load existing configured CA during startup (#15546)
Co-authored-by: Lukasz Kaminski <lukasz.kaminski@graylog.com>
2023-06-20 15:33:07 +02:00
Tomas Dvorak
9105655645 Code cleanup around opensearch process info (#15709)
* Code cleanup around opensearch process info

* Code cleanup

* fixed naming and test

* fixed test

* fixed test

* code cleanup

* code cleanup
2023-06-19 06:36:32 +02:00
Tomas Dvorak
bc56d397c3 Datanode config separation (#15701)
* Different variants of security configuration (from file, from mongo, insecure).
Encryption/decryption pattern used in practice.

* Reverting temporary changes

* More precise certificate presence check

* Added unit tests for testHasCert() method

* Datanode and opensearch configuration refactored

* code cleanup

* code cleanup

* code cleanup

* Node preflight config service refactored

* restbaseurl moved to OpensearchConfiguration

---------

Co-authored-by: Lukasz Kaminski <lukasz.kaminski@graylog.com>
2023-06-06 14:44:06 +02:00
Tomas Dvorak
5651f90aa9 Process watchdog reimplemented to follow transitions of the process state machine (#15676)
* Process watchdog reimplemented to follow transitions of the process state machine

* code cleanup

* code cleanup
2023-06-02 10:52:24 +02:00
Tomas Dvorak
a487ca2f86 Delay opensearch start till configuration is available (#15615)
* Delay opensearch start till configuration is available

* code cleanup
2023-05-30 10:06:47 +02:00
Tomas Dvorak
2fa7b7b9aa Synchronize opensearch config to a user-defined directory (#15307)
* Synchronize opensearch config to a user-defined directory (fixes #15223)

* fixed check naming

* fixed opensearch configuration location

* simplified Environment constructor

* point gc logs of datanodes opensearch to /tmp for now

* full dir sync for opensearch config

* Fixed full dir sync when removing non-empty dir

* simpified recursive directory deletion
2023-05-02 15:01:12 +02:00
Tomas Dvorak
eba2d54498 Extended preflight check, added logging and adapted state machine transitions (#15149)
* Extended preflight check, added logging and adapted state machine transitions

* fixed opensearch preflight check

* fixed opensearch preflight check, add tests
2023-04-05 18:14:15 +02:00
Tomas Dvorak
21e55cbcb6 Initial Data Node version PR (#14417)
Co-authored-by: Jan Heise <jan.heise@graylog.com>
2023-02-27 13:11:24 +01:00