• CentOs安装Redis


    1.安装Redis

    $ wget http://download.redis.io/releases/redis-5.0.5.tar.gz
    $ tar xzf redis-5.0.5.tar.gz
    $ cd redis-5.0.5
    $ make && make PREFIX=/usr/local/redis install
    

    测试启动Redis

    $ Redis-server
    

    2.修改Redis配置文件

    复制redis-5.0.5目录中的redis.conf文件到/usr/local/redis/,修改复制过来的文件

    $ cp -r redis.conf /usr/local/redis/
    $ vi /usr/local/redis/redis.conf
    

    常用修改内容:

    1. daemonize no-->daemonize yes,允许redis-server以后端模式启动
    2. bind 127.0.0.1-->bind 0.0.0.0,允许远程连接
    3. requirepass --> requirepass yourpassword,设置密码
    4. protected-mode yes-->protected-mode no,允许公网访问

    保存配置文件后重启Redis

    $ redis-cli 
    >shutdown
    $ redis-server ../redis.conf       #制定配置文件启动redis-server
    $ redis-cli yourpassword
    
  • 相关阅读:
    Redis 多项目序列化问题
    Java序列化的相关认知
    《Proxy系列专题》:代理模式(静态、JDK、CGLib)
    好文章地址
    @ServletComponentScan
    Spring 自动配置的原理
    B+Tree
    Sentinel
    ThreadPoolUtil
    UUID
  • 原文地址:https://www.cnblogs.com/AnotherBlue/p/11691127.html
Copyright © 2020-2023  润新知