diff options
author | Jacek <jacek.poreda@sonarsource.com> | 2020-01-09 09:26:53 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-11-05 20:06:21 +0000 |
commit | f4751bd13509f8d325d17cb4cf4ed9d85025f65f (patch) | |
tree | 369137df20a5df287bf77cdb7dcf49888f282f31 /sonar-application | |
parent | 8cdee7d30f96e87b8bb7ec55fdfd8101ab717dfd (diff) | |
download | sonarqube-f4751bd13509f8d325d17cb4cf4ed9d85025f65f.tar.gz sonarqube-f4751bd13509f8d325d17cb4cf4ed9d85025f65f.zip |
SONAR-12686 upgrade es client to 7.9.3 and move to HTTP
- add should minimum match eq 1 to user index queries
ES 7.X changed behaviour in case filter query with bool it defaults to '0'
https://www.elastic.co/guide/en/elasticsearch/reference/7.x/breaking-changes-7.0.html#_the_filter_context_has_been_removed
- fix issue index routing param
ES 7.X helped discover this bug as new setting has been auto configured which is 'index.number_of_routing_shards'.
This has changed how documents are distributed across shards depending on how many shards the index has.
Without that change issues docs has been incorrectly routed to the same shard hash as projects and it worked no matter what routing key you used projectUuid or auth_projectUuid.
- update ngram and edge_ngram names to match with es 7.x
nGram and edgeNgram has been deprecated in favour of ngram and edge_ngram
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#deprecated-ngram-edgengram-token-filter-cannot-be-used
- remove `_all : enabled` usage from UT
This field was already deprecated in 6.X, now it has been removed.
https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes-7.0.html#all-meta-field-removed
- add Elasticsearch High Level REST client dependency
- use sonar.search.port for ES HTTP
- main process use ES Rest client to check ES status
- sonar.cluster.search.hosts has HTTP ports on APP nodes
also sonar.search.port and sonar.search.host MUST be configured on each Search node with the host and HTTP port of the current node
- use Elasticsearch high level rest client
- use in EsTester
- use as primary es client
- use indices api to get all indices name instead of cluster api
- use cluster health api to check cluster state
- support raw requests for 'nodes/_stats' and '_cluster/stats'
- support raw requests for 'indices/_stats'
- leave netty4plugin as testCompile dependency it is used in UTs
- all ES non-test calls go through EsClient class
- add rest client ES profiling
Diffstat (limited to 'sonar-application')
-rw-r--r-- | sonar-application/build.gradle | 2 | ||||
-rw-r--r-- | sonar-application/src/main/assembly/conf/sonar.properties | 10 | ||||
-rw-r--r-- | sonar-application/src/main/java/org/sonar/application/App.java | 1 |
3 files changed, 2 insertions, 11 deletions
diff --git a/sonar-application/build.gradle b/sonar-application/build.gradle index e9a4d6d8952..4b433567978 100644 --- a/sonar-application/build.gradle +++ b/sonar-application/build.gradle @@ -30,7 +30,7 @@ dependencies { // please keep list ordered compile 'org.slf4j:slf4j-api' - compile 'org.elasticsearch.client:transport' + compile 'org.elasticsearch.client:elasticsearch-rest-high-level-client' compile project(':server:sonar-ce') compile project(':server:sonar-main') compile project(':server:sonar-process') diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index 6ce66482775..6ca7452a06e 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -271,7 +271,7 @@ # Same as previous property, but allows to not repeat all other settings like -Xmx #sonar.search.javaAdditionalOpts= -# Elasticsearch port. Default is 9001. Use 0 to get a free port. +# Elasticsearch port for incoming HTTP connections. Default is 9001. Use 0 to get a free port. # As a security precaution, should be blocked by a firewall and not exposed to the Internet. #sonar.search.port=9001 @@ -413,11 +413,3 @@ # We don't collect source code or IP addresses. And we don't share the data with anyone else. # To see an example of the data shared: login as a global administrator, call the WS api/system/info and check the Statistics field. #sonar.telemetry.enable=true - - -#-------------------------------------------------------------------------------------------------- -# DEVELOPMENT - only for developers -# The following properties MUST NOT be used in production environments. - -# Elasticsearch HTTP connector -#sonar.search.httpPort=-1 diff --git a/sonar-application/src/main/java/org/sonar/application/App.java b/sonar-application/src/main/java/org/sonar/application/App.java index 5ab3ae12142..d7f7341aaf0 100644 --- a/sonar-application/src/main/java/org/sonar/application/App.java +++ b/sonar-application/src/main/java/org/sonar/application/App.java @@ -42,7 +42,6 @@ public class App { private final JavaVersion javaVersion; private StopRequestWatcher stopRequestWatcher = null; private StopRequestWatcher hardStopRequestWatcher = null; - public App(JavaVersion javaVersion) { this.javaVersion = javaVersion; } |