18.4.2012

Pig query using DataStax – connection error

Filed under: Uncategorized — nax @ 13:22

When I used following setup:

export DSE_HOME=/opt/brisk
export CASSANDRA_HOME=$DSE_HOME/resources/cassandra
export PATH="$PATH:$DSE_HOME/bin:$CASSANDRA_HOME/bin"
export USE64BITJVM=1
export CASSANDRA_CONF=/etc/cassandra/
cd /opt/brisk/resources/pig/bin
dse pig -l /var/tmp/josefh/

I ended up with following error:


grunt> resources = LOAD 'cassandra://mynamespace/resource' USING CassandraStorage() AS (KEY, columns:bag{T:tuple(name:chararray,description:chararray)});

2012-04-18 07:54:23,049 [main] ERROR org.apache.cassandra.hadoop.ConfigHelper - failed to connect to any initial addresses
2012-04-18 07:54:23,050 [main] ERROR org.apache.cassandra.hadoop.ConfigHelper -
java.io.IOException: unable to connect to server
at org.apache.cassandra.hadoop.ConfigHelper.createConnection(ConfigHelper.java:390)
at org.apache.cassandra.hadoop.ConfigHelper.getClientFromAddressList(ConfigHelper.java:359)
at com.datastax.bdp.hadoop.pig.CassandraStorage.initSchema(CassandraStorage.java:581)
at com.datastax.bdp.hadoop.pig.CassandraStorage.setLocation(CassandraStorage.java:320)
at com.datastax.bdp.hadoop.pig.CassandraStorage.getSchema(CassandraStorage.java:325)
at org.apache.pig.impl.logicalLayer.LOLoad.determineSchema(LOLoad.java:186)
at org.apache.pig.impl.logicalLayer.LOLoad.getSchema(LOLoad.java:151)
at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:851)
at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:63)
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1612)
at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1562)
at org.apache.pig.PigServer.registerQuery(PigServer.java:534)
at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:871)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:388)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:168)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:144)
at org.apache.pig.tools.grunt.Grunt.run(Grunt.java:76)
at org.apache.pig.Main.run(Main.java:455)
at org.apache.pig.Main.main(Main.java:107)
Caused by: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused
at org.apache.thrift.transport.TSocket.open(TSocket.java:183)
at org.apache.thrift.transport.TFramedTransport.open(TFramedTransport.java:81)
at org.apache.cassandra.hadoop.ConfigHelper.createConnection(ConfigHelper.java:386)
... 18 more
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at org.apache.thrift.transport.TSocket.open(TSocket.java:178)
... 20 more
2012-04-18 07:54:23,054 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2999: Unexpected internal error. java.io.IOException: unable to connect to server
Details at logfile: /var/tmp/josefh/pig_1334735618872.log

As I googled around I found following solution:

export PIG_RPC_PORT=112233

(you need to change port to your specific port where Cassandra RPC is running).

Comments are closed.

Powered by WordPress