استخدام مراقب الطيور
يرشدك هذا الدليل إلى كيفية استخدام Birdwatcher للتحقق من حالة الميلفوس وتهيئته أثناء التنقل.
ابدأ تشغيل Birdwatcher
Birdwatcher هو أداة سطر أوامر، يمكنك تشغيله على النحو التالي:
./birdwatcher
ثم سيتم استقبالك بالمطالبة التالية:
Offline >
الاتصال بـ etcd
تحتاج إلى استخدام Birdwatcher Birdwatcher للاتصال بـ etcd قبل أي عمليات أخرى.
الاتصال بالإعدادات الافتراضية
Offline > connect Milvus(by-dev) >
الاتصال من Birdwatcher في كبسولة
إذا اخترت تشغيل Birdwatcher Birdwatcher في جراب Kubernetes، فأنت بحاجة أولاً إلى الحصول على عنوان IP الخاص بـ etcd على النحو التالي:
kubectl get pod my-release-etcd-0 -o 'jsonpath={.status.podIP}'
ثم الوصول إلى غلاف الحجرة.
kubectl exec --stdin --tty birdwatcher-7f48547ddc-zcbxj -- /bin/sh
أخيرًا، استخدم عنوان IP الذي تم إرجاعه للاتصال بـ etcd كما يلي:
Offline > connect --etcd ${ETCD_IP_ADDR}:2379 Milvus(by-dev)
الاتصال بمسار جذر مختلف
إذا كان المسار الجذر لـ Milvus الخاص بك مختلفًا عن
by-dev
وتمت مطالبتك بخطأ يفيد بوجود مسار جذر غير صحيح، يمكنك الاتصال بـ etcd كما يلي:Offline > connect --rootPath my-release Milvus(my-release) >
إذا كنت لا تعرف المسار الجذر لـ Milvus الخاص بك، اتصل بـ إلخd على النحو التالي:
Offline > connect --dry using dry mode, ignore rootPath and metaPath Etcd(127.0.0.1:2379) > find-milvus 1 candidates found: my-release Etcd(127.0.0.1:2379) > use my-release Milvus(my-release) >
تحقق من حالة ميلفوس
يمكنك استخدام الأوامر show
للتحقق من حالة ميلفوس.
Milvus(my-release) > show -h
Usage:
show [command]
Available Commands:
alias list alias meta info
channel-watch display channel watching info from data coord meta store
checkpoint list checkpoint collection vchannels
collection-history display collection change history
collection-loaded display information of loaded collection from querycoord
collections list current available collection from RootCoord
config-etcd list configuations set by etcd source
configurations iterate all online components and inspect configuration
current-version
database display Database info from rootcoord meta
index
partition list partitions of provided collection
querycoord-channel display querynode information from querycoord cluster
querycoord-cluster display querynode information from querycoord cluster
querycoord-task display task information from querycoord
replica list current replica information from QueryCoord
segment display segment information from data coord meta store
segment-index display segment index information
segment-loaded display segment information from querycoordv1 meta
segment-loaded-grpc list segments loaded information
session list online milvus components
Flags:
-h, --help help for show
Use " show [command] --help" for more information about a command.
سرد الجلسات
لسرد جلسات العمل المرتبطة بمكونات مختلفة في ملفوس:
Milvus(by-dev) > show session
Session:datacoord, ServerID: 3, Version: 2.2.11, Address: 10.244.0.8:13333
Session:datanode, ServerID: 6, Version: 2.2.11, Address: 10.244.0.8:21124
Session:indexcoord, ServerID: 4, Version: 2.2.11, Address: 10.244.0.8:31000
Session:indexnode, ServerID: 5, Version: 2.2.11, Address: 10.244.0.8:21121
Session:proxy, ServerID: 8, Version: 2.2.11, Address: 10.244.0.8:19529
Session:querycoord, ServerID: 7, Version: 2.2.11, Address: 10.244.0.8:19531
Session:querynode, ServerID: 2, Version: 2.2.11, Address: 10.244.0.8:21123
Session:rootcoord, ServerID: 1, Version: 2.2.11, Address: 10.244.0.8:53100
في إخراج الأوامر، يتوافق كل إدخال جلسة عمل مدرج في show session
مع عقدة أو خدمة نشطة حاليًا ومسجلة في إلخd.
التحقق من قواعد البيانات والمجموعات
يمكنك سرد جميع قواعد البيانات والمجموعات.
سرد قواعد البيانات
في إخراج الأمر، يمكنك العثور على معلومات حول كل قاعدة بيانات.
Milvus(by-dev) > show database ============================= ID: 1 Name: default TenantID: State: DatabaseCreated --- Total Database(s): 1
سرد المجموعات
في مخرجات الأمر، يمكنك العثور على معلومات مفصلة حول كل مجموعة.
Milvus(by-dev) > show collections ================================================================================ DBID: 1 Collection ID: 443407225551410746 Collection Name: medium_articles_2020 Collection State: CollectionCreated Create Time: 2023-08-08 09:27:08 Fields: - Field ID: 0 Field Name: RowID Field Type: Int64 - Field ID: 1 Field Name: Timestamp Field Type: Int64 - Field ID: 100 Field Name: id Field Type: Int64 - Primary Key: true, AutoID: false - Field ID: 101 Field Name: title Field Type: VarChar - Type Param max_length: 512 - Field ID: 102 Field Name: title_vector Field Type: FloatVector - Type Param dim: 768 - Field ID: 103 Field Name: link Field Type: VarChar - Type Param max_length: 512 - Field ID: 104 Field Name: reading_time Field Type: Int64 - Field ID: 105 Field Name: publication Field Type: VarChar - Type Param max_length: 512 - Field ID: 106 Field Name: claps Field Type: Int64 - Field ID: 107 Field Name: responses Field Type: Int64 Enable Dynamic Schema: false Consistency Level: Bounded Start position for channel by-dev-rootcoord-dml_0(by-dev-rootcoord-dml_0_443407225551410746v0): [1 0 28 175 133 76 39 6] --- Total collections: 1 Matched collections: 1 --- Total channel: 1 Healthy collections: 1 ================================================================================
عرض مجموعة محددة
يمكنك عرض مجموعة محددة من خلال تحديد معرفها.
Milvus(by-dev) > show collection-history --id 443407225551410746 ================================================================================ DBID: 1 Collection ID: 443407225551410746 Collection Name: medium_articles_2020 Collection State: CollectionCreated Create Time: 2023-08-08 09:27:08 Fields: - Field ID: 0 Field Name: RowID Field Type: Int64 - Field ID: 1 Field Name: Timestamp Field Type: Int64 - Field ID: 100 Field Name: id Field Type: Int64 - Primary Key: true, AutoID: false - Field ID: 101 Field Name: title Field Type: VarChar - Type Param max_length: 512 - Field ID: 102 Field Name: title_vector Field Type: FloatVector - Type Param dim: 768 - Field ID: 103 Field Name: link Field Type: VarChar - Type Param max_length: 512 - Field ID: 104 Field Name: reading_time Field Type: Int64 - Field ID: 105 Field Name: publication Field Type: VarChar - Type Param max_length: 512 - Field ID: 106 Field Name: claps Field Type: Int64 - Field ID: 107 Field Name: responses Field Type: Int64 Enable Dynamic Schema: false Consistency Level: Bounded Start position for channel by-dev-rootcoord-dml_0(by-dev-rootcoord-dml_0_443407225551410746v0): [1 0 28 175 133 76 39 6]
عرض كافة المجموعات المحملة
يمكنك جعل Birdwatcher يقوم بتصفية كافة المجموعات المحملة.
Milvus(by-dev) > show collection-loaded Version: [>= 2.2.0] CollectionID: 443407225551410746 ReplicaNumber: 1 LoadStatus: Loaded --- Collections Loaded: 1
سرد كافة نقاط فحص القنوات الخاصة بمجموعة ما
يمكنك أن تطلب من Birdwatcher سرد كافة نقاط التفتيش الخاصة بمجموعة محددة.
Milvus(by-dev) > show checkpoint --collection 443407225551410746 vchannel by-dev-rootcoord-dml_0_443407225551410746v0 seek to 2023-08-08 09:36:09.54 +0000 UTC, cp channel: by-dev-rootcoord-dml_0_443407225551410746v0, Source: Channel Checkpoint
التحقق من تفاصيل الفهرس
قم بتشغيل الأمر التالي لسرد كافة ملفات الفهرس بالتفصيل.
Milvus(by-dev) > show index
*************2.1.x***************
*************2.2.x***************
==================================================================
Index ID: 443407225551410801 Index Name: _default_idx_102 CollectionID:443407225551410746
Create Time: 2023-08-08 09:27:19.139 +0000 Deleted: false
Index Type: HNSW Metric Type: L2
Index Params:
==================================================================
سرد الأجزاء
قم بتشغيل الأمر التالي لسرد كافة الأقسام في مجموعة محددة.
Milvus(by-dev) > show partition --collection 443407225551410746
Parition ID: 443407225551410747 Name: _default State: PartitionCreated
--- Total Database(s): 1
التحقق من حالة القناة
قم بتشغيل الأمر التالي لعرض حالة القناة
Milvus(by-dev) > show channel-watch
=============================
key: by-dev/meta/channelwatch/6/by-dev-rootcoord-dml_0_443407225551410746v0
Channel Name:by-dev-rootcoord-dml_0_443407225551410746v0 WatchState: WatchSuccess
Channel Watch start from: 2023-08-08 09:27:09 +0000, timeout at: 1970-01-01 00:00:00 +0000
Start Position ID: [1 0 28 175 133 76 39 6], time: 1970-01-01 00:00:00 +0000
Unflushed segments: []
Flushed segments: []
Dropped segments: []
--- Total Channels: 1
سرد كافة النسخ المتماثلة والأجزاء
سرد كافة النسخ المتماثلة
قم بتشغيل الأمر التالي لسرد كافة النسخ المتماثلة والمجموعات المقابلة لها.
Milvus(by-dev) > show replica ================================================================================ ReplicaID: 443407225685278721 CollectionID: 443407225551410746 version:>=2.2.0 All Nodes:[2]
سرد كافة المقاطع
قم بتشغيل الأمر التالي لسرد كافة المقاطع وحالتها
SegmentID: 443407225551610865 State: Flushed, Row Count:5979 --- Growing: 0, Sealed: 0, Flushed: 1 --- Total Segments: 1, row count: 5979
قم بتشغيل الأمر التالي لسرد جميع المقاطع المحملة بالتفصيل. بالنسبة إلى Milvus 2.1.x، استخدم
show segment-loaded
بدلاً من ذلك.Milvus(by-dev) > show segment-loaded-grpc =========== ServerID 2 Channel by-dev-rootcoord-dml_0_443407225551410746v0, collection: 443407225551410746, version 1691486840680656937 Leader view for channel: by-dev-rootcoord-dml_0_443407225551410746v0 Growing segments number: 0 , ids: [] SegmentID: 443407225551610865 CollectionID: 443407225551410746 Channel: by-dev-rootcoord-dml_0_443407225551410746v0 Sealed segments number: 1
سرد التكوينات
يمكنك أن تطلب من Birdwatcher سرد التكوينات الحالية لكل مكون من مكونات Milvus.
Milvus(by-dev) > show configurations
client nil Session:proxy, ServerID: 8, Version: 2.2.11, Address: 10.244.0.8:19529
Component rootcoord-1
rootcoord.importtaskexpiration: 900
rootcoord.enableactivestandby: false
rootcoord.importtaskretention: 86400
rootcoord.maxpartitionnum: 4096
rootcoord.dmlchannelnum: 16
rootcoord.minsegmentsizetoenableindex: 1024
rootcoord.port: 53100
rootcoord.address: localhost
rootcoord.maxdatabasenum: 64
Component datacoord-3
...
querynode.gracefulstoptimeout: 30
querynode.cache.enabled: true
querynode.cache.memorylimit: 2147483648
querynode.scheduler.maxreadconcurrentratio: 2
وكبديل عن ذلك، يمكنك زيارة كل مكون من مكونات Milvus للعثور على تكوينه. يوضح ما يلي كيفية سرد تكوينات QueryCoord بالمعرف 7.
Milvus(by-dev) > show session
Session:datacoord, ServerID: 3, Version: 2.2.11, Address: 10.244.0.8:13333
Session:datanode, ServerID: 6, Version: 2.2.11, Address: 10.244.0.8:21124
Session:indexcoord, ServerID: 4, Version: 2.2.11, Address: 10.244.0.8:31000
Session:indexnode, ServerID: 5, Version: 2.2.11, Address: 10.244.0.8:21121
Session:proxy, ServerID: 8, Version: 2.2.11, Address: 10.244.0.8:19529
Session:querycoord, ServerID: 7, Version: 2.2.11, Address: 10.244.0.8:19531
Session:querynode, ServerID: 2, Version: 2.2.11, Address: 10.244.0.8:21123
Session:rootcoord, ServerID: 1, Version: 2.2.11, Address: 10.244.0.8:53100
Milvus(by-dev) > visit querycoord 7
QueryCoord-7(10.244.0.8:19531) > configuration
Key: querycoord.enableactivestandby, Value: false
Key: querycoord.channeltasktimeout, Value: 60000
Key: querycoord.overloadedmemorythresholdpercentage, Value: 90
Key: querycoord.distpullinterval, Value: 500
Key: querycoord.checkinterval, Value: 10000
Key: querycoord.checkhandoffinterval, Value: 5000
Key: querycoord.taskexecutioncap, Value: 256
Key: querycoord.taskmergecap, Value: 8
Key: querycoord.autohandoff, Value: true
Key: querycoord.address, Value: localhost
Key: querycoord.port, Value: 19531
Key: querycoord.memoryusagemaxdifferencepercentage, Value: 30
Key: querycoord.refreshtargetsintervalseconds, Value: 300
Key: querycoord.balanceintervalseconds, Value: 60
Key: querycoord.loadtimeoutseconds, Value: 1800
Key: querycoord.globalrowcountfactor, Value: 0.1
Key: querycoord.scoreunbalancetolerationfactor, Value: 0.05
Key: querycoord.reverseunbalancetolerationfactor, Value: 1.3
Key: querycoord.balancer, Value: ScoreBasedBalancer
Key: querycoord.autobalance, Value: true
Key: querycoord.segmenttasktimeout, Value: 120000
مقاييس النسخ الاحتياطي
يمكنك جعل Birdwatcher يقوم بعمل نسخة احتياطية من المقاييس لجميع المكونات
Milvus(my-release) > backup
Backing up ... 100%(2452/2451)
backup etcd for prefix done
http://10.244.0.10:9091/metrics
http://10.244.0.10:9091/metrics
http://10.244.0.10:9091/metrics
http://10.244.0.10:9091/metrics
http://10.244.0.10:9091/metrics
http://10.244.0.10:9091/metrics
http://10.244.0.10:9091/metrics
http://10.244.0.10:9091/metrics
backup for prefix done, stored in file: bw_etcd_ALL.230810-075211.bak.gz
ثم يمكنك التحقق من الملف في الدليل حيث تبدأ تشغيل Birdwatcher.
مجموعات الاستقصاء
يمكنك جعل Birdwatcher يستقصي حالة المجموعات المحملة بمفاتيح أساسية محددة أو استعلامات وهمية.
استقصاء المجموعات ذات المفتاح الأساسي المعروف
في الأمر probe
، يجب تحديد المفتاح الأساسي باستخدام العلامة pk
ومعرف المجموعة باستخدام العلامة collection
.
Milvus(by-dev) > probe pk --pk 110 --collection 442844725212299747
PK 110 found on segment 442844725212299830
Field id, value: &{long_data:<data:110 > }
Field title, value: &{string_data:<data:"Human Resources Datafication" > }
Field title_vector, value: &{dim:768 float_vector:<data:0.022454707 data:0.007861045 data:0.0063843643 data:0.024065714 data:0.013782166 data:0.018483251 data:-0.026526336 ... data:-0.06579628 data:0.00033906146 data:0.030992996 data:-0.028134001 data:-0.01311325 data:0.012471594 > }
Field article_meta, value: &{json_data:<data:"{\"link\":\"https:\\/\\/towardsdatascience.com\\/human-resources-datafication-d44c8f7cb365\",\"reading_time\":6,\"publication\":\"Towards Data Science\",\"claps\":256,\"responses\":0}" > }
استقصي جميع المجموعات باستخدام استعلامات وهمية
يمكنك أيضًا جعل Birdwatcher يستقصي جميع المجموعات باستخدام استعلامات وهمية.
Milvus(by-dev) > probe query
probing collection 442682158191982314
Found vector field vector(103) with dim[384], indexID: 442682158191990455
failed to generated mock request probing index type IVF_FLAT not supported yet
probing collection 442844725212086932
Found vector field title_vector(102) with dim[768], indexID: 442844725212086936
Shard my-release-rootcoord-dml_1_442844725212086932v0 leader[298] probe with search success.
probing collection 442844725212299747
Found vector field title_vector(102) with dim[768], indexID: 442844725212299751
Shard my-release-rootcoord-dml_4_442844725212299747v0 leader[298] probe with search success.
probing collection 443294505839900248
Found vector field vector(101) with dim[256], indexID: 443294505839900251
Shard my-release-rootcoord-dml_5_443294505839900248v0 leader[298] probe with search success.