gpt4 book ai didi

How to access the locally hosted elasticsearch server on google collab(如何在Google Collab上访问本地托管的ElasticSearch服务器)

转载 作者:bug小助手 更新时间:2023-10-27 20:29:51 24 4
gpt4 key购买 nike



Currently we are working on local elastic search server to store and perform the operartions. so i have installed and working elasticsearch instance on my local machine .but i want to access this server from the google collab so when i try to access it using the " !curl http://localhost:9200/ " It saying connection refused and when i the use IP address i.e http://[My IP Address:9200] / it says connection timed out .
in elasticsearch.yml i have removed authentication and setted network.host : 0.0.0.0
the server is up and running on local host but not accesible from the google collab what should i do ?

目前,我们正在开发本地弹性搜索服务器来存储和执行这些操作。所以我已经在我的本地机器上安装并运行了ElasticSearch实例。但是我想从谷歌协作实验室访问这个服务器,所以当我尝试使用“!Curl http://localhost:9200/”访问它时,它会显示连接被拒绝,而当我使用IP地址,即http://[My IP地址:9200]/时,它会显示连接超时。在弹性搜索.yml中,我已删除身份验证并设置了网络。host:0.0.0.0服务器已启动并在本地主机上运行,但无法从Google协作实验室访问,我应该怎么办?


xpack.security.enabled: false
network.host: 0.0.0.0

更多回答
优秀答案推荐

Google colab is running in VM on a remote server in Google's GCP. I can only assume that your machine is running on your local network. Therefore your notebook simply cannot get access to your instance. There are several ways to solve this issue:

Google CoLab在Google GCP的远程服务器上的VM上运行。我只能假设您的计算机在您的本地网络上运行。因此,您的笔记本根本无法访问您的实例。有几种方法可以解决此问题:



  1. If you are working from home, you can forward a port from on your router to your local machine running elasticsearch. This solution depends on the model of the router/firewall that you are using and I wouldn't recommend exposing unprotected instance of elasticsearch to outside world.



  2. A much safer way would be to create an ssh tunnel from your machine to colab instance. This is covered in details in How can I ssh to google colaboratory VM?



  3. Instead of running elasticsearch locally you can run it in one of the available services. For example https://www.elastic.co/cloud/ there is a free trial and you get proper security setup and it is already accessible form the internet.




I hope that helps.

我希望这能帮上忙。


更多回答

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com