redis在linux系统下的安装与部署

  • Post author:
  • Post category:linux


1,yum install wget

2,cd ~

3,mkdir soft

4,cd soft

5,wget    http://download.redis.io/releases/redis-5.0.5.tar.gz

6,tar xf    redis…tar.gz

7,cd redis-src

8,看README.md

9, make

….yum install  gcc

….  make distclean

10,make

11,cd src   ….生成了可执行程序

12, cd ..

13,make install PREFIX=/opt/redis5

14,vi /etc/profile

…   export  REDIS_HOME=/opt/redis5

…   export PATH=$PATH:$REDIS_HOME/bin

..source /etc/profile

15,cd utils

16,./install_server.sh  (可以执行一次或多次)

a)  一个物理机中可以有多个redis实例(进程),通过port区分

b)  可执行程序就一份在目录,但是内存中未来的多个实例需要各自的配置文件,持久化目录等资源

c)  service   redis_6379  start/stop/stauts     >   linux   /etc/init.d/****

d)脚本还会帮你启动!

【注意】

在安装redis6时会报错

This systems seems to use systemd.

Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!

修改这个install_server.sh

把下面这一段进行注释

#bail if this system is managed by systemd
#_pid_1_exe="$(readlink -f /proc/1/exe)"
#if [ "${_pid_1_exe##*/}" = systemd ]
#then
#       echo "This systems seems to use systemd."
#       echo "Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!"
#       exit 1
#fi


17,ps -fe |  grep redis



版权声明:本文为u012716909原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。