Commit Graph

120 Commits

Author SHA1 Message Date
Dennis Oelkers
aacaa0c4d2 Setting up injection/usage of new OpenSearch Java Client. (#17760)
* Adding new additional dependencies.

* Setting up injection infrastructure for new client in parallel.

* Adding license headers.

* Including new deps in test jar.

* Removing jakarta deps from assembly.

* Building separate jars for integration tests & distribution.

* Fix class loader issue

Exclude "module-info.class" files from the graylog-storage-opensearch
JAR file to avoid class loader issues.

Revert previous assembly and dependency changes that worked around the
issue in tests.

* Adjusting to Jakarta and recent data node changes.

* fixing wrong builder usage

---------

Co-authored-by: Bernd Ahlers <bernd@graylog.com>
Co-authored-by: Jan Heise <jan.heise@graylog.com>
2024-01-19 10:37:44 +01:00
Matthias Oesterheld
415cd73080 Add functionality to create data streams (#17910)
* Create Data Stream template, prepare ism policy

* add ism

* create ism and collect jvm heap as first metric

* change lookup and term query to use data streams

* start moving data stream functionality to graylog

* move data stream management into graylog

* code cleanup, add tests

* better validation, clean up after tests

* additional clean up after IT

* don't remove `index-management` plugin from datanode

* inject ObjectMapper

* change number of replicas from default 1 to 0 for test

* set `number_of_replicas` to 0 for .opendistro-ism-config in test

* replace javax with jakarta classes

* fix integration test

* remove data streams on test cleanup

* set high priority for data stream template
2024-01-17 14:45:19 +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
Jan Heise
8039e214cc DataNode: RemoteReindex backend impl (#17485)
* Remote Reindex Backend

* fixing missing classes

* Added integration test for remote reindex migration

---------

Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com>
2024-01-15 09:41:02 +01:00
Jan Heise
b49a543e74 DataNode: Update to OpenSearch 2.11.0 (#17734)
* Update to OpenSearch 2.11.0

* Update to OpenSearch 2.11.0

* reverting test back

* reverting test back

* better handling of waiting for datanode startups in integration tests

---------

Co-authored-by: Tomas Dvorak <tomas.dvorak@graylog.com>
2024-01-10 08:28:36 +01:00
Tomas Dvorak
b0afd6206e Proxy for datanode rest, jwt auth filter for datanode (#17827)
* Proxy for datanode rest, jwt auth filter for datanode

* fixed test

* fixed test

* Fixed passing request body via datanode proxy

* disable entity capturing for datanode rest proxy calls

* datanode rest proxy refactored to okHttp client

* code cleanup, jwt token and auth filter separation

* Removed unused import

* code cleanup, fixed request body issue
2024-01-09 11:48:03 +01:00
Mohamed OULD HOCINE
f0a9ca23ad Datanode List Page UI (#17161)
* cherry picked new datanode page

* initial setup for datanode page navigation

* added DataNodesPageNavigation to pages

* DataNodeList component initial setup

* fix build

* datanode list initial prototype

* fix eslint issues

* add datanode list components

* fix eslint issues

* add new data node button

* prepare column components

* DataNodeStatusCell component

* useDataNodes return type

* fix build

* fix build errors

* fix eslint issues

* initial api integration

* refetch on change

* added removeDataNode & rejoinDataNode endpoints

* datanode actions integration progress

* cleanup DataNodeStatusCell

* DataNodeStatusCell using data_node_status

* refetch list every 5s

* cleanup

* add datanode details page

* update datanode page

* add todo

* add license header

* fix linter

* fix linter

* Updating yarn lockfile (#17528)

Co-authored-by: Gary Bot <garybot2@graylog.com>

* replace quotes

* add confirm dialog for actions

* cleanup status cell

* handle certificate renewal

* remove bulk actions

* add start/stop datanode

* show leader and add cert info to details

* remove is_master

* use correct action on start button

* fix spelling

* fix review

* update Datatable QueryHelper example to use ReactNode

* remove DataNodeBulkActions

* fix query by name

* add check for removal of running nodes

* remove done todo

* fix reset to do a complete restart

* make status and cert_valid_until not sortable

* update spelling

* Update graylog2-web-interface/src/components/datanode/DataNodeList/DataNodeActions.tsx

* Update graylog2-web-interface/src/components/datanode/hooks/useDataNodes.ts

* show remove and rejoin for relevant state

---------

Co-authored-by: Ousmane Samba <ousmanesamba@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Gary Bot <garybot2@graylog.com>
Co-authored-by: Matthias Oesterheld <matthias.oesterheld@graylog.com>
Co-authored-by: Laura <grotlue@users.noreply.github.com>
2023-12-21 10:15:00 +01:00
Patrick Mann
a247edca65 Datanode: ensure password_secret meets length requirement (#17719)
* ensure password_secret meets length requirement

* update CL

* update test

* adjusted wording so it references the data node

---------

Co-authored-by: Jan Heise <jan.heise@graylog.com>
2023-12-15 20:53:32 +01:00
Matthias Oesterheld
c8e34b47a8 add validations for data node lifecycle functions (#17402)
* publish data node status

* add paginated datanode service

* changelog

* adjust changelog

* adjust NodeImplTest

* add start/stop functionality

* changelog

* re-add secured annotation

* 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

* remove clustereventsubscriber registration

* add validations

* add verification tests

---------

Co-authored-by: Ousmane SAMBA <ousmane@graylog.com>
2023-12-05 12:16:39 +01:00
Tomas Dvorak
54c94057e4 Parser for opensearch/elasticsearch data directories (#17487)
* Parser for opensearch/elasticsearch data directories

* add opensearch 1.3 and elasticsearch 6.8.0 to indexer parser

* fixed paths

* code cleanup

* remove explicit dependency version of jackson smile

* Preflight check for index dir compatibility

* indexer dir parser fixed for empty dirs

* added changelog

* rest controller for indices directory parser

* require auth for indices compatibility rest api

* catch incompatibility exceptions of indices dir parsing

* code cleanup

* better dir detection handling

---------

Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
2023-12-01 16:39:37 +01:00
Bernd Ahlers
28f59c326f Fix Data Node system parameters pre-flight check (#17497)
- Read the "max_map_count" from the /proc system instead of calling the
  /sbin/sysctl command
- Only run check on Linux operating systems (avoids warning on FreeBSD)
- Throw "PreflightCheckException" instead of "RuntimeException"
- Don't use "System.out.println()" for logging
- Enhance changelog entry to help users to understand the fix

Refs https://github.com/Graylog2/graylog2-server/pull/17436
2023-11-29 11:34:15 +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
Patrick Mann
72fcbbe960 ignore check on Mac (#17486) 2023-11-27 17:54:53 +01:00
Patrick Mann
a613989e71 Check vm.max_map_count in datanode preflight (#17436)
* check vm.max_map_count in preflight

* CL

* fix command path for macOS

* Revert "fix command path for macOS"

This reverts commit caff2a512b.

* revert unneeded macOS check; rename
2023-11-27 09:14:23 +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
Tomas Dvorak
5a9fc45402 Allow configuring exact datanode directories without automatic nodeid subdirs (#17255)
* Allow configuring exact datanode directories without automatic nodeid subdirs

* added changelog

* use proper locking mechanism to create datanode.lock files

* code cleanup

* code cleanup

* removed unused imports

* fixed test

---------

Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
2023-11-16 11:26:10 +01:00
Tomas Dvorak
473272c703 Remove final flag from ServerBootstrap option variables, they need to be modifiable. (#17169) 2023-11-06 11:21:15 +01:00
Jan Heise
27f79d7913 DataNode: make the cluster name configurable (#17143)
* make the cluster name configurable

* added changelog

* precise, that it's the data node we talk about in the CL

Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>

---------

Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
2023-11-02 11:06:22 +01:00
Tomas Dvorak
220f14eb3b Fix opensearch configuration sync permissions (#17059)
* Fix opensearch configuration sync permissions

* added changelog
2023-11-02 08:36:35 +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
066794fe6f Fix file permissions for key material (#17026)
* Fix file permissions for key material #17009

* added changelog

* correct file permissions for private key used during preflight CSR

* better http and transport keystore files generation

* removed changelog

---------

Co-authored-by: Jan Heise <jan.heise@graylog.com>
2023-10-23 09:52:49 +02:00
Jan Heise
bf0fe158d5 DataNode: Always using the hostname from the configuration in the NodePingPeriodical (#17020)
* using always the hostname from the configuration

* fixing test

* make existing test more meaningful, removed redundant test
2023-10-20 14:47:32 +02:00
Tomas Dvorak
42aa1c36ed add banner for initial datanode start, promoting preflight interface (#17008) 2023-10-20 14:44:17 +02:00
Dennis Oelkers
5e86e92bb0 Data Node: Add reverse lookups for local loopback-addresses as well. (#17022)
* Include local reverse lookups for loopback addresses in CSR.

* Add reverse lookups for local loopback-addresses to CSR.

* Suppressing forbidden method invocation warning.
2023-10-20 14:15:07 +02:00
Dennis Oelkers
63679db27b Do not log state transition when src/dst are identical. (#17027) 2023-10-20 14:14:19 +02:00
Jan Heise
746ed51e69 node registration on startup (#17003) 2023-10-20 12:15:09 +02:00
Jan Heise
2a8139135e DataNode: writing opensearch.yml instead of env vars (#17021)
* writing opensearch.yml instead of env vars

* appending to an existing original config file to be able to check in default config options in git

* remove original config file, always create/write config

* removed unnecessary imports
2023-10-20 12:09:36 +02:00
Tomas Dvorak
5885cd2432 refactor datanode directories checks, use configuration validators (#16942)
* refactor datanode directories checks, use configuration validators

* comments, error messages

* fix datanode config dir in docker

* force image pull strategy for datanode dev container

* remove image pull strategy

* More detailed DirectoryWritableValidator for datanode

* remove commons dependency from UploadedCertFilesSecureConfiguration
2023-10-20 11:33:08 +02:00
Dennis Oelkers
e1ca042919 Adding loopback addresses & primary IP to cert. (#16957)
* Refactor and add `localhost`/loopback addresses to SAN.

* Adding IP address for main hostname as well.

* Working in changes required after merge.
2023-10-17 09:59:50 +02:00
Dennis Oelkers
d6a43647ac Fixing compilation of single module. (#16936)
* Fixing compilation of single module.

* Adding test case to ensure that unwanted plugins are not included/loaded.

* Adding license header.

* Doing simple web frontend change to trigger reviewbot.

* Fixing linter hint.
2023-10-16 15:05:34 +02:00
Dennis Oelkers
96de5251a5 Data Node: Remove unused OpenSearch plugins. (#16906)
* Remove unused OpenSearch plugins.

* Remove now unneeded plugin configs as well.

* Reusing downloaded extracted tarball.
2023-10-13 10:09:54 +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
d510840733 disabling internal user db (#16864)
Co-authored-by: Dennis Oelkers <dennis@graylog.com>
2023-10-12 21:20:52 +02:00
Tomas Dvorak
151c4c4b14 datanode distribution provider refactoring (#16867)
* datanode distribution provider refactoring

* postpone opensearch distribution check till preflight checks

* fixd OpensearchBinPreflightCheck
2023-10-12 08:20:31 +02:00
Jan Heise
34eef1d4f0 disabling hostname verification because of ssl exception (#16875) 2023-10-10 10:46:22 +02:00
Jan Heise
15a513e01d DataNode: full datanode.conf example (#16808)
* extract (imho) all config vars that should get explained

* adding more explanations

* adding more explanations

* adding more explanations
2023-10-09 08:48:18 +02:00
Tomas Dvorak
47571f35e1 better error message with instructions for problems with opensearch distribution location (#16841) 2023-10-06 15:42:08 +02:00
Jan Heise
65f60bd606 adding a validation method (#16840) 2023-10-06 14:44:42 +02:00
Tomas Dvorak
f6c476230e Use random http auth password during preflight web setup (#16749)
* Use random http auth password during preflight web setup

* set initial preflight password once and persist it in mongodb

* refactor structure of the preflight config service, add migration

* add license

* code cleanup

* manually trigger password creation migration in preflight

* Fixing up import.

* fixed preflight auth filter init

* migrations for prefligh boot phase

* code cleanup

* add migration to the PreflightWebModule

* fix injector reference in preflight migrations

* Include logo, make sure that all relevant information is shown at last.

* Consolidating banner logging into single call.

---------

Co-authored-by: Dennis Oelkers <dennis@graylog.com>
2023-10-06 08:17:36 +02:00
Tomas Dvorak
087eb93139 Re-enable hostname verification in opensearch #16219 (#16810) 2023-10-05 08:04:17 +02:00
Jan Heise
38b9e9066b DataNode: Simplifying hostname usage Part 2 (#16741)
* simplifying hostname usage part2

* added suppress message

* removed comment
2023-09-29 08:09:33 +02:00
Matthias Oesterheld
e218e8ffdd switch injection from implementation to interface (#16740)
* switch injection from implementation to interface

* add explicit binding to interface

* add explicit binding to interface
2023-09-28 14:08:33 +02:00
Jan Heise
8b47f440c4 removing unneccessary URI usage (#16724) 2023-09-27 16:41:57 +02:00
Jan Heise
dd1a67dbbf Datanode: setting initial master nodes simplification (#16712)
* automatic initial manager nodes

* fixing binding

* removing unneccessary URI usage
2023-09-27 13:14:43 +02:00
Jan Heise
d0d96a9465 DataNode: Automatic initial manager nodes (#16692)
* automatic initial manager nodes

* fixing boolean expression

* fixing binding

* fixing default from config
2023-09-27 11:16:14 +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
15d3924130 using the machine's hostname as nodename if none was provided in the config (#16607) 2023-09-22 15:20:59 +02:00
Jan Heise
0364446c1b removing obsolete single-node setting (#16542) 2023-09-19 13:41:54 +02:00
Jan Heise
2478e29640 added the root user to the interface, removed obsolete env vars (#16500) 2023-09-19 09:16:55 +02:00
Jan Heise
cc266351fb only set the key, rest of config is in config file (#16442) 2023-09-16 07:32:52 +02:00