zoukankan      html  css  js  c++  java
  • redis's usage

    authorheadsen  chen 

    date2017-12-07 16:33:40

    noticeThis article is created by  headsen chen ,and not allowed to copy,or you will counter  law  question.

    install:

    yum -y install epel-release

    yum -y install redis

    modify redis's control file:

    vim  /etc/redis.conf

       bind 192.168.1.10     # just listen the real ip of localhost.

       daemonize yes    #  redis  can work in daemon states,and when machine is open and redis  service is running.

    start:

    systemctl enable redis

    systemctl start redis

    manage:

    [root@node1 tmp]# redis-cli -h 192.168.1.10

    192.168.13.164:6379[6]> info     # to show more detail of redis 

    ...

    # Keyspace
    db6:keys=2,expires=0,avg_ttl=0          # db6 means  database is 6  and keys=2 means in 6 has two keys

    192.168.13.164:6379[6]> keys *     # keys  *     show keys name
    1) "nginx-log"
    2) "system"

    192.168.13.164:6379[6]> llen system    # see system key information,means that has 121962 values in this key not read ,and when readed for all ,will change to 0
    (integer) 121962

    192.168.13.164:6379[6]> LINDEX system -1   # to see the latest message of system key
    "{"message":"Dec 7 16:37:50 node1 elasticsearch: [2017-12-07 16:37:50,074][WARN ][monitor.jvm ] [node-1] [gc][young][80898][1132] duration [2.8s], collections [1]/[2.9s], total [2.8s]/[1.5m], memory [135.7mb]->[119.2mb]/[1015.6mb], all_pools {[young] [40.1mb]->[21.8mb]/[66.5mb]}{[survivor] [6.9mb]->[8.3mb]/[8.3mb]}{[old] [88.6mb]->[89.1mb]/[940.8mb]}","@version":"1","@timestamp":"2017-12-07T08:37:52.085Z","path":"/var/log/messages","host":"node1.com","type":"system"}"

    192.168.13.164:6379[6]> quit     # exit of redis  managerment 
    [root@node1 tmp]#

  • 相关阅读:
    Redis数据持久化机制AOF原理分析一---转
    Linux中常用头文件的作用--转
    Signal Handling--ref
    Linux 信号signal处理函数--转
    深入redis内部--初始化服务器
    haproxy 503 service unavailable no server is avaible to handle this request
    linux下logrotate配置和理解---转
    extjs_09_定义自己的页面组件
    BZOJ 3211 弗洛拉前往国家 树阵+并检查集合
    atitit.无损传输二进制数据串传输网络
  • 原文地址:https://www.cnblogs.com/kaishirenshi/p/7999911.html
Copyright © 2011-2022 走看看