Spark streaming issue


#1

Hi Team,

I am getting below error while trying to connect gw01 for spark streaming excercise.

–>nc -lk gw01.itversity.com 19999
Ncat: bind to 172.16.1.100:19999: Cannot assign requested address. QUITTING.

Below is the file i am trying to execute:

from pyspark import SparkConf,SparkContext
from pyspark.streaming import StreamingContext

conf = SparkConf().setAppName(“Streaming wod count”).setMaster(“yarn-client”)

sc = SparkContext(conf=conf)
ssc= StreamingContext(sc,15)

lines= ssc.socketTextStream(“gw01.itversity.com”,19999)
words= lines.flatMap(lambda line : line.split(" "))
wordTuples= words.map(lambda word: (word,1))
wordCount=wordTuples.reduceByKey(lambda x,y : x+y)

wordCount.pprint()
ssc.start()
ssc.awaitTermination()

Plese help.