Spark-Cassandra Connector : Failed to open native connection to Cassandra

后端 未结 5 1347
情深已故
情深已故 2020-12-20 23:54

I am new to Spark and Cassandra. On trying to submit a spark job, I am getting an error while connecting to Cassandra.

Details:

Versions:

Spa         


        
5条回答
  •  生来不讨喜
    2020-12-21 00:09

    you did not specified spark.cassandra.connection.host by default spark assume that cassandra host is same as spark master node.

    var sc:SparkContext=_
    val conf = new SparkConf().setAppName("Cassandra Demo").setMaster(master)
    .set("spark.cassandra.connection.host", "192.168.101.11")
    c=new SparkContext(conf)
    
    val rdd = sc.cassandraTable("test", "words")
    rdd.toArray.foreach(println)
    

    it should work if you have properly set seed nodein cassandra.yaml

提交回复
热议问题