細細.魚 发表于 2018-11-4 06:50:14

centos下安装redis-it虫

  1)root权限下安装gcc
  查看是否安装gcc,root下输入gcc,如果出现:gcc: no input files,说明已经安装好了
  yum install gcc
  2)下载压缩包
  wget http://download.redis.io/releases/redis-3.2.8.tar.gz
  3)进入已解压的文件夹进行编译
  make
  4)安装指定目录
  make PREFIX=/usr/local/redis install
  5)在redis安装目录下新建conf文件夹,复制解压包文件夹下的redis.conf到这个conf文件下
  cp /opt/soft/redis-3.2.8/redis.conf /usr/local/redis/conf/
  6)启动
  ./redis-server ../conf/redis.conf
  可以修改redis.conf中的daemonize no--》daemonize yes转为后台启动
  7)查看启动端口
  lsof -i :6379
  ps aux|grep redis
  root      56240.10.1299961864 ?      Ssl02:26   0:00 ./redis-server 127.0.0.1:6379
  8)停止redis
  ./redis-cli shutdown save
  9)设置密码
  找到 # requirepass foobared 然后去掉注释,把foobared该为自己的密码
  10)设置访问IP
  bind 127.0.0.1 这个是默认只有本机访问,注释掉,重启以后变为
  ps -axu|grep redis
  root      68780.10.1299962004 ?      Ssl07:00   0:00 ./redis-server *:6379

页: [1]
查看完整版本: centos下安装redis-it虫