Elasticsearch 通过 SSH 远程访问 [英] Elasticsearch remote access through SSH
本文介绍了Elasticsearch 通过 SSH 远程访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
关于Elasticsearch HTTP API,我想知道我是否想远程访问SSH服务器上的一个集群,我应该在我的 http rest 命令中包含什么:
About Elasticsearch HTTP API, I wonder if I want to remote access a cluster on SSH server, what should I include in my http rest command:
curl -XGET ' http://localhost:9200/ index /_mapping/ type '
我尝试过类似下面的方法但失败了:
I have tried something like below but got failed:
curl -XGET -u cloud-user: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub 'xx.xxx.xxx.xxx:9200/index/_mapping/type'
有人知道正确的命令或替代解决方案吗?
Is there anyone knows the correct command or alternative solution?
推荐答案
如果您在 *NIX 环境中,这很容易,只需通过 ssh 隧道
If you are on *NIX environment it is easy, just tunnel over ssh
ssh -Nf -L 9200:localhost:9200 user@remoteserver.com
稍后你通过本地主机获取远程,如上面的隧道
Later you fetch the remote by localhost, as tunneled above
curl -XGET 'http://localhost:9200/_search'
这篇关于Elasticsearch 通过 SSH 远程访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文