Elasticsearch通过SSH远程访问

 枫的Lilyxj 发布于 2022-12-31 13:38

关于Elasticsearch HTTP API,我想知道我是否想远程访问SSH服务器上的集群,我应该在http rest命令中包含哪些内容:

    curl -XGET ' http://localhost:9200/ index /_mapping/ type ' 

我尝试了类似下面的东西,但失败了:

    curl -XGET -u cloud-user: --key ~/.ssh/id_rsa --pubkey ~/.ssh/id_rsa.pub  'xx.xxx.xxx.xxx:9200/index/_mapping/type'

有没有人知道正确的命令或替代解决方案?

1 个回答
  • 如果你在*NIX环境中很容易,只需通过ssh隧道

    ssh -Nf -L 9200:localhost:9200 user@remoteserver.com
    

    稍后您将通过localhost获取远程数据库,如上所述

    curl -XGET 'http://localhost:9200/_search'
    

    2022-12-31 13:39 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有