Spark: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
[Unit]
[Unit]
Description=Apache Spark Master
Description=Apache Spark Master
Documentation=https://spark.apache.org/docs/latest
Wants=network-online.target
After=network-online.target
After=network-online.target
After=systemd-user-sessions.service
After=systemd-user-sessions.service


[Service]
[Service]
User=ubuntu
User=spark
Type=forking
Type=forking
EnvironmentFile=${SPARK_HOME}/etc/.env
EnvironmentFile=${SPARK_HOME}/etc/.env
Line 24: Line 26:
[Unit]
[Unit]
Description=Apache Spark Slave
Description=Apache Spark Slave
After=network.target
Documentation=https://spark.apache.org/docs/latest
Wants=network-online.target
After=network-online.target


[Service]
[Service]
User=spark-user
User=spark
WorkingDirectory=/usr/lib/spark/sbin
Type=forking
ExecStart=/usr/lib/spark/sbin/start-slave.sh spark://10.20.22.10:7077
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
Restart=on-failure
RestartSec=10s
RestartSec=10s

Revision as of 04:49, 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/latest
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/latest
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