下载安装RedisServer
mkdir –p /data/download && cd /data/downloadwget http://download.redis.io/releases/redis-5.0.0.tar.gztar zxvf redis-5.0.0.tar.gzcd redis-5.0.0make install完成上面步骤之后,Redis相关bin文件件就已经安装到/usr/bin/local目录下了配置RedisServermkdir –p /data/rediscat > /data/redis/redis.conf << 'EOF'port 6379bind 0.0.0.0#cluster-enabled yes#cluster-config-file nodes.conf#cluster-node-timeout 5000appendonly yesEOF启动RedisServercd /data/redis/usr/local/bin/redis-server ./redis.conf配置守护服务cat > /etc/systemd/system/redis-6379.service << ‘EOF’[Unit]Description=redis service[Service]WorkingDirectory=/data/redis/ExecStart=/usr/local/bin/redis-server /data/redis/redis.confRestart=always# Restart service after 10 seconds if the dotnet service crashes:RestartSec=10KillSignal=SIGINTSyslogIdentifier=redis-serviceUser=root[Install]WantedBy=multi-user.targetEOFsystemctl enable redis-6379.service >>: Created symlink /etc/systemd/system/multi-user.target.wants/redis-6379.service → /etc/systemd/system/redis-6379.service.启动服务systemctl start redis-6379.service 检查服务状态systemctl status redis-6379.service可以看到Active: active (running) since Sun 2018-10-21 03:35:09 EDT; 7s ago再通过netstat –nltp查看开放的端口,tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 5687/redis-server 0至此,Redis Server已经安装配置好,服务器重启之后也会自动启动