zoukankan      html  css  js  c++  java
  • 【原创】运维基础之Redis(1)简介、安装、使用

    redis 5.0.3

    官方:https://redis.io/

    一 简介

    Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. It supports data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, geospatial indexes with radius queries and streams. Redis has built-in replication, Lua scripting, LRU eviction, transactions and different levels of on-disk persistence, and provides high availability via Redis Sentinel and automatic partitioning with Redis Cluster.

    redis是开源的内存数据结构仓库,可以用作数据库、缓存或消息队列,支持丰富的数据类型:strings, hashes, lists, sets, sorted sets, bitmaps, hyperloglogs, geospatial indexes,支持多副本、lua脚本、lru、事务、持久化,同时支持高可用和分区(Sentinel);

    二 安装

    $ wget http://download.redis.io/releases/redis-5.0.3.tar.gz
    $ tar xzf redis-5.0.3.tar.gz
    $ cd redis-5.0.3
    $ make

    三 使用

    启动server

    $ src/redis-server

    连接本地server

    $ src/redis-cli
    redis> set foo bar
    OK
    redis> get foo
    "bar"

    连接远程server

    $ src/redis-cli
    Could not connect to Redis at 127.0.0.1:6379: Connection refused
    not connected> connect 192.168.0.1 6379
    192.168.0.1:6379> ping
    PONG
    192.168.0.1:6379> set hello world
    OK
    192.168.0.1:6379> get hello
    "world"

    常用命令参考:https://redis.io/commands

  • 相关阅读:
    leetcode236
    leetcode139
    leetcode56
    leetcode19
    2018-5-22-SublimeText-粘贴图片保存到本地
    2019-1-29-Sublime-Text-安装中文、英文字体
    2019-1-29-Sublime-Text-安装中文、英文字体
    2018-8-15-WPF-插拔触摸设备触摸失效
    2018-8-15-WPF-插拔触摸设备触摸失效
    2019-10-18-dotnet-修复找不到-System.ServiceProcess-定义
  • 原文地址:https://www.cnblogs.com/barneywill/p/10382817.html
Copyright © 2011-2022 走看看