|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
- from elasticsearch import Elasticsearch
- es = Elasticsearch("http://127.0.0.1:9200/")
- result = es.indices.create(index='news',ignore=400)
- print(result)
复制代码
然后就报错了:
DeprecationWarning: Passing transport options in the API method is deprecated. Use 'Elasticsearch.options()' instead.
result = es.indices.create(index='news',ignore=400)
如果需要设置账号和密码的话,该怎么填写Elasticsearch("http://127.0.0.1:9200/")括号里面的内容呢?我安装elasticsearch的时候没有设置账号和密码。
因为你设置了主节点,但是你的配置文件少了一个设置节点名,所以他找不到主节点
配置文件改动:
- node.name: node-1
- cluster.initial_master_nodes: ["node-1"]
复制代码
|
|