改为以下代码即可:
val conf = new SparkConf().setMaster("local[*]").setAppName("rdd").set("spark.driver.host","localhost")