Spark: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 72: Line 72:


| valign="top" |
| valign="top" |
* [https://unix.stackexchange.com/questions/388483/ Delay Systemd Service If File Exist]
* [https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Conditions%20and%20Asserts System Unit Conditions & Asserts]
* [https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Conditions%20and%20Asserts System Unit Conditions & Asserts]
* [[Keycloak]]
* [[Keycloak]]

Revision as of 07:33, 25 September 2022

Spark Master

sudo tee -a /etc/systemd/system/spark-master.service >/dev/null <<EOF
[Unit]
Description=Apache Spark Master
Documentation=https://spark.apache.org/docs/3.3.0
Wants=network-online.target
After=network-online.target
After=systemd-user-sessions.service

[Service]
User=spark
Type=forking
EnvironmentFile=${SPARK_HOME}/etc/.env
ExecStart=${SPARK_HOME}/sbin/start-master.sh
ExecStop=${SPARK_HOME}/sbin/stop-master.sh

[Install]
WantedBy=multi-user.target
EOF

Slave Daemon

sudo tee -a /etc/systemd/system/spark-slave.service >/dev/null <<EOF
[Unit]
Description=Apache Spark Slave
Documentation=https://spark.apache.org/docs/3.3.0
Wants=network-online.target
After=network-online.target

[Service]
User=spark
Type=forking
EnvironmentFile=${SPARK_HOME}/etc/.env
WorkingDirectory=${SPARK_HOME}/sbin
ExecStart=${SPARK_HOME}/sbin/start-slave.sh spark://10.20.22.10:7077
ExecStop=${SPARK_HOME}/sbin/stop-slave.sh
Restart=on-failure
RestartSec=10s

[Install]
WantedBy=multi-user.target
EOF

References