前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >centos7上安装redis

centos7上安装redis

作者头像
庞小明
发布2018-03-07 18:07:49
1.9K0
发布2018-03-07 18:07:49
举报
文章被收录于专栏:pangguomingpangguomingpangguoming

关闭防火墙: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running) 配置编译环境: sudo yum install gcc-c++ 下载源码: wget http://download.redis.io/releases/redis-3.2.8.tar.gz 解压源码: tar -zxvf redis-3.2.8.tar.gz 进入到解压目录: cd redis-3.2.8 执行make编译Redis: make MALLOC=libc 注意:make命令执行完成编译后,会在src目录下生成6个可执行文件,分别是redis-server、redis-cli、redis-benchmark、redis-check-aof、redis-check-rdb、redis-sentinel。 安装Redis: make install  配置Redis能随系统启动: ./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]  Selecting default: 6379 Please select the redis config file name [/etc/redis/6379.conf]  Selected default - /etc/redis/6379.conf Please select the redis log file name [/var/log/redis_6379.log]  Selected default - /var/log/redis_6379.log Please select the data directory for this instance [/var/lib/redis/6379]  Selected default - /var/lib/redis/6379 Please select the redis executable path [/usr/local/bin/redis-server]  Selected config: Port           : 6379 Config file    : /etc/redis/6379.conf Log file       : /var/log/redis_6379.log Data dir       : /var/lib/redis/6379 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/6379.conf => /etc/init.d/redis_6379 Installing service... Successfully added to chkconfig! Successfully added to runlevels 345! Starting Redis server... Installation successful! Redis服务查看、开启、关闭: a.通过ps -ef|grep redis命令查看Redis进程 b.开启Redis服务操作通过/etc/init.d/redis_6379 start命令,也可通过(service redis_6379 start) c.关闭Redis服务操作通过/etc/init.d/redis_6379 stop命令,也可通过(service redis_6379 stop) redis.conf 的配置信息 1、daemonize 如果需要在后台运行,把该项改为yes 2、pidfile 配置多个pid的地址 默认在/var/run/redis.pid 3、bind 绑定ip,设置后只接受来自该ip的请求 4、port 监听端口,默认是6379 5、loglevel 分为4个等级:debug verbose notice warning 6、logfile 用于配置log文件地址 7、databases 设置数据库个数,默认使用的数据库为0 8、save 设置redis进行数据库镜像的频率。 9、rdbcompression 在进行镜像备份时,是否进行压缩 10、dbfilename 镜像备份文件的文件名 11、Dir 数据库镜像备份的文件放置路径 12、Slaveof 设置数据库为其他数据库的从数据库 13、Masterauth 主数据库连接需要的密码验证 14、Requriepass 设置 登陆时需要使用密码 15、Maxclients 限制同时使用的客户数量 16、Maxmemory 设置redis能够使用的最大内存 17、Appendonly 开启append only模式 18、Appendfsync 设置对appendonly.aof文件同步的频率(对数据进行备份的第二种方式) 19、vm-enabled 是否开启虚拟内存支持 (vm开头的参数都是配置虚拟内存的) 20、vm-swap-file 设置虚拟内存的交换文件路径 21、vm-max-memory 设置redis使用的最大物理内存大小 22、vm-page-size 设置虚拟内存的页大小 23、vm-pages 设置交换文件的总的page数量 24、vm-max-threads 设置VM IO同时使用的线程数量 25、Glueoutputbuf 把小的输出缓存存放在一起 26、hash-max-zipmap-entries 设置hash的临界值 27、Activerehashing 重新hash

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017-09-13 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
云数据库 Redis
腾讯云数据库 Redis(TencentDB for Redis)是腾讯云打造的兼容 Redis 协议的缓存和存储服务。丰富的数据结构能帮助您完成不同类型的业务场景开发。支持主从热备,提供自动容灾切换、数据备份、故障迁移、实例监控、在线扩容、数据回档等全套的数据库服务。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档