Spark: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
==Master Daemon==
==Spark Master==
<source lang="bash">
<source lang="bash">
sudo tee -a /etc/systemd/system/spark-master.service >/dev/null <<EOF
sudo tee -a /etc/systemd/system/spark-master.service >/dev/null <<EOF
Line 21: Line 21:
==Slave Daemon==
==Slave Daemon==
<source lang="bash">
<source lang="bash">
sudo tee -a /etc/systemd/system/spark-slave.service >/dev/null <<EOF
[Unit]
[Unit]
Description=Apache Spark Slave
Description=Apache Spark Slave
Line 34: Line 35:
[Install]
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target
EOF
</source>
</source>



Revision as of 04:38, 25 September 2022

Spark Master

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

sudo tee -a /etc/systemd/system/spark-slave.service >/dev/null <<EOF
[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
EOF

References