• Linux 平台下 Redis 安装教程


    Redis

    Redis 是一个开源的使用ANSI C语言编写、遵守BSD协议、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。

    使用教程

    • 安装 Redis
    wget https://download.redis.io/releases/redis-6.2.5.tar.gz
    tar xzf redis-6.2.5.tar.gz
    cd redis-6.2.5
    make install PREFIX=/usr/local/redis
    ln -s /usr/local/redis/bin/* /usr/local/bin/
    mkdir /usr/local/redis/{etc,var}
    cp redis.conf /usr/local/redis/etc/
    sed -i "s@logfile.*@logfile /usr/local/redis/var/redis.log@" /usr/local/redis/etc/redis.conf
    sed -i 's@pidfile.*@pidfile /run/redis/redis.pid@' /usr/local/redis/etc/redis.conf  
    sed -i "s@^dir.*@dir /usr/local/redis/var@" /usr/local/redis/etc/redis.conf 
    sed -i "s@^# bind 127.0.0.1@bind 127.0.0.1@" /usr/local/redis/etc/redis.conf
    sed -i 's@daemonize no@daemonize yes@' /usr/local/redis/etc/redis.conf  
    sed -i 's@^supervised.*@supervised systemd@' /usr/local/redis/etc/redis.conf   
    
    • systemctl 开机启动
    mkdir /run/redis
    cp utils/systemd-redis_server.service /lib/systemd/system/redis-server.service
    sed -i "s@^ExecStart.*@ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf@" /lib/systemd/system/redis-server.service
    sed -i "s@^Type=.*@Type=forking@" /lib/systemd/system/redis-server.service
    systemctl enable redis-server
    systemctl start redis-server
    

    注意

    • 所有操作均在 root 权限下进行
  • 相关阅读:
    Spring系列之访问数据库
    (转载)Java反射机制
    Spring系列之IOC容器
    SpringMVC系列之基本配置
    Java中Comparable和Comparator区别小结
    计算机网络知识点回顾
    Java内部类
    Java接口回调机制
    linux mysql-bin.000001占用磁盘空间过大解决方法
    linux mysql数据库登录密码忘记了怎么办
  • 原文地址:https://www.cnblogs.com/skiy/p/redis-install.html
Copyright © 2020-2023  润新知