Ozone data profiling enabled services Recon

Foreword


Before I wrote an article on Ozone data profiling services Recon article: "Data Eye" design storage systems - data profiling services , roughly describes the process of how to do Recon data by periodically taking snapshots of the secondary analysis of OM. But it did not introduce the process of how Recon service is enabled, and after this service is enabled, its internal process of how to run. I was introduced to this article to supplement the content of this piece.

Ozone Recon enabled services


Ozone Recon services need to rely on metadata OM, which by way of periodic synchronous OM metadata db to do. So here you need to configure a mailing address for the OM Recon service, here is the http address of OM (where 9874 is the default port),

<property>
   <name>ozone.om.http-address</name>
   <value>{om host}:9874</value>
</property>

Then recon db, recon om storage directory db, and this we also recommend additional configuration,

<property>
   <name>ozone.recon.db.dir</name>
   <value>/path/to/recon.db</value>
</property>

<property>
   <name>ozone.recon.om.db.dir</name>
   <value>/path/to/recon_om.db</value>
</property>

Next is the time Recon OM db file synchronization intervals, this can actually use needs to be configured, the default is 10 minutes Synchronization once.

<property>
   <name>recon.om.snapshot.task.interval.delay</name>
   <value>3m</value>
</property>

After the above configuration acknowledgment configured, we can begin to start the recon services, and execute the following command,

~/apache/ozone/bin/ozone --daemon start recon

Then log in recon, we can clearly see its internal operation is being performed,

2019-12-15 07:28:33,697 [main] INFO       - Starting Recon server
2019-12-15 07:28:34,921 [main] INFO       - Registered task ContainerKeyMapperTask with controller.
2019-12-15 07:28:35,178 [main] INFO       - Registered task FileSizeCountTask with controller.
2019-12-15 07:28:35,341 [main] WARN       - ozone.recon.om.db.dir is not configured. We recommend adding this setting. Falling back to ozone.metadata.dirs instead.
2019-12-15 07:28:35,539 [main] INFO       - Starting ReconOMMetadataManagerImpl
2019-12-15 07:28:35,539 [main] WARN       - ozone.recon.om.db.dir is not configured. We recommend adding this setting. Falling back to ozone.metadata.dirs instead.
2019-12-15 07:29:35,541 [pool-8-thread-1] INFO       - Syncing data from Ozone Manager.
2019-12-15 07:29:35,542 [pool-8-thread-1] INFO       - Obtaining full snapshot from Ozone Manager
2019-12-15 07:29:36,917 [pool-8-thread-1] INFO       - Got new checkpoint from OM : /home/hdfs/data/meta/om.snapshot.db_1576420175542
2019-12-15 07:29:37,062 [pool-8-thread-1] INFO       - Created OM DB snapshot at /home/hdfs/data/meta/om.snapshot.db_1576420175542.
2019-12-15 07:29:37,342 [pool-8-thread-1] INFO       - Calling reprocess on Recon tasks.
2019-12-15 07:29:37,345 [pool-6-thread-1] INFO       - Starting a 'reprocess' run of ContainerKeyMapperTask.
2019-12-15 07:29:37,939 [pool-6-thread-1] INFO       - Creating new Recon Container DB at /home/hdfs/data/meta/recon.db/recon-container.db_1576420177346
2019-12-15 07:29:37,940 [pool-6-thread-1] INFO       - Cleaning up old Recon Container DB at /home/hdfs/data/meta/recon.db/recon-container.db_1576384466698.
2019-12-15 07:29:37,997 [pool-6-thread-1] INFO       - Completed 'reprocess' of ContainerKeyMapperTask.
2019-12-15 07:29:37,998 [pool-6-thread-1] INFO       - It took me 0.651 seconds to process 0 keys.
201

Because of these recon server at boot time, it did not create any of the key file, so there is no key is processed above, but in fact recon db file has been created.

[hdfs@lyq meta]$ ls -l /home/hdfs/data/meta/recon.db/
total 44
drwxrwxr-x 2 hdfs hdfs  4096 Dec 14 08:42 om.db.checkpoints
-rw-rw-r-- 1 hdfs hdfs 36864 Dec 16 07:19 ozone_recon_sqlite.db
drwxr-xr-x 2 hdfs hdfs  4096 Dec 15 07:38 recon-container.db_1576420725643

Ozone_recon_sqlite.db above will be used to store the data summary table data analysis.
OM Snapshot db file, when I tested is placed in another directory on,

[hdfs@lyq meta]$ ls -l
total 32
drwxrwxr-x 2 hdfs hdfs 4096 Dec 15 07:38 om.snapshot.db_1576420724252

Then we randomly create a small number of key files Ozone freon tool,

[hdfs@lyq logs]$ ~/apache/ozone/bin/ozone freon randomkeys --numOfVolumes=1 --numOfBuckets=1 --numOfKeys=2 --keySize=10240
2019-12-15 07:37:57,102 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2019-12-15 07:37:57,158 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 10 second(s).
2019-12-15 07:37:57,158 INFO impl.MetricsSystemImpl: ozone-freon metrics system started
2019-12-15 07:38:03,571 [main] INFO       - Number of Threads: 10
2019-12-15 07:38:03,574 [main] INFO       - Number of Volumes: 1.
2019-12-15 07:38:03,575 [main] INFO       - Number of Buckets per Volume: 1.
2019-12-15 07:38:03,575 [main] INFO       - Number of Keys per Bucket: 2.
2019-12-15 07:38:03,575 [main] INFO       - Key size: 10240 bytes
2019-12-15 07:38:03,575 [main] INFO       - Buffer size: 4096 bytes
2019-12-15 07:38:03,575 [main] INFO       - validateWrites : false
2019-12-15 07:38:03,585 [main] INFO       - Starting progress bar Thread.

 0.00% |?                                                                                                    |  0/2 Time: 0:00:002019-12-15 07:38:03,600 [pool-2-thread-2] INFO       - Creating Volume: vol-0-85226, with hdfs as owner.
2019-12-15 07:38:04,107 [pool-2-thread-1] INFO       - Creating Bucket: vol-0-85226/bucket-0-19333, with Versioning false and Storage Type set to DISK and Encryption set to false
 0.00% |?                                                                                                    |  0/2 Time: 0:00:012019-12-15 07:38:04,839 WARN impl.MetricsSystemImpl: ozone-freon metrics system already initialized!
 0.00% |?                                                                                                    | 50.00% |???????????????????????????????????????????????????                                                   100.00% |?????????????????????????????????????????????????????????????????????????????????????????????????????|  2/2 Time: 0:00:04

***************************************************
Status: Success
Git Base Revision: e97acb3bd8f3befd27418996fa5d4b50bf2e17bf
Number of Volumes created: 1
Number of Buckets created: 1
Number of Keys added: 2
Ratis replication factor: ONE
Ratis replication type: STAND_ALONE
Average Time spent in volume creation: 00:00:00,048
Average Time spent in bucket creation: 00:00:00,006
Average Time spent in key creation: 00:00:00,056
Average Time spent in key write: 00:00:00,441
Total bytes written: 20480
Total Execution time: 00:00:11,299
***************************************************

Then we have the next synchronization process OM db file, you can see the new key to be written is being processed.

2019-12-15 07:38:45,421 [pool-8-thread-1] INFO       - Created OM DB snapshot at /home/hdfs/data/meta/om.snapshot.db_1576420724252.
2019-12-15 07:38:45,642 [pool-8-thread-1] INFO       - Calling reprocess on Recon tasks.
2019-12-15 07:38:45,643 [pool-6-thread-1] INFO       - Starting a 'reprocess' run of ContainerKeyMapperTask.
2019-12-15 07:38:46,272 [pool-6-thread-1] INFO       - Creating new Recon Container DB at /home/hdfs/data/meta/recon.db/recon-container.db_1576420725643
2019-12-15 07:38:46,272 [pool-6-thread-1] INFO       - Cleaning up old Recon Container DB at /home/hdfs/data/meta/recon.db/recon-container.db_1576420543845.
2019-12-15 07:38:46,875 [pool-6-thread-1] INFO       - Completed 'reprocess' of ContainerKeyMapperTask.
2019-12-15 07:38:46,876 [pool-6-thread-1] INFO       - It took me 1.233 seconds to process 2 keys.
2019-12-15 07:38:47,303 [pool-6-thread-1] INFO       - Completed a 'reprocess' run of FileSizeCountTask.

But the results of these analyzes only the data is written ozone_recon_sqlite.db, not well presented to external use, this feature should follow to improve a lot. Currently Recon Server's UI is just a simple page display, integrated follow-up will do more data. We can continue to focus on the follow-up progress Recon, the current Ozone community has achieved in stages of the work Recon 2.0. Recon below shows the web UI:
Here Insert Picture Description

Published 373 original articles · won praise 403 · Views 2.03 million +

Guess you like

Origin blog.csdn.net/Androidlushangderen/article/details/103571120