Closed baronchin closed 1 year ago
Hi, redis set up by docker image
Hi, already found the solution define the options when startup sparksession
spark = SparkSession.builder.appName("baron")\
.config("spark.master", "spark://apdev01:7077").config("spark.deploy.mode", "client").config('spark.executor.cores', 1).config('spark.executor.memory', '1G')\
.config('spark.cores.max', 1)\
.config("spark.redis.host","apdev01")\
.config("spark.redis.port",9012)\
.config("spark.redis.db",1)\
.config("spark.sql.session.timeZone", "UTC").getOrCreate()
df = spark.createDataFrame([("jessy",31),("parker",23)],["name","age"])
df.write\
.format("org.apache.spark.sql.redis")\
.option("table", "person")\
.save()
Hi, I got this exceptions when use spark-redis:redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
program code as follow:
also, I can use another machine connect to redis server successfully: telnet apdev01 9012