I had a second “NoHostAvailableException” error that occurred to me several times this week when I was porting a Python spark to Java Spark.
I had problems with the fact that the driver stream was almost out of memory, and the GC occupied all my cores (98% of all 8 cores), constantly stopping the JVM.
In python, when this happens, it is much more obvious (for me), so it took me a little time to figure out what was happening, so I got this error several times.
I had two theories for the root cause, but the solution was not that the GC was going crazy.
- The first theory was that since it stopped so often, I simply could not connect to Cassandra.
- The second theory: Kassandra was running on the same machine as Spark, and the JVM received 100% of the entire processor, so Cassandra just couldn't answer on time, and she looked at the driver as if there was no Cassandra host.
Hope this helps!
Code herder
source share