making systemd hadoop service on centos 8

Issues related to applications and software problems and general support
Post Reply
gladiator67
Posts: 2
Joined: 2013/07/29 07:41:46
Location: Seoul, S.Korea

making systemd hadoop service on centos 8

Post by gladiator67 » 2020/10/02 04:37:48

I install hadoop 3.3 on centos 8. The namenode formatting, dfs and yarn executing are all successful. I generate hadoop script file on $HADOOP_HOME/sbin

hadoop-service.sh

Code: Select all

#!/bin/bash

start() {
    start-dfs.sh
    start-yarn.sh
}

stop() {
    stop-dfs.sh
    stop-yarn.sh
}

case $1 in
    start|stop) "$1" ;;
esac

exit 0
When I execute hadoop-service.sh manually, all processes are generated correctly

Code: Select all

# hadoop-service.sh start
Starting namenodes on [localhost]
Starting datanodes
Starting secondary namenodes [localhost.localdomain]
Starting resourcemanager
Starting nodemanagers
    
# jps
10706 NameNode
11683 ResourceManager
10904 DataNode
12330 Jps
11323 SecondaryNameNode
11884 NodeManager
And I try to make systemd hadoop service like below, but it fails.

Code: Select all

# cd /usr/lib/systemd/system
# vi hadoop.service

[Unit]
Description=Hadoop 3.3.0 Service

[Service]
Type=oneshot

User=root
Group=root

ExecStart=/usr/local/hadoop/sbin/hadoop-service.sh start
ExecStop=/usr/local/hadoop/sbin/hadoop-service.sh stop

RemainAfterExit=yes
#Restart=always

[Install]
WantedBy=multi-user.target

# systemctl enable hadoop
# systemctl start hadoop
The starting hadoop service show no errors but generate no process at all.

Code: Select all

# jps
jps
I can not find any mistakes, any comments will be thankful. Best regards

Post Reply

Return to “CentOS 8 - General Support”