Redis自动化安装脚本
2015-12-24 15:08
579 查看
redis自动安装脚本: 安装目录:/usr/local/redis 二进制文件:/usr/local/bin 配置文件:/usr/local/redis/etc,配置文件自己根据自身的业务去配置,这里只是一个空文件. 日志文件:/usr/local/redis/logs 数据文件:/usr/local/redis/dump #!/bin/bash Soft_dir="/home/tools" Download_URL="http://download.redis.io/releases/redis-2.8.19.tar.gz" Redis_Version="2.8.19" root_or_not(){ if [ `id -u` != 0 ] ; then echo -e "\e[1;44m <====You are not root,Please login in root!====> \e[0m" exit 1 fi } install_or_not(){ read -p "Install redis, Input Y ; Do not install redis,Input N:" INSTALL_OR_NOT case $INSTALL_OR_NOT in Y|y) install_redis ;; N|n) echo -e "\e[0;44m <====Stop install Redis====> \e[0m" exit 1 ;; *) echo -e "\e[1;44m Only Input Y or N \e[0m" install_or_not ;; esac } check_result(){ if [ $1 != 0 ];then echo -e "\e[1,44m <==== Error,Exit install redis ====> \e[0m" exit 1 fi } install_redis(){ [ ! -d ${Soft_dir} ] && mkdir ${Soft_dir} cd ${Soft_dir} check_result $? yum install wget - y check_result $? wget $Download_URL check_result $? tar xf redis-${Redis_Version}.tar.gz check_result $? cd redis-${Redis_Version} check_result $? make check_result $? make install check_result $? mkdir -p /usr/local/redis/{etc,dump,logs} check_result $? touch /usr/local/redis/etc/redis.conf check_result $? echo -e "\e[1;44m <======Please Configure redis.conf =======> \e[0m" } root_or_not install_or_not ~
相关文章推荐
- 从源码安装Mysql/Percona 5.5
- redis安装问题小结
- Varnish Install And Configure
- Redis偶发连接失败案例实战记录
- Redis中实现查找某个值的范围
- Redis和Memcached的区别详解
- 分割超大Redis数据库例子
- Redis总结笔记(一):安装和常用命令
- Redis sort 排序命令详解
- 用Redis实现微博关注关系
- redis中修改配置文件中的端口号 密码方法
- 在Ruby on Rails上使用Redis Store的方法
- 安装软件 Nullsoft Install System 2.27汉化版 下载
- Redis和Memcache的区别总结
- 在Node.js应用中使用Redis的方法简介
- Redis服务器的启动过程分析
- web 应用中常用的各种 cache详解
- 利用yum安装Redis的方法详解
- 从MySQL到Redis的简单数据库迁移方法
- 为啥懒 Redis 是更好的 Redis