Using the shell to write a quick install Redis service
#!/bin/bashyum Install CPP binutils glibc-kernheaders glibc-common glibc-devel gcc make wget #安装依赖库wget http://download . redis.io/releases/redis-4.0.1.tar.gzif [-f/root/redis-4.0.1.tar.gz];then tar zxvf redis-4.0.1.tar.gz mv Redis-4. 0.1/usr/local/redis Cd/usr/local/redis make CD src/make install else echo "file does not exist!" Exit;fised-i ' 136s/daemonize no/daemonize yes/'/usr/local/redis/redis.conf # (Edit Redis service profile, modify it configuration) Sed-i ' 69s/127.0. 0.1/0.0.0.0/'/usr/local/redis/redis.conf sed-i ' 88s/protected-mode yes/protected-mode no/'/usr/local/redis/ redis.conf mkdir-p/etc/redis ln-s/usr/local/redis/redis.conf/etc/redis/6379.conf # (place profile in default profile path) Ln-s/usr/lo CAL/REDIS/UTILS/REDIS_INIT_SCRIPT/ETC/INIT.D/REDISD # (Configure the initialization file to the system self-initiated folder, REDISD as the service name, you can modify it yourself) service REDISD start # ( Turn on Redis service, service name: REDISD) #redis-cli netstat-ntpl|grep Redisecho "Redis deployment complete! "Echo" "echo" If your system is CentOS 7 after installation, watch out for the firewall and execute the following command to release the Redis external communication. "echo" Firewall-cmd--zone=public--add-port=6379/tcp--permanent "echo" Firewall-cmd--reload "echo" firewall-cmd--zone= public--query-port=6379/tcp "
Centos 7 uses the shell for rapid Redis installation