Elasticsearch With Haystack -Initial connection to Elasticsearch failed
HiI am trying to run Chapter 7 to learn about Haystack for QA:I am using Jupyter Notebook which is connected to my GCP VM : Debian GNU/Linux 9, Tesla V100I did install debian versionbut facing the following error : ConnectionError: Initial connection to Elasticsearch failed. Make sure you run an Elasticsearch instance at[{'host': 'localhost', 'port': 9200}]and that it has finished the initial ramp up (can take > 30s).!wgethttps://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.1.2-linux-x86_64.tar.gz!wgethttps://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.1.2-linux-x86_64.tar.gz.sha512!shasum -a 512 -c elasticsearch-8.1.2-linux-x86_64.tar.gz.sha512!tar -xzf elasticsearch-8.1.2-linux-x86_64.tar.gz!cd elasticsearch-8.1.2/!pip install pymilvusimport pymilvusimport osfrom subprocess import Popen, PIPE, STDOUT!chown -R daemon:daemon elasticsearch-8.1.2es_server = Popen(args=[‘elasticsearch-8.1.2/bin/elasticsearch’])!sleep 30from haystack.document_store.elasticsearch import ElasticsearchDocumentStore#document_store= ElasticsearchDocumentStore(host=‘localhost’, port= 9201, username=’’, password=’’)document_store = ElasticsearchDocumentStore(return_embedding=True)I would appreciate your support on this.Shabnam
2023-01-18T07:55:41Z
same problem here! I wonder if you have found a solution already?
2023-02-02T06:51:12Z
Hi! the solution is launch ES:from haystack.utils import launch_es
launch_es()Before launching ES, we need to install docker to run ES locally,herethe link to installdockerAfter Docker installed, we need to change permission to use it as $USER:sudo usermod -aG docker $USER
sudo rebootThats all:)
2024-04-15T11:40:14Z
Hi,After launch_es(), I saw the following error messages.Can you help me for this problems.Of course, I changed username using ‘usermod’TypeError: create() got an unexpected keyword argument ‘mappings’#curl-X GET “localhost:9200/?pretty”{“name” : “ac91bb8c9894”,“cluster_name” : “docker-cluster”,“cluster_uuid” : “Zb5y5OaSQtGIuBVB-I3POQ”,“version” : {“number” : “7.17.6”,“build_flavor” : “default”,“build_type” : “docker”,“build_hash” : “f65e9d338dc1d07b642e14a27f338990148ee5b6”,“build_date” : “2022-08-23T11:08:48.893373482Z”,“build_snapshot” : false,“lucene_version” : “8.11.1”,“minimum_wire_compatibility_version” : “6.8.0”,“minimum_index_compatibility_version” : “6.0.0-beta1”},“tagline” : “You Know, for Search”}Thanks a lot in advance.