redis入门

Posted 努力,奋斗

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了redis入门相关的知识,希望对你有一定的参考价值。

语法

$ redis-cli -h host -p port -a password

[[email protected]_92_135_centos ~]# redis-cli -h localhost -p 6179 -a password

[[email protected]_92_135_centos ~]# redis-cli -p 6179 -a password

 Redis

Info 命令

以一种易于理解和阅读的格式,返回关于 Redis 服务器的各种信息和统计数值。
127.0.0.1:6179> info
# Server     // Redis 服务器信息
redis_version:3.0.7
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:6d9f5068f58dedd9
redis_mode:standalone
os:Linux 2.6.32-696.6.3.el6.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.7
process_id:10485
run_id:110be938a878adcb948ae2a39e24590042b75e83
tcp_port:6179
uptime_in_seconds:2602176
uptime_in_days:30
hz:10
lru_clock:4575578
config_file:/etc/redis/redis.conf

# Clients // 已连接客户端信息
connected_clients:38
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

# Memory //内存信息
used_memory:2746592
used_memory_human:2.62M
used_memory_rss:4067328
used_memory_peak:2936696
used_memory_peak_human:2.80M
used_memory_lua:36864
mem_fragmentation_ratio:1.48
mem_allocator:jemalloc-3.6.0

# Persistence //RDB 和 AOF 的相关信息
loading:0
rdb_changes_since_last_save:9037
rdb_bgsave_in_progress:0
rdb_last_save_time:1528700058
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:-1
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok


# Stats  // 一般统计信息
total_connections_received:278
total_commands_processed:594611
instantaneous_ops_per_sec:0
total_net_input_bytes:55608230
total_net_output_bytes:95981771
instantaneous_input_kbps:0.02
instantaneous_output_kbps:0.00
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:59
evicted_keys:0
keyspace_hits:154331
keyspace_misses:429683
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:0
migrate_cached_sockets:0


# Replication //主/从复制信息
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:104857600
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0

# CPU  //CPU 计算量统计信息
used_cpu_sys:1013.83
used_cpu_user:568.66
used_cpu_sys_children:0.00
used_cpu_user_children:0.00

# Cluster //Redis 集群信息
cluster_enabled:0


# Keyspace //数据库相关的统计信息
db1:keys=238,expires=1,avg_ttl=12535118

 ------------------------------------------------------------------------

127.0.0.1:6179[4]> select 1
OK
127.0.0.1:6179[1]> keys *



















































































以上是关于redis入门的主要内容,如果未能解决你的问题,请参考以下文章

Cg入门20:Fragment shader - 片段级模型动态变色(实现汽车动态换漆)

Cg入门19:Fragment shader - 片段级模型动态变色

redis入门教程3-客户端

Redis事务入门及命令

Redis事务入门及命令

Redis入门——基本操作