redis安装部署

下载redis源码包

redis官方下载地址:https://redis.io/download

[root@wyb ~]# yum -y install gcc gcc-c++ make
[root@wyb ~]# wget http://download.redis.io/releases/redis-5.0.5.tar.gz
[root@wyb ~]# tar zxvf redis-5.0.5.tar.gz
[root@wyb ~]# cd cd  redis-5.0.5/
[root@wyb redis-5.0.5]# make && make install

可能出现的问题:zmalloc.h:50:31: 致命错误:jemalloc/jemalloc.h:没有那个文件或目录
解决办法:make MALLOC=libc (出错根据关键字百度解决)

启动前配置

  • 使用软件自带脚本完成自定义配置
[root@wyb redis-5.0.5]# cd utils/ 
[root@wyb utils]# ./install_server.sh 
Welcome to the redis service installer This script will help you easily set up a running redis server Please select the redis port for this instance: [6379] 6300
Please select the redis config file name [/etc/redis/6300.conf] 
Selected default - /etc/redis/6300.conf
Please select the redis log file name [/var/log/redis_6300.log] 
Selected default - /var/log/redis_6300.log
Please select the data directory for this instance [/var/lib/redis/6300] 
Selected default - /var/lib/redis/6300
Please select the redis executable path [/usr/local/bin/redis-server] 
Selected config:
Port           : 6300                                    #端口
Config file    : /etc/redis/6300.conf			 #配置文件目录
Log file       : /var/log/redis_6300.log                 #日志文件目录
Data dir       : /var/lib/redis/6300 			 #数据库目录
Executable     : /usr/local/bin/redis-server	         #启动程序的目录
Cli Executable : /usr/local/bin/redis-cli	         #命令行的连接工具
Is this ok? Then press ENTER to go on or Ctrl-C to abort. #回车完成配置
Copied /tmp/6300.conf => /etc/init.d/redis_6300   #服务启动脚本
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful! #安装完成












#/etc/init.d/redis_6300 start   启动redis服务
#/etc/init.d/redis_6300 status  查看启动状态
#/etc/init.d/redis_6300 stop    停止redis服务
#/etc/init.d/redis_6300 restart 重启redis服务
##自定义配置下修改redis启动脚本
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值