[Unit]
Description=Apache Hive Metastore Service
After=network.target mariadb.service postgresql.service
Wants=mariadb.service
[Service]
Type=forking
User=hive
Group=hadoop
Environment=HIVE_HOME=/opt/hive
Environment=HIVE_CONF_DIR=/opt/hive/conf
Environment=HIVE_LOG_DIR=/var/log/hive
Environment=HIVE_PID_DIR=/var/run/hive
ExecStart=${HIVE_HOME}/bin/hive --service metastore --hiveconf hive.log.dir=${HIVE_LOG_DIR} --hiveconf hive.pid.dir=${HIVE_PID_DIR} &
ExecStop=/bin/kill -TERM $MAINPID
PIDFile=${HIVE_PID_DIR}/metastore.pid
Restart=on-failure
LimitNOFILE=32768
[Install]
WantedBy=multi-user.target
[Unit]
Description=Apache HiveServer2 Service
After=network.target hive-metastore.service
Wants=hive-metastore.service
[Service]
Type=forking
User=hive
Group=hadoop
Environment=HIVE_HOME=/opt/hive
Environment=HIVE_CONF_DIR=/opt/hive/conf
Environment=HIVE_LOG_DIR=/var/log/hive
Environment=HIVE_PID_DIR=/var/run/hive
ExecStart=${HIVE_HOME}/bin/hive --service hiveserver2 --hiveconf hive.log.dir=${HIVE_LOG_DIR} --hiveconf hive.pid.dir=${HIVE_PID_DIR} &
ExecStop=/bin/kill -TERM $MAINPID
PIDFile=${HIVE_PID_DIR}/hiveserver2.pid
Restart=on-failure
LimitNOFILE=32768
[Install]
WantedBy=multi-user.target