1.3. 导航 CLI 资源
Data Grid CLI 会公开一个 navigable 树,允许您列出、描述和操作 Data Grid 集群资源。
提示
按 Tab 键显示可用命令和选项。使用 -h 选项显示帮助文本。
当您连接到 Data Grid 集群时,它会在默认缓存容器上下文中打开。
[//containers/default]>
[//containers/default]>
使用
ls列出资源。[//containers/default]> ls caches counters configurations schemas tasks
[//containers/default]> ls caches counters configurations schemas tasksCopy to Clipboard Copied! Toggle word wrap Toggle overflow 使用
cd导航资源树。cd caches
cd cachesCopy to Clipboard Copied! Toggle word wrap Toggle overflow 使用
describe查看有关资源的信息。describe
describeCopy to Clipboard Copied! Toggle word wrap Toggle overflow { "name" : "default", "version" : "xx.x.x-FINAL", "cluster_name" : "cluster", "coordinator" : true, "cache_configuration_names" : [ "org.infinispan.REPL_ASYNC", "___protobuf_metadata", "org.infinispan.DIST_SYNC", "org.infinispan.LOCAL", "org.infinispan.INVALIDATION_SYNC", "org.infinispan.REPL_SYNC", "org.infinispan.SCATTERED_SYNC", "org.infinispan.INVALIDATION_ASYNC", "org.infinispan.DIST_ASYNC" ], "physical_addresses" : "[192.0.2.0:7800]", "coordinator_address" : "<hostname>", "cache_manager_status" : "RUNNING", "created_cache_count" : "1", "running_cache_count" : "1", "node_address" : "<hostname>", "cluster_members" : [ "<hostname1>", "<hostname2>" ], "cluster_members_physical_addresses" : [ "192.0.2.0:7800", "192.0.2.0:7801" ], "cluster_size" : 2, "defined_caches" : [ { "name" : "mycache", "started" : true }, { "name" : "___protobuf_metadata", "started" : true } ] }{ "name" : "default", "version" : "xx.x.x-FINAL", "cluster_name" : "cluster", "coordinator" : true, "cache_configuration_names" : [ "org.infinispan.REPL_ASYNC", "___protobuf_metadata", "org.infinispan.DIST_SYNC", "org.infinispan.LOCAL", "org.infinispan.INVALIDATION_SYNC", "org.infinispan.REPL_SYNC", "org.infinispan.SCATTERED_SYNC", "org.infinispan.INVALIDATION_ASYNC", "org.infinispan.DIST_ASYNC" ], "physical_addresses" : "[192.0.2.0:7800]", "coordinator_address" : "<hostname>", "cache_manager_status" : "RUNNING", "created_cache_count" : "1", "running_cache_count" : "1", "node_address" : "<hostname>", "cluster_members" : [ "<hostname1>", "<hostname2>" ], "cluster_members_physical_addresses" : [ "192.0.2.0:7800", "192.0.2.0:7801" ], "cluster_size" : 2, "defined_caches" : [ { "name" : "mycache", "started" : true }, { "name" : "___protobuf_metadata", "started" : true } ] }Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3.1. CLI 资源 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
Data Grid CLI 会公开不同的资源:
- 创建、修改和管理本地或集群缓存。
- 为 Data Grid 集群执行管理操作。
缓存资源
[//containers/default]> ls caches counters configurations schemas tasks
[//containers/default]> ls
caches
counters
configurations
schemas
tasks
缓存-
网格缓存实例。默认缓存容器为空。使用 CLI 从模板或
infinispan.xml文件创建缓存。 计数器-
记录对象计数的
强或弱计数器。 配置- 数据网格配置。
schemas- 协议缓冲器(Protobuf)模式,在缓存中构建数据。
tasks- 远程任务创建和管理 Data Grid 缓存定义。
集群资源
[hostname@cluster/]> ls containers cluster server
[hostname@cluster/]> ls
containers
cluster
server
containers- 在 Data Grid 集群上缓存容器。
cluster- 列出加入集群的数据网格服务器。
server- 管理和监控数据网格服务器的资源。