Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to view the data stored in levelDB in ceph

Shulou Source: shulou.com Published: 2022-06-01 02:54:22 09月22日 Update

This article is about how to view the data stored in levelDB in ceph. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

This program is used to see what values / var/lib/ceph/osd/ceph-1/current/omap are stored in leveldb in ceph and store the query results in the levelDBFile.txt file.

# include # include "leveldb/db.h" # include "leveldb/env.h" # include "leveldb/write_batch.h" # include "leveldb/cache.h" using namespace std;int main () {leveldb::DB* db; leveldb::Options options; options.create_if_missing = true; leveldb::Status status = leveldb::DB::Open (options, "/ var/lib/ceph/osd/ceph-1/current/omap", & db) Assert (status.ok ()); ofstream outfile; outfile.open ("levelDBFile.txt", ios::out); if (! outfile) {cout Valid (); it- > Next () {outfile key () .ToString ()

Tags: Data storage content more programs articles processes good practical files articles look knowledge results reference help related query compile Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Tech Info Docker MariaDB Apple