Elasticsearch not creating index via jdbc river

Elasticsearch was indexing my mysql data previously. I recently installed shield plugin from then it's not getting created.
Below is my configuration -

http://pavan:password@localhost:9200/_river/sample/_meta

{
    			"type" : "jdbc",
    			"jdbc" : {
        				"url" : "jdbc:mysql://localhost:3306/test",
        				"user" : "root",
        				"password" : "password",
        				"sql" : "select username from user",
                 		        "index" : "sample"
                        
                  		
				 }
}

When I run the following code in POSTMAN and look for existing indices, it only shows _river but not sample and when I see the logs at terminal I get the following error -

[2015-07-03 16:40:11,682][WARN ][river.routing            ] [Grim Hunter] failed to get/parse _meta for [sample]
org.elasticsearch.shield.authz.AuthorizationException: action [indices:data/read/get] is unauthorized for user [__es_system_user]
	at org.elasticsearch.shield.authz.InternalAuthorizationService.denial(InternalAuthorizationService.java:256)
	at org.elasticsearch.shield.authz.InternalAuthorizationService.authorize(InternalAuthorizationService.java:111)
	at org.elasticsearch.shield.action.ShieldActionFilter.apply(ShieldActionFilter.java:112)
	at org.elasticsearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:165)
	at org.elasticsearch.action.support.TransportAction.execute(TransportAction.java:82)
	at org.elasticsearch.client.node.NodeClient.execute(NodeClient.java:98)
	at org.elasticsearch.client.support.AbstractClient.get(AbstractClient.java:193)
	at org.elasticsearch.action.get.GetRequestBuilder.doExecute(GetRequestBuilder.java:201)
	at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:91)
	at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:65)
	at org.elasticsearch.action.ActionRequestBuilder.get(ActionRequestBuilder.java:73)
	at org.elasticsearch.river.routing.RiversRouter.updateRiverClusterState(RiversRouter.java:137)
	at org.elasticsearch.river.routing.RiversRouter$1.execute(RiversRouter.java:108)
	at org.elasticsearch.river.cluster.RiverClusterService$1.run(RiverClusterService.java:110)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

That'd be why.
Did you set up this pavan user in Shield correctly?

Shield does not support JDBC plugin/river.

1 Like

Thank you jprante. Are there any alternatives to overcome this? I want something which is similar to JDBC river. I came across Logstash JDBC input plugin, will that work ?

That should work, as Logstash is supported by Shield.