gangly/datafaker

在开启kerberos+权限的集群写入数据,上报错误“missing authentication credentials”

Opened this issue · 0 comments

往开启kerberos和权限的集群中写入数据,报错
sh-4.2$ datafaker es 101.12.67.77:9200 mytest01/_doc 10 --meta meta.txt
Process Process-4:
Traceback (most recent call last):
File "/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib64/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python2.7/site-packages/datafaker/dbs/basedb.py", line 122, in save
self.save_data(lines)
File "/usr/lib/python2.7/site-packages/datafaker/dbs/esdb.py", line 38, in save_data
success, _ = bulk(self.es, actions, index=self.args.table, raise_on_error=True)
File "/usr/lib/python2.7/site-packages/elasticsearch/helpers/actions.py", line 310, in bulk
for ok, item in streaming_bulk(client, actions, *args, **kwargs):
File "/usr/lib/python2.7/site-packages/elasticsearch/helpers/actions.py", line 240, in streaming_bulk
**kwargs
File "/usr/lib/python2.7/site-packages/elasticsearch/helpers/actions.py", line 126, in _process_bulk_chunk
raise e
AuthenticationException: AuthenticationException(401, u'security_exception', u'missi
ng authentication credentials for REST request [/mytest01%2F_doc/_bulk]')
time used: 0.301 s
数据规则:
sh-4.2$ cat meta.txt
id||int||自增id[:inc(id,1)]
name||varchar(20)||学生名字
sh-4.2$
索引:
curl -XPUT --negotiate -u : 'http://101.12.67.77:9200/mytest01/?pretty=true' -H 'Content-Type:application/json' -d '{"mappings":{"properties":{"id":{"type":"long"},"name":{"type":"text"}}}}'