linux redis4.0.1一键安装脚本

测试了几个不同环境,成功顺利完成 自动 安装,启动,配置开机自动启动

#!/bin/sh
yum -y install make gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel gettext gettext-devel ncurses-devel gmp-devel pspell-devel unzip libcap lsof cmake automake autoconf zlib zlib-devel glibc glibc-devel glib2 libxml glib2-devel libxml2 libxml2-devel bzip2 bzip2-devel libXpm libXpm-devel libidn libidn-devel libtool libtool-ltdl-devel* libmcrypt libmcrypt-devel libevent-devel libmcrypt* curl curl-devel perl perl-Net-SSLeay pcre pcre-devel openldap openldap-devel openldap-clients openldap-servers libjpeg libpng libjpeg-devel libjpeg-6b libjpeg-devel-6b libpng-devel libtiff-devel freetype freetype-devel gd gd-devel
wget https://www.isres.com/file/redis-4.0.1.tar.gz
tar -zxvf redis-4.0.1.tar.gz
cd redis-4.0.1
make
cd src
make install PREFIX=/usr/local/redis
#将配置文件移动到redis目录
cd  ../
mv redis.conf /usr/local/redis/redis.conf
cp /usr/local/redis/redis.conf /usr/local/redis/redis.conf.bak
#redis数据默认目录/data/redisdb
sed -i 's/dir .\//dir \/data\/redisdb/g' /usr/local/redis/redis.conf
mkdir -p /data/redisdb
#后台运行
sed -i 's/daemonize no/daemonize yes/g' /usr/local/redis/redis.conf
#开机启动配置
echo  "/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf" >> /etc/rc.local
#启动redis
/usr/local/redis/bin/redis-server /usr/local/redis/redis.conf

install_redis.zip

转载请注明出处:https://www.isres.com/shell/177.html

发表留言

人生在世,错别字在所难免,无需纠正。

    captcha