Elasticsearch: Change root url from / to /elastic

我的未来我决定 提交于 2020-01-23 12:07:09

问题


I am setting up an elasticsearch cluster and I want to set the domain url to <domain_name>/elastic

Currently, when I go to <domain_name>/elastic, elasticsearch thinks /elastic as the name of the index.

I haven't found any documentation on how to set the root url context for elatsicsearch. Any help would be much appreciated.


回答1:


For those who are searching through internet how to do the similar thing in Kubernetes when using ingress with path other then / it can be done using annotation nginx.ingress.kubernetes.io/rewrite-target: / like this:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
  name: elasticsearch
spec:
  rules:
  - host: k8s-master
    http:
      paths:
      - backend:
          serviceName: elasticsearch
          servicePort: 9200
        path: /elastic

It will map http://k8s-master:ingress_port/elastic internally on root context of elasticsearch service and index_not_found_exception error is solved.



来源:https://stackoverflow.com/questions/50988363/elasticsearch-change-root-url-from-to-elastic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!