Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么我不能从我的dotnet核心应用程序同时连接到弹性搜索容器和PostgreSQL(我在本地安装的)?_Postgresql_Docker_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_.net Core_Docker Compose - Fatal编程技术网 elasticsearch,.net-core,docker-compose,Postgresql,Docker,elasticsearch,.net Core,Docker Compose" /> elasticsearch,.net-core,docker-compose,Postgresql,Docker,elasticsearch,.net Core,Docker Compose" />

为什么我不能从我的dotnet核心应用程序同时连接到弹性搜索容器和PostgreSQL(我在本地安装的)?

为什么我不能从我的dotnet核心应用程序同时连接到弹性搜索容器和PostgreSQL(我在本地安装的)?,postgresql,docker,elasticsearch,.net-core,docker-compose,Postgresql,Docker,elasticsearch,.net Core,Docker Compose,这是我的docker-compose.yml文件。 我已经在本地安装了postgresql和pgadmin。当我的应用程序与postgresdb连接时,将不会在弹性搜索中创建索引,但如果与db的连接失败,将创建索引! 对于ASP.net,我使用端口5000;对于Postgres端口5432,必须添加PostgreSQL配置端口和ASP.net端口。可能有相同的elasticsearch端口?对于ASP.net,我使用端口5000,对于Postgres端口5432,请使用此新的详细信息更新问题。

这是我的docker-compose.yml文件。 我已经在本地安装了postgresql和pgadmin。当我的应用程序与postgresdb连接时,将不会在弹性搜索中创建索引,但如果与db的连接失败,将创建索引!
对于ASP.net,我使用端口5000;对于Postgres端口5432,必须添加PostgreSQL配置端口和ASP.net端口。可能有相同的elasticsearch端口?对于ASP.net,我使用端口5000,对于Postgres端口5432,请使用此新的详细信息更新问题。
version: "3.3"

services:
  
  kibana:
    container_name: kibana
    image: kibana:7.12.1
    ports:
      - 5601:5601
    depends_on:
      - elasticsearch
    environment:
      - ELASTICSEARCH_URL=http://localhost:9200
    networks:
      - elastic

  elasticsearch:
    container_name: elasticsearch
    image: elasticsearch:7.12.1
    ports:
      - 9200:9200
    volumes:
      - elasticsearch-data:/usr/share/elasticsearch/data
    environment:
      - xpack.monitoring.enabled=true
      - xpack.watcher.enabled=false
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - discovery.type=single-node
    networks:
      - elastic

networks:
  elastic:
    driver: bridge

volumes:
  elasticsearch-data:enter code here