Spark: Difference between revisions
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
==Master Daemon== | |||
<source lang="bash"> | |||
sudo tee -a /etc/systemd/system/spark-master.service >/dev/null <<EOF | |||
[Unit] | |||
Description=Apache Spark Master | |||
After=network-online.target | |||
After=systemd-user-sessions.service | |||
[Service] | |||
User=ubuntu | |||
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 | |||
</source> | |||
==Slave Daemon== | |||
<source lang="bash"> | |||
[Unit] | |||
Description=Apache Spark Slave | |||
After=network.target | |||
[Service] | |||
User=spark-user | |||
WorkingDirectory=/usr/lib/spark/sbin | |||
ExecStart=/usr/lib/spark/sbin/start-slave.sh spark://10.20.22.10:7077 | |||
Restart=on-failure | |||
RestartSec=10s | |||
[Install] | |||
WantedBy=multi-user.target | |||
</source> | |||
==References== | ==References== | ||
{| | {| |
Revision as of 02:57, 25 September 2022
Master Daemon
sudo tee -a /etc/systemd/system/spark-master.service >/dev/null <<EOF
[Unit]
Description=Apache Spark Master
After=network-online.target
After=systemd-user-sessions.service
[Service]
User=ubuntu
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
[Unit]
Description=Apache Spark Slave
After=network.target
[Service]
User=spark-user
WorkingDirectory=/usr/lib/spark/sbin
ExecStart=/usr/lib/spark/sbin/start-slave.sh spark://10.20.22.10:7077
Restart=on-failure
RestartSec=10s
[Install]
WantedBy=multi-user.target