masatana commented on PR #1322:
URL: https://github.com/apache/bigtop/pull/1322#issuecomment-2573378626

   Hmm, provided system unit files don't work on RockyLinux 8 with the error 
below:
   
   ```
   hadoop-hdfs-namenode.service: New main PID 6388 does not belong to service, 
and PID file is not owned by root. Refusing.
   ```
   
   Strangely, it works on Ubuntu 24.04.
   
   To workaround this, we can use `GuessMainPID=yes` (which is default) and 
comment out `PIDFile`. It can guess main java PID correctly on both RockyLinux 
8 and Ubuntu 24.04 like below:
   
   <details>
   
   ```
   [root@b2c7d1997649 /]# systemctl cat hadoop-hdfs-namenode
   # /usr/lib/systemd/system/hadoop-hdfs-namenode.service
   # Licensed to the Apache Software Foundation (ASF) under one or more
   # contributor license agreements.  See the NOTICE file distributed with
   # this work for additional information regarding copyright ownership.
   # The ASF licenses this file to You under the Apache License, Version 2.0
   # (the "License"); you may not use this file except in compliance with
   # the License.  You may obtain a copy of the License at
   #
   #     http://www.apache.org/licenses/LICENSE-2.0
   #
   # Unless required by applicable law or agreed to in writing, software
   # distributed under the License is distributed on an "AS IS" BASIS,
   # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   # See the License for the specific language governing permissions and
   # limitations under the License.
   
   [Unit]
   Documentation=https://hadoop.apache.org/
   Description=Hadoop NameNode
   Before=multi-user.target
   Before=graphical.target
   After=remote-fs.target
   
   [Service]
   User=hdfs
   Group=hdfs
   Type=forking
   Restart=no
   TimeoutSec=5min
   IgnoreSIGPIPE=no
   KillMode=process
   #GuessMainPID=no
   RemainAfterExit=no
   #PIDFile=/run/hadoop-hdfs/hadoop-hdfs-namenode.pid
   SuccessExitStatus=5 6
   ExecStart=/usr/bin/hdfs --config /etc/hadoop/conf --daemon start namenode
   ExecStop=/usr/bin/hdfs --config /etc/hadoop/conf --daemon stop namenode
   [root@b2c7d1997649 /]# systemctl start hadoop-hdfs-namenode
   [root@b2c7d1997649 /]# systemctl status hadoop-hdfs-namenode --no-pager
   ● hadoop-hdfs-namenode.service - Hadoop NameNode
      Loaded: loaded (/usr/lib/systemd/system/hadoop-hdfs-namenode.service; 
static; vendor preset: disabled)
      Active: active (running) since Mon 2025-01-06 15:38:23 UTC; 3s ago
        Docs: https://hadoop.apache.org/
     Process: 7099 ExecStop=/usr/bin/hdfs --config /etc/hadoop/conf --daemon 
stop namenode (code=exited, status=0/SUCCESS)
     Process: 7164 ExecStart=/usr/bin/hdfs --config /etc/hadoop/conf --daemon 
start namenode (code=exited, status=0/SUCCESS)
    Main PID: 7217 (java)
       Tasks: 71 (limit: 98358)
      Memory: 365.4M
      CGroup: 
/docker/b2c7d19976495ecf3882759e65bcd1e70f8acac1d917d274b61d83b59e99af3d/system.slice/hadoop-hdfs-namenode.service
              └─7217 
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.432.b06-2.el8.x86_64/bin/java 
-Dproc_namenode -Djava.net.preferIPv4Stack=true 
-Dhdfs.audit.logger=INFO,NullAppender -Dcom.sun.management.jmxremote -Dyar…
   
   Jan 06 15:38:21 b2c7d1997649 systemd[1]: hadoop-hdfs-namenode.service: User 
lookup succeeded: uid=996 gid=993
   Jan 06 15:38:21 b2c7d1997649 systemd[7164]: hadoop-hdfs-namenode.service: 
Executing: /usr/bin/hdfs --config /etc/hadoop/conf --daemon start namenode
   Jan 06 15:38:23 b2c7d1997649 systemd[1]: hadoop-hdfs-namenode.service: Child 
7164 belongs to hadoop-hdfs-namenode.service.
   Jan 06 15:38:23 b2c7d1997649 systemd[1]: hadoop-hdfs-namenode.service: 
Control process exited, code=exited status=0
   Jan 06 15:38:23 b2c7d1997649 systemd[1]: hadoop-hdfs-namenode.service: Got 
final SIGCHLD for state start.
   Jan 06 15:38:23 b2c7d1997649 systemd[1]: hadoop-hdfs-namenode.service: Main 
PID guessed: 7217
   Jan 06 15:38:23 b2c7d1997649 systemd[1]: hadoop-hdfs-namenode.service: 
Changed start -> running
   Jan 06 15:38:23 b2c7d1997649 systemd[1]: hadoop-hdfs-namenode.service: Job 
hadoop-hdfs-namenode.service/start finished, result=done
   Jan 06 15:38:23 b2c7d1997649 systemd[1]: Started Hadoop NameNode.
   Jan 06 15:38:23 b2c7d1997649 systemd[1]: hadoop-hdfs-namenode.service: 
Failed to send unit change signal for hadoop-hdfs-namenode.service: Connection 
reset by peer
   ```
   </details>
   
   If this workaround accepted, we need to apply this to other components...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to