chihsuan opened a new pull request, #10357:
URL: https://github.com/apache/ozone/pull/10357

   ## What changes were proposed in this pull request?
   
   This PR makes the DataNode web UI display the DataNode UUID.
   
   Some operational commands (e.g. decommission) require the DataNode UUID, but 
previously there was no easy way to look it up from the web UI. This change 
exposes the UUID through the DataNode's JMX MXBean and renders it on the 
DataNode overview page.
   
   Changes:
   - `DNMXBean` / `DNMXBeanImpl`: add a `datanodeUuid` field with a 
getter/setter, following the existing `hostName` pattern. This exposes the UUID 
as the JMX attribute `DatanodeUuid`.
   - `HddsDatanodeService`: during startup, set the UUID on the MXBean from 
`datanodeDetails.getUuidString()` (after the DataNode details are initialized, 
so the value is always present).
   - `dn-overview.html`: add two rows to the top table, Datanode UUID and 
HostName, bound to the corresponding JMX attributes.
   
   Note: the SCM web UI already shows the UUID (Node Status -> UUID column), so 
only the DataNode side needed changes here. The Jira title mentions both for 
completeness.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-15351
   
   ## How was this patch tested?
   
   Unit test: Added `TestHddsDatanodeService#testDatanodeUuidInMXBean`, which 
starts the service, reads the `DatanodeUuid` attribute from the JMX MXBean, and 
asserts it matches `datanodeDetails.getUuidString()`.
   
   Manual UI verification:
   
   ```bash
   # from repo root
   mvn clean install -DskipTests
   
   cd hadoop-ozone/dist/target/ozone-*/compose/ozone
   docker compose up -d --scale datanode=3
   ```
   
   - SCM UI (http://localhost:9876): SCM overview -> Node Status; the UUID 
column is already visible.
   - DataNode UI (ports are dynamically mapped):
     ```bash
     docker compose ps datanode
     # or compose v2:
     docker compose port --index 1 datanode 19864
     ```
     Open the returned host/port (e.g. `http://localhost:<mapped-port>`). The 
top table now shows the new rows Datanode UUID and HostName.
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to