Hi Simone,
I’m not aware how many IPs does the hive server have configured.
If I use Hive table against ES node without installed RoR - it works fine and data is written in ES and there is no appropriate entry about request from Hive in ES.log.
Using the same table against ES node with installed RoR (access control is done via hosts rule) gives me bad request entry in es.log described earlier.
Here I tested RoR with user/groups level access rule as it is in (2)readonlyrest.yml at the beginning of this thread.
I’m using the same table, just added one line to it - ‘es.net.http.header.Authorization’=‘Basic <value of Base64(tom:tompwd)>’
hive> CREATE EXTERNAL TABLE IF NOT EXISTS write_to_es_ror_enabled_9200 (
title string,
author string)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler’
TBLPROPERTIES(
‘es.nodes’=‘11.111.11.88’,
‘es.port’=‘9200’,
‘es.resource.write.’=‘books/kindle’,
‘es.index.auto.create’=‘true’,
‘es.write.operation’=‘index’,
‘es.mapping.names’=‘title:title, author:author’,
‘es.net.http.header.Authorization’=‘Basic <Base64(tom:tompwd)>’);
hive> insert into write_to_es_ror_enabled_9200 values (‘vdtitle’, ‘vdauthor’);
Here is the entry inside es.log. It contains lots of wrong attributes (some of them are correct) and the data has not been written into ES.
FORBIDDEN by default req={ID:123…, TYP:MainRequest, CGR:N/A, USR:tom, BRS:true, ACT:cluster:monitor/main, OA:11.111.11.55, IDX:<N/A>, MET:GET, PTH:/, CNT:<N/A>, HDR:{Accept=application/json, Authorization=Basic <Base64(tom:tompwd)>, content-length=0, Content-type=application/json,
Host=11.111.11.88:9200, User-Agent+Jakarta Commons-HttpClient/3.1}, HIS:[Accept all requests from users in team2 on index books->[auth_key_sha256->true, indices->true, actions->false]]}
Also, I looked at refernced link which is not relevant to my use case because the guy used xPack and he was not able to make it workable.
I tested and used RoR already with (1)hosts rule and (2)user/group rule along with JEST client and it worked well and now I’d like to integrate Hive and ES With RoR.
When you advised to enable authentication via basic auth instead of the hosts rule, did you mean this my use case I just described or something different ?
Or you meant using basic auth. by adding to the hive table es.net.http.auth.user and es.net.http.auth.pass with the values “tom” and “Base64(tom:tompwd)” which I tested successfully when writing to ES via cURL -XPUT … with header ?
Thank you for your time, patience and help.