powershell - 配置 Elasticsearch

标签 powershell elasticsearch sonarqube

我是采用 sonarqube 的一部分,它遇到了与它所依赖的 Elasticsearch 实例相关的间歇性问题。为了解决这个问题,我认为我需要修改 Elasticsearch 配置值。

\conf\sonar.properties我设置的设置文件
sonar.search.port=9200
当我尝试在浏览器中访问时,这给了我以下信息。

enter image description here

太好了,所以我只需要在 powershell 中构建正确的请求?
Invoke-WebRequest 'localhost:9200' -方法“获取” URI 前缀无法识别 Invoke-WebRequest 'http://localhost:9200/' -Method 'GET' 协议(protocol)违反 Invoke-WebRequest 'localhost:9200' -Method 'XGET' 无法将值“XGET”转换为类型 Invoke-WebRequest 'http://localhost:9200/_all/settings' -Method 'GET' 协议(protocol)违反

如果我直接更改 Elasticsearch 配置,它会重新生成(也许是 Sonar 启动的一部分),所以我认为任何配置都必须以这种方式完成。

任何指针将不胜感激。

最佳答案

我不认为您的 elasticsearch 实例已启动并正在运行,或者其设置为使用 9200 以外的其他端口进行 http。默认情况下,当您通过浏览器访问 ES 时,您至少应该看到如下响应(如果使用 Chrome/Firefox)。如果您使用 IE,它应该会提示将此响应保存为 JSON。

{
  "name" : "ESPOC-NODE1",
  "cluster_name" : "ESPOC",
  "cluster_uuid" : "oZSfvTqmQY-ASngFlxp56A",
  "version" : {
    "number" : "5.5.2",
    "build_hash" : "b2f0c09",
    "build_date" : "2017-08-14T12:33:14.154Z",
    "build_snapshot" : false,
    "lucene_version" : "6.6.0"
  },
  "tagline" : "You Know, for Search"
}

所以首先让你的 ES 工作。然后您可以继续进行 SONAR 设置。

关于powershell - 配置 Elasticsearch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61403607/

相关文章:

exception - 如何将 powershell 异常描述转换为字符串?

powershell - 使用 powershell 从文件中提取函数体

powershell - 在Powershell中通过管道(|)传递 “string”变量不起作用

Javascript - 检查文本/模板脚本中是否存在字段

elasticsearch - 如果在 elasticsearch 中包含多个嵌套文档,则匹配文档

elasticsearch - elasticsearch 中的别名是什么?

redirect - 在 Docker 中运行 sonarqube 不断将我重定向回登录页面

spring - 如何使用gradle属性禁用sonarqube安全热点?

c - Sonar 运行程序无法运行 cppcheck

powershell - 返回的分割值