Redis
解压文件
1
| tar -zxvf /opt/software/redis.tar.gz -C /opt/module/
|
查看Linux系统有没有gcc环境
安装gcc
编译redis
1 2
| cd /opt/module/redis-6.2.6 make
|
安装redis
1
| make install PREFIX=/opt/module/redis-6.2.6
|
拷贝conf
1
| cp redis.conf /opt/moduele/redis-6.2.6/bin
|
启动redis
1
| ./bin/redis-server redis.conf
|
1
| ./bin/redis-server --port 6388
|
备份 redis.conf , 拷贝一份 redis.conf 到其他目录。 如让在 /etc 目录下,cp redis.conf /etc/redis.conf
修改配置文件, 将 daemonize no 改成 yes, 让服务在后台启动
redis 后台启动: redis-server /etc/redis.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| [Unit] Description=Redis After=syslog.target network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/run/redis_6379.pid ExecStart=/usr/local/redis-6.2.4/src/redis-server /usr/local/redis-6.2.4/redis.conf ExecStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [Install] WantedBy=multi-user.target
|
查看redis进程