From aa69027dc78cc46c2e9fc2f80569bac4bfbc6af9 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 18 Jan 2021 03:12:46 -0800 Subject: [PATCH] Updated Filer Change Data Capture (markdown) --- Filer-Change-Data-Capture.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Filer-Change-Data-Capture.md b/Filer-Change-Data-Capture.md index e09ef1e..b209807 100644 --- a/Filer-Change-Data-Capture.md +++ b/Filer-Change-Data-Capture.md @@ -7,9 +7,13 @@ Actually SeaweedFS can give you more! You can watch the SeaweedFS meta data changes. ``` -$ weed watch -h -Example: weed watch [-filer=localhost:8888] [-target=/] +$ weed filer.meta.tail -h +Example: weed filer.meta.tail [-filer=localhost:8888] [-target=/] Default Usage: + -es string + comma-separated elastic servers http:// + -es.index string + ES index name (default "seaweedfs") -filer string filer hostname:port (default "localhost:8888") -pathPrefix string @@ -21,13 +25,18 @@ Default Usage: Description: See recent changes on a filer. -$ weed watch +$ weed filer.meta.tail dir:/home new_entry:{name:"3190.pdf" chunks:{size:1130805 mtime:1608763500740201000 e_tag:"5c745d0a109bde58e0baaa6515c3694a" fid:{volume_id:1 file_key:35 cookie:4265699614}} attributes:{file_size:1130805 mtime:1608763500 file_mode:432 uid:502 gid:20 crtime:1608763500 mime:"application/pdf" replication:"000" md5:"\\t]\n\x10\x9b\xdeXສe\x15\xc3iJ"}} delete_chunks:true new_parent_path:"/home" signatures:1622972984 ``` +If configured Elastic Search server names, the meta data will be sent to Elastic Search +``` +$ weed filer.meta.tail -es=http://localhost:9200 +``` + # How it works? -The `weed watch` code is nothing fancy. It is calls a gRPC stream API to subscribe to all meta data changes and simply print out the meta data. +The `weed filer.meta.tail` code is nothing fancy. It is calls a gRPC stream API to subscribe to all meta data changes and simply print out the meta data. The gRPC API has several important use cases within SeaweedFS: * Replicate data to other SeaweedFS clusters in `weed filer.sync`.