无法通过运行OpenSearch Docker编写来获取OpenSearch Jmeter 板

l7mqbcuq  于 2023-02-03  发布在  Docker
关注(0)|答案(3)|浏览(156)

我是Windows用户。我安装了Windows Subsystem for Linux [wsl 2],然后使用它安装了Docker。然后我尝试开始使用OpenSearch,所以我按照给定链接https://opensearch.org/downloads.html中的文档操作,并运行docker-composite up。在shell中,我收到如下错误消息
打开搜索控制面板|{“类型”:“日志”,"@时间戳”:“2022-01- 18 T16:31:18 Z”,“标签”:[“错误”,“打开搜索”,“数据”],“pid”:1,“消息”:“[连接错误]:获取地址信息EAI_AGAIN打开搜索节点1打开搜索节点1:9200”}
在端口http://localhost:5601/中,我收到如下消息
OpenSearch Jmeter 板服务器尚未就绪
我也改变了内存的资源首选项为5GB在码头桌面,但它仍然不工作。有人能帮我这个吗?

ws51t4hk

ws51t4hk1#

经过5天的问题与opensearch我已经找到了一些工作对我来说很好:

  • 将Docker内存设置为4GB
  • 并且Docker虚拟机最大Map计数= 262144

然后我使用早期版本的opensearch,因为最新版本似乎不太稳定:

  • 打开搜索项目/打开搜索:1.2.3
  • 打开搜索项目/打开搜索 Jmeter 板:1.1.0
  • 开放搜索项目/日志存储操作系统-带有开放搜索输出插件:7.16.2

下面是我的docker-compose.yml文件:

version: '3'
services:
  opensearch-node1A:
    image: opensearchproject/opensearch:1.2.3
    container_name: opensearch-node1A
    environment:
      - cluster.name=opensearch-cluster
      - node.name=opensearch-node1A
      - discovery.seed_hosts=opensearch-node1A,opensearch-node2A
      - cluster.initial_master_nodes=opensearch-node1A,opensearch-node2A
      - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
      - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536 # maximum number of open files for the OpenSearch user, set to at least 65536 on modern systems
        hard: 65536
    volumes:
      - opensearch-data1:/usr/share/opensearch/data
    ports:
      - 9200:9200
      - 9600:9600 # required for Performance Analyzer
    networks:
      - opensearch-net
  opensearch-node2A:
    image: opensearchproject/opensearch:1.2.3
    container_name: opensearch-node2A
    environment:
      - cluster.name=opensearch-cluster
      - node.name=opensearch-node2A
      - discovery.seed_hosts=opensearch-node1A,opensearch-node2A
      - cluster.initial_master_nodes=opensearch-node1A,opensearch-node2A
      - bootstrap.memory_lock=true
      - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    volumes:
      - opensearch-data2:/usr/share/opensearch/data
    networks:
      - opensearch-net
  opensearch-dashboardsA:
    image: opensearchproject/opensearch-dashboards:1.1.0
    container_name: opensearch-dashboardsA
    ports:
      - 5601:5601
    expose:
      - "5601"
    environment:
      OPENSEARCH_HOSTS: '["https://opensearch-node1A:9200","https://opensearch-node2A:9200"]'
    networks:
      - opensearch-net
  logstash-with-plugin:
    image: opensearchproject/logstash-oss-with-opensearch-output-plugin:7.16.2
    container_name: logstash-with-plugin
    networks:
      - opensearch-net

volumes:
  opensearch-data1:
  opensearch-data2:

networks:
  opensearch-net:
46qrfjad

46qrfjad2#

在Windows 10中使用Docker在本地测试opensearch和opensearch dasboard时打开"http://localhost:5601/"时,我收到了相同的错误消息:

  • OpenSearch Jmeter 板服务器尚未就绪
  • 打开搜索控制面板|{"类型":"日志","@时间戳":"2022 - 02 - 10T12:29:35Z","标签":["错误","打开搜索","数据"],"pid":1,"消息":"[连接错误]:获取地址信息EAI_AGAIN打开搜索节点1打开搜索节点1:9200 "}

但在查看日志时,我还发现了其他错误:

  • 打开搜索节点1|[1]:最大虚拟内存区域vm. max_map_count [65530]太低,请至少增加到[262144]

对我有效的3部分解决方案是:

    • 第一部分**

在每个opensearch节点上更新文件:

/usr/share/opensearch/config/opensearch.yml

并添加行:

plugins.security.disabled: true

在安装安全插件之前:

cks. "Single-node" mode disables them again.
#discovery.type: single-node

plugins.security.disabled: true

######## Start OpenSearch Security Demo Configuration ########
# WARNING: revise all the lines below before you go into production
plugins.security.ssl.transport.pemcert_filepath: esnode.pem

我在opensearch官方网站documentation上找到的信息

    • 第二部分**

将Docker桌面的分配内存设置为4GB到. wslconfig更多信息在这里:opendistrocommunity discussionstackoverflow aloocate memory
使用以下命令确保您分配的内存设置良好(您必须重新启动Docker桌面):docker信息并检查行"总内存",它应该设置为4GB(大约,在我的情况下,它已设置为3.84GiB)

    • 第三部分**

同时增加vm. max_map_count:

  • 开式动力弹
  • wsl-d停靠-桌面
  • 回显"虚拟机最大Map计数= 262144"〉/etc/sysctl. d/99-停靠点-桌面配置文件

该信息创建于here on github discussion

vaqhlq81

vaqhlq813#

我的Opensearch-dashboards示例安装在VM上,但没有使用Docker。该问题是由opensearch-dashboards.yml文件中的搜索引擎连接设置错误引起的。我在此处混淆了https和http协议(opensearch和opensearch-dashboards的设置不匹配):
opensearch.hosts: [https://localhost:9200]

相关问题