Redis缓存全自动安装shell脚本
2015-12-07 15:30
816 查看
我只是把命令放到shell文件中了,方便安装,代码如下:
#!/bin/bash # shell的执行选项: # -n 只读取shell脚本,但不实际执行 # -x 进入跟踪方式,显示所执行的每一条命令 # -c "string" 从strings中读取命令 # 下载目录 downloadsDir=/root/Downloads # 安装目录 appDir=/usr/local/redis # 判断备份目录是否存在,不存时新建目录 [ ! -d $downloadsDir ] && mkdir -p $downloadsDir cd $downloadsDir # 下载、解压、编译 wget http://download.redis.io/redis-stable.tar.gz tar xvzf redis-stable.tar.gz cd redis-stable make && make test # 若提示需要tcl或更高版本 # yum install -y tcl # make完后,一般建议make test,我在make test时提示 You need tcl 8.5 or newer in order to run the Redis test # wget http://prdownloads.sourceforge.net/tcl/tcl8.6.0-src.tar.gz # 下载后,进入安装目录,进入unix,然后执行"./configure",然后make,然后make install # 复制执行文件 cp src/redis-server /usr/local/bin/ cp src/redis-cli /usr/local/bin/ # 创建目录 mkdir /etc/redis mkdir /var/redis mkdir /var/redis/log mkdir /var/redis/run mkdir /var/redis/port # 复制redis解压根目录中中的配置文件模板 cp redis.conf /etc/redis/redis.conf # 修改配置文件 echo "################################ ZHAOXIACE DEFINE ##############################" >> /etc/redis/redis.conf echo "daemonize yes" >> /etc/redis/redis.conf echo "pidfile /var/redis/run/redis.pid" >> /etc/redis/redis.conf echo "logfile /var/redis/log/redis.log" >> /etc/redis/redis.conf echo "dir /var/redis/port" >> /etc/redis/redis.conf # 运行redis redis-server /etc/redis/redis.conf
相关文章推荐
- Windows上部署Redis-植入Windows服务
- redis-cli 命令总结
- 执行redis-trib.rb时遇到的问题
- Redis主从配置
- redis
- Redis安装部署
- redis(5)、redis最大缓存设置策略
- Redis源码分析-内存分配
- 关于Redis数据过期策略
- Redis "MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk"问题的解决
- Redis高级进阶(二)
- redis安装后提示权限问题ERR operation not permitted
- Redis配置讲解
- Redis安装部署
- 安装phpredis
- python:redis简单操作
- Redis Mass Insertion(--pipe批量插入)
- Redis在Centos7下安装,与phpredis扩展安装
- Redis常用命令
- redis的简介和配置