ECS:如何使用 JCASScript 執行時限查詢
Summary: 如何使用 JCASScript 執行時限查詢。
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Instructions
JCASScript 運行有時間限制的查詢並生成在該時間範圍內寫入的剪輯。
若要執行此查詢,我們需要個別的 PEA 檔案。請參閱 KB 文章 ECS:如何使用 JCASScript.jar 在 ECS 上執行基本的 CAS API 作業 以查找存儲桶擁有者以及如何獲取相應的 PEA 檔。
如果我們沒有 ECS UI 的根存取權限,Dell 支援團隊會要求使用者提供個別的 PEA 檔案。
從 ECS 節點使用 JCASScript:
- 以系統管理員使用者身分登入任何節點,進入物件主容器。
admin@ecsnode1:~> sudo dockobj
- 切換到 castools 目錄。
ecsnode1:/ # cd /opt/storageos/tools/castools
- 建立您的 PEA 檔案:
ecsnode1:/opt/storageos/tools/castools # vi icoe_cas.pea
ecsnode1:/opt/storageos/tools/castools # cat icoe_cas.pea
<pea version="1.0.0">
<defaultkey name="icoe_cas_obusr">
<credential id="csp1.secret" enc="base64">UmJaVGNsb1Z1M0hxaHVDN3ZXTmE=</credential>
</defaultkey>
<key type="cluster" id="23a0767d-d6e7-3f41-bc1d-89d139549fe2" name="icoe_cas_obusr">
<credential id="csp1.secret" enc="base64">UmJaVGNsb1Z1M0hxaHVDN3ZXTmE=</credential>
</key>
</pea>
ecsnode1:/opt/storageos/tools/castools #
- 將 castool 匯出到”
$LD_LIBRARY_PATH":
ecsnode1:/opt/storageos/tools/castools # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/storageos/tools/castools/
- 取得在 CAS 連接埠 (3218) 上接聽的 IP 位址:
ecsnode1:/opt/storageos/tools/castools # sudo ss -nap | grep :3218 | grep LISTEN | grep -oP "(?:[0-9]{1,3}\.){3}[0-9]{1,3}"
- 開始”
JCASScript.jar」互動式 CLI:
ecsnode1:/opt/storageos/tools/castools # java -jar JCASScript.jar
CASScript>
- 連線至集區:
# poolOpen <ipaddress>?<path to pea file>
在下面的示例中,使用 localhost 我們可以使用上述步驟中返回的數據 IP。
For example:
CASScript>po localhost?icoe_cas.pea
Attempting to connect to: localhost?icoe_cas.pea
Connected to: localhost?icoe_cas.pea
CASPool Properties:
Connection String: localhost?icoe_cas.pea
Cluster Time: 2020.07.30 02:06:39 GMT
Buffer Size: 16384
Prefetch Buffer Size: 32768
Connection Timeout: 120000
Multi-Cluster Failover Enabled: True
Collision Avoidance Enabled: False
CASScript>
- 要啟動時限查詢,我們必須設置下限和上限。
querySet下限 設置查詢表達式的開始日期。開始日期表示查詢表達式的下限。
語法:查詢設置下限開始日期
查詢設置上限 設置查詢表達式的結束日期。結束日期表示查詢運算式
語法的上限:querySetFixedUpper EndTime
For example:
CASScript>querySetLowerBound "2020.07.29 00:00:00"
Query Expression Properties:
Start Time: 2020.07.29 00:00:00
End Time : UNBOUNDED
Type : EXISTING
CASScript>querySetUpperBound "2020.07.30 14:00:00"
Query Expression Properties:
Start Time: 2020.07.29 00:00:00
End Time : 2020.07.30 14:00:00
Type : EXISTING
- 執行查詢,並將片段儲存至檔案。
queryToFile (qtf) 基於查詢表達式物件查詢群集,並將 C-Clip ID 儲存在指定的檔中。我們可以選擇設定要傳回的 C-Clip ID 的最大數量。
語法:
語法:
qtf clips
For example:
CASScript>qtf cliplist_30Jul2020
Performing clip query
Query Expression Properties:
Start Time: 2020.07.29 00:00:00
End Time : 2020.07.30 14:00:00
Type : EXISTING
Number of clips returned: 50
All results returned: True
Query results written to: cliplist_30Jul2020
CASScript>
- 只取得要返回的特定數量的剪輯,然後使用以下選項
語法:queryToFile 檔案名稱 maxClipIDsToReturn
For example:
CASScript>qtf cliplist_30Jul2020_limited 25
Performing clip query
Query Expression Properties:
Start Time: 2020.07.29 00:00:00
End Time : 2020.07.30 14:00:00"querySetUpperBound "2020.07.30 14:00:00
Type : EXISTING
Number of clips returned: 25
All results returned: False
Point of incompletion: 2020.07.30 01:20:45 GMT
Query results written to: cliplist_30Jul2020_limited
CASScript>
- 確認傳回的片段數量。
Exit from JCASScript
CASScript>exit
ecsnode1:/opt/storageos/tools/castools # wc -l cliplist_30Jul2020_limited
25 cliplist_30Jul2020_limited
ecsnode1:/opt/storageos/tools/castools #
ecsnode1:/opt/storageos/tools/castools # wc -l cliplist_30Jul2020
50 cliplist_30Jul2020
ecsnode1:/opt/storageos/tools/castools #
Additional Information
如需更多有關 JCASScript 使用方式的詳細資料,請參閱 KB 文章 ECS: 中的 JCASScript 指南。如何使用 JCASScript.jar 在 ECS 上執行基本的 CAS API 作業。
Affected Products
Elastic Cloud StorageProducts
ECS Appliance Hardware Series, ECS Appliance Software with Encryption, ECS Appliance Software without Encryption, Elastic Cloud StorageArticle Properties
Article Number: 000020612
Article Type: How To
Last Modified: 27 Aug 2025
Version: 5
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.