An Error Occurs When Spark Connects to Redis
Issue
An error occurs when the Spark component of the MRS 3.x security cluster is used to access Redis.
Symptom
When Spark of the MRS 3.0 security cluster is used to access Redis, the following error message is displayed.
Cause Analysis
The jars directory of Spark contains a jredisclient-xxx.jar package provided by the MRS cluster. This package is loaded when a Spark task connects to Redis, thereby causing this error. You can manually remove this package to rectify the fault.
Procedure
- Delete JAR packages from the Spark client.
cd $SPARK_HOME/jars
mv jredisclient-*.jar /tmp
- Delete JAR packages from the Spark server.
Log in to the nodes (generally two) where SparkResource2x is located.
mkdir /tmp/SparkResource2x
cd /opt/Bigdata/FusionInsight_Current/1_*_SparkResource2x/install/spark/jars/
mv jredisclient-*.jar /tmp/SparkResource2x
- Delete the jredisclient file from the HDFS.
- Check configuration item spark.yarn.archive in the $SPARK_HOME/conf/spark-defaults.conf file to obtain the address of the spark-archive-2x.zip package.
cat $SPARK_HOME/conf/spark-defaults.conf | grep "spark.yarn.archive"
- Download the spark-archive-2x.zip package. (This section uses MRS 3.0.5 as an example. Modify the command based on the actual cluster version.)
cd /opt
mkdir sparkTmp
cd sparkTmp
hdfs dfs -get hdfs://hacluster/user/spark2x/jars/8.0.2.1/spark-archive-2x.zip
- Decompress spark-archive-2x.zip and remove the package file.
unzip spark-archive-2x.zip
rm -f spark-archive-2x.zip
- Remove the jredisclient package.
rm -f jredisclient-*.jar
- Compress the spark-archive-2x.zip package again.
zip spark-archive-2x.zip ./*
- Back up the original package from the HDFS to tmp and upload the newly compressed package to the HDFS.
hdfs dfs -mv hdfs://hacluster/user/spark2x/jars/8.0.2.1/spark-archive-2x.zip /tmp
hdfs dfs -put spark-archive-2x.zip hdfs://hacluster/user/spark2x/jars/8.0.2.1/spark-archive-2x.zip
- Restart the JDBCServer service to prevent JDBCServer exceptions. The jredisclient file has been deleted from the spark-archive-2x.zip package.
- Delete temporary files.
- Check configuration item spark.yarn.archive in the $SPARK_HOME/conf/spark-defaults.conf file to obtain the address of the spark-archive-2x.zip package.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot