westerndigitalcorporation / zenfs

ZenFS is a storage backend for RocksDB that enables support for ZNS SSDs and SMR HDDs.
GNU General Public License v2.0
238 stars 87 forks source link

Allow user to select log destination #240

Open metaspace opened 1 year ago

metaspace commented 1 year ago

Currently logs are stored in /tmp with a predefined name. We should allow users to select the log destination at mount time.

Maybe also allow syslog destination?

kekeMemory commented 1 year ago

Thanks for your help. I am sorry,I run ROCKSDB_PLUGINS=zenfs make -j48 dbbench dbg~~ I did not get log file with "Info(logger, "New Zoned Block Device: %s", filename_.c_str());" info logs in /tmp.

metaspace commented 1 year ago

I think that is the way to go. Maybe you need to make clean first. Are you building for rocksdb or terarkdb?

kekeMemory commented 1 year ago

I think that is the way to go. Maybe you need to make clean first. Are you building for rocksdb or terarkdb?

I built the rocksdb.

metaspace commented 1 year ago

I just tested myself and I do see the log files appear in tmp. But rocksdb is a little difficult to build in debug mode. Here is what I did (checked out rocksdb in /home/aeh/rocksdb):

make ROCKSDB_PLUGINS=zenfs -j$(nproc) db_bench gen-pc DEBUG_LEVEL=2
mv librocksdb_debug.a librocksdb.a
cd plugin/zenfs/util
PKG_CONFIG_PATH=/home/aeh/tmp/rocksdb make EXTRA_CXXFLAGS="-I/home/aeh/src -I/home/aeh/src/rocksdb/include -L/home/aeh/src/rocksdb"
./zenfs mkfs --zbd nvme2n2 --aux_path=/home/aeh/tmp/rocks-aux --force
cd ../tests
FS_PARAMS=--fs-uri=zenfs://dev:nvme2n2 ./run.sh my-test smoke

And now I have a logfile:

ls /tmp/zenfs_nvme*
/tmp/zenfs_nvme2n2_2022-11-02_10:44:53.log
kekeMemory commented 1 year ago

@metaspace Hi, excuse me, still the log info issue. I thought I did not get write log files like your file:

"zenfs_nvme*_year-month-day_time.log"

I can get this kind of log file:

I did :

./zenfs mkfs --zbd nvme* --aux_path=/home/tmp/rocks-aux --force
And I now have this two logfile:
$ ls /tmp/rocks-aux/rocksdbtest/dbbench
LOCK LOG  

I checked the LOG Info, but is not the same with zenfs_nvme*_year-month-day_time.loginfo,so how can I solve?

kekeMemory commented 1 year ago

I am sorry to bother you, since I really did not find the name like: zenfs_nvme*_year-month-day_time.log

I have used the latest rocksdb and zenfs, and zenfs is embedded in /home/rocksdb/plugin/zenfs/ I wanna to see the file from the code /home/rocksdb/plugin/zenfs/fs/zbdzenfs.cc: `Info(logger, "New Zoned Block Device: %s", zbdbe>GetFilename().c_str());`

When I did db_bench test in /home/rocksdb, i have move the compiled zenfs util to the same path //home/rocksdb I can only get the this two logfile:

$ ls /tmp/rocks-aux/rocksdbtest/dbbench
LOCK LOG 

So i do not know where to find? @yhr @metaspace @royguo

aravind-wdc commented 1 year ago

@kekeMemory when formatting the zenfs filesystem, did you use the "--enable-gc=true" option ?

kekeMemory commented 1 year ago

@kekeMemory when formatting the zenfs filesystem, did you use the "--enable-gc=true" option ?

Yes, I have set --enable-gc

aravind-wdc commented 1 year ago

Did you run a smoke test or a dbbench workload and then check ?

kekeMemory commented 1 year ago

Yes, I used a dbbench workload

Aravind @.***> 于2022年12月2日周五 12:37写道:

Did you run a smoke test or a dbbench workload and then check ?

— Reply to this email directly, view it on GitHub https://github.com/westerndigitalcorporation/zenfs/issues/240#issuecomment-1334721660, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJYX5WCKM62LIGBQ2VRE2ITWLFVJFANCNFSM6AAAAAARG2FAMI . You are receiving this because you were mentioned.Message ID: @.***>

-- kathy