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

   ## What changes were proposed in this pull request?
   
   (Some) Ozone CLI commands log to `ozone-shell.log` instead of the console.  
The goal was to reduce output clutter, but it causes problems due to file 
ownership.
   
   Other Ozone commands use a log config inherited from Hadoop, which allows 
customising root logger and default log level via environment variables 
OZONE_ROOT_LOGGER and OZONE_LOGLEVEL.
   
   The goal of this task is to get rid of the custom config for CLI, scrap 
`ozone-shell.log`, and respect these environment variables.  CLI commands 
should disable logging by default.
   
   https://issues.apache.org/jira/browse/HDDS-7421
   
   ## How was this patch tested?
   
   ```
   $ OZONE_LOGLEVEL=info ozone sh volume create /vol1
   2022-10-26 18:57:49,237 [main] INFO rpc.RpcClient: Creating Volume: vol1, 
with hadoop as owner and space quota set to -1 bytes, counts quota set to -1
   
   $ ozone sh volume create /vol2
   
   $ OZONE_ROOT_LOGGER=DEBUG,console ozone sh bucket create /s3v/buck
   2022-10-26 18:59:25,399 [main] DEBUG lib.MutableMetricsFactory: field 
org.apache.hadoop.metrics2.lib.MutableRate 
org.apache.hadoop.security.UserGroupInformation$UgiMetrics.getGroups with 
annotation @org.apache.hadoop.metrics2.annotation.Metric(sampleName="Ops", 
always=false, valueName="Time", about="", interval=10, type=DEFAULT, 
value={"GetGroups"})
   2022-10-26 18:59:25,404 [main] DEBUG lib.MutableMetricsFactory: field 
org.apache.hadoop.metrics2.lib.MutableRate 
org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginFailure with 
annotation @org.apache.hadoop.metrics2.annotation.Metric(sampleName="Ops", 
always=false, valueName="Time", about="", interval=10, type=DEFAULT, 
value={"Rate of failed kerberos logins and latency (milliseconds)"})
   ...
   2022-10-26 18:59:25,815 [IPC Client (939475028) connection to 
om/172.25.0.8:9862 from hadoop] DEBUG ipc.Client: IPC Client (939475028) 
connection to om/172.25.0.8:9862 from hadoop: closed
   2022-10-26 18:59:25,815 [IPC Client (939475028) connection to 
om/172.25.0.8:9862 from hadoop] DEBUG ipc.Client: IPC Client (939475028) 
connection to om/172.25.0.8:9862 from hadoop: stopped, remaining connections 0
   
   $ ozone fs -mkdir ofs://om/vol/buck/dir/subdir
   mkdir: `ofs://om/vol/buck/dir': No such file or directory
   
   $ ozone fs -mkdir -p ofs://om/vol/buck/dir/subdir
   
   $ OZONE_LOGLEVEL=INFO ozone fs -mkdir -p ofs://om/vol/buck/dir/subdir/other
   
   $ OZONE_LOGLEVEL=DEBUG ozone fs -mkdir -p ofs://om/vol/buck/dir/subdir/other
   ...
   2022-10-26 19:15:59,808 [main] DEBUG ipc.ProtobufRpcEngine: Call: 
submitRequest took 8ms
   2022-10-26 19:15:59,814 [main] DEBUG fs.Globber: glob 
ofs://om/vol/buck/dir/subdir/other: duration 0:00.037s
   ...
   ```
   
   Daemon logs are not changed:
   
   ```
   $ docker-compose logs scm | head
   Attaching to ozone_scm_1
   scm_1       | No '-XX:...' jvm parameters are set. Adding safer GC settings 
'-XX:ParallelGCThreads=8 -XX:+UseConcMarkSweepGC 
-XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled' to the 
OZONE_OPTS
   scm_1       | OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC 
was deprecated in version 9.0 and will likely be removed in a future release.
   scm_1       | 2022-10-26 18:56:18,317 [main] INFO 
server.StorageContainerManagerStarter: STARTUP_MSG: 
   scm_1       | /************************************************************
   scm_1       | STARTUP_MSG: Starting StorageContainerManager
   scm_1       | STARTUP_MSG:   host = 2ab1fd025ab6/172.25.0.2
   scm_1       | STARTUP_MSG:   args = [--init]
   scm_1       | STARTUP_MSG:   version = 1.3.0-SNAPSHOT
   ```
   
   Added a couple of assertions in acceptance tests to verify output is empty 
for happy path CLI executions.
   
   Regular CI:
   https://github.com/adoroszlai/hadoop-ozone/actions/runs/3318850256


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