aerospike工具集——Command-Line Utility (cli)

来源:互联网 发布:vod电影点播软件 编辑:程序博客网 时间:2024/06/05 13:47


Command-Line Utility (cli)

Aerospike命令行工具(cli)允许在命令行执行简单的get,set和delet操作,来验证数据库的基本操作。命令行工具使用的信息如下:

用法

对aerospike集群执行一个命令。

cli OPTIONS

Options

  • -t, --target <host:port>

    查询一个集群节点(host:port)

    默认: 127.0.0.1:3000

  • -h, --host <host>

    主机集群节点的查询

    默认: 127.0.0.1

  • -p, --port <port>

    端口号

    默认: 3000

  • -U, --user <user name>用户名

    User name to access record, required when using the enterprise security feature.

  • -P, --password [password]密码

    Password to access record, required when using the enterprise security feature.

  • -o, --operand <operand>

    数据库操作, note that set and put are equivalent: get, set, put, delete

    默认: get

  • -n --namespace <ns>

    namespace (命名空间)

    默认: test

  • -s --set <set>

    the set the key belongs in

    默认: ""

  • -k, --key

    key - 必须要设置,没有默认值

  • --d64, --digest-base64

    Interpret key as a base64 digest

  • --d16, --digest-base16, --digest-hex

    Interpret key as a base16 (hex) digest

  • -i, --integer-key, --key-integer

    True if key is a integer

  • -b, --bin

    name of the bin

    默认: ""

  • -e, --recordttl <ttl>

    记录的过期时间

    默认: None

  • -v, --value

    value

  • --verbose

    make the request verbose

例如

Set an object with a key string of "server01" and a value of "This is my hostname" in the namespace "users"

server01为key,执行的操作为set,命名空间为users,值为 "This is my hostname"

cli -o set -n users -k server01 -v "This is my hostname"

Get a records with a key of "server01" from the namespace "users"

根据key:server01和命名空间users ,get记录

cli -o get -n users -k server01

Note that this tool is meant to be used for basic validation only. Aerospike is not intended to be used through the command line tool. cli creates a new connection pool for every transaction which is very inefficient.


aerospike提供的cli工具除了cli之外还有ascli,aql等包括同样功能的操作,我觉得可以根据自己的喜欢选择一种熟练操作。




0 0
原创粉丝点击