问题
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