微信登录

elasticsearch python

安装 connectors

要先安装 python3.10 ,因为是用python写的,用到python3.10去创建虚拟环境

cd到你自己管理的地方

  1. cd xxx

克隆 connectors

  1. git clone https://github.com/elastic/connectors

修改config.yml

  1. connectors:
  2. -
  3. connector_id: "7V37Do8Bjfz0jsfahzL3"
  4. service_type: "mongodb"
  5. elasticsearch:
  6. host: "https://192.168.0.3:9200"
  7. api_key: "N2asdassssssssssssssssssssssssssssssssssssssssssssssssshPUQ=="
  8. ssl: true
  9. username: "elastic"
  10. password: "VDMlz5QnM_0g-349fFq7"
  11. ca_certs: "/usr/share/certs/http_ca.crt"

api_key 是从Kibana生成的apikey
地址:
http://localhost:5601/app/enterprise_search/content/connectors/sssssssssssssss/configuration
sssssssssssssss是生成的id,表示你的连接器id
connector_id、host、username、password、ca_certs相应修改

拷贝elasticsearch的证书
elasticsearch-8.13.2/config/certs/http_ca.crt

一定要跟上版本
https://github.com/elastic/connectors
这个是地址,可以看到有很多版本,如果要切换8.14的话就checkout
git checkout -b origin/8.14

安装命令
来源:https://www.elastic.co/guide/en/enterprise-search/8.13/connectors-run-from-source.html

  1. make install
  1. make run

控制台输出运行状态

connect 命令

保持不掉

  1. nohup /home/xxx/connectors/bin/elastic-ingest > /home/xxx/connectors/elastic-ingest-runoob.log 2>&1 &
  2. ps -ef | grep elastic-ingest