Elasticsearch:将根网址从/更改为/elastic [英] Elasticsearch: Change root url from / to /elastic
问题描述
我正在设置一个Elasticsearch集群,我想将域网址设置为<domain_name>/elastic
I am setting up an elasticsearch cluster and I want to set the domain url to <domain_name>/elastic
当前,当我转到<domain_name>/elastic
时,elasticsearch将/elastic
视为索引的名称.
Currently, when I go to <domain_name>/elastic
, elasticsearch thinks /elastic
as the name of the index.
我还没有找到任何有关如何为elatsicsearch设置根url上下文的文档.任何帮助将不胜感激.
I haven't found any documentation on how to set the root url context for elatsicsearch. Any help would be much appreciated.
推荐答案
对于那些通过Internet搜索如何在将入口与/
结合使用时如何在Kubernetes中做类似的事情,可以使用注释
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
它将映射 http://k8s-master:ingress_port/elastic 内部在elasticsearch
服务的根上下文上解决了index_not_found_exception
错误.
It will map http://k8s-master:ingress_port/elastic internally on root context of elasticsearch
service and index_not_found_exception
error is solved.
这篇关于Elasticsearch:将根网址从/更改为/elastic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!