Copy it to all servers that have an instance of spark-history Role to spark 3 parcel dir:
/opt/cloudera/parcels/SPARK3/lib/spark3/jars
Beware /opt/cloudera/parcels/SPARK3 is a symlink to the current SPARK3 active parcel and is controlled by Cloudera Manager.
Go to CM >cluster >Spark 3 >Configuration >spark3-conf/spark-history-server.conf_role_safety_valve / `History Server Advanced Configuration Snippet (Safety Valve) for spark3-conf/spark-history-server.conf`