首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法分配请求的地址::1:

无法分配请求的地址::1:
EN

Stack Overflow用户
提问于 2020-04-14 07:21:21
回答 1查看 3.8K关注 0票数 4

我一直在尝试将一个开放发行版的镜像推送到一个节点上。我已经把一个yaml脚本放在一起,它可以做到这一点,但在进入pod并试图卷曲localhost并访问elasticsearch API时,我得到了错误:

代码语言:javascript
复制
curl: (7) Failed to connect to ::1: Cannot assign request address

下面是yaml脚本,也许我做错了什么

代码语言:javascript
复制
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: es-opendistro
  labels:
    service: es-opendistro
spec:
  serviceName: es-opendisro
  replicas: 1
  selector:
    matchLabels:
      name: es-opendistro
  template:
    metadata:
      labels:
        service: es-opendistro
        name: es-opendistro
    spec:
      nodeSelector:
        name: es-opendistro
      initContainers:
      - name: init-sysctl
        image: busybox:1.30
        command: ["sysctl", "-w", "vm.max_map_count=262144"]
        securityContext:
          privileged: true
      containers:
      - name: es-opendistro
        image: CM-DEPLOYER:5000/elasticsearch-opendistro:0.10.0
        env:
        - name: ES_JAVA_OPTS
          value: -Xms1024m -Xmx1024m
        - name: discovery.type
          value: single-node
        - name: NETWORK_HOST
          value: "_site_,_lo_"
        ports:
        - containerPort: 9200
          name: http
          protocol: TCP
        - containerPort: 9300
          name: transport
          protocol: TCP
        volumeMounts:
        - name: internal-users
          mountPath: /usr/share/elasticsearch/plugins/opendistro_security/securityconfig/internal_users.yml
          subPath: internal_users.yml
        - name: elasticsearch-log
          mountPath: /var/log/elasticsearch
        - name: elasticsearch-data
          mountPath: /usr/share/elasticsearch/data
        - name: elasticsearch-config
          mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
          subPath: elasticsearch.yml
      volumes:
        - name: internal-users
          configMap:
            name: internal-users
        - name: elasticsearch-log
          hostPath:
            path: elasticsearch-log
        - name: elasticsearch-data
          hostPath:
            path: /mnt/esdata1
        - name: elasticsearch-config
          hostPath:
            path: /usr/share/elasticsearch
---
apiVersion: v1
kind: Service
metadata:
  name: es6
spec:
  type: NodePort
  ipFamily: IPv4
  selector:
    service: es-opendistro
  ports:
  - name: "9200"
    port: 9200
    targetPort: 9200
    nodePort: 30001
  - name: "9300"
    port: 9300
    targetPort: 9300
    nodePort: 30002

在这一点上,我不知道缺少了什么

EN

回答 1

Stack Overflow用户

发布于 2020-04-15 07:31:44

运行Docker容器日志的日志:

请参阅:https://discuss.opendistrocommunity.dev/t/securityadmin-sh-is-not-work-welll/618

这解决了问题,以防任何人遇到它

缺少SSL导致容器无法接受流量

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61198348

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档