centos 7 安装 redis-5.0.5
[root@localhost ~]# yum -y install gcc make
[root@localhost ~]# wget http://download.redis.io/releases/redis-5.0.5.tar.gz -P /usr/local/src //下载 redis (Nosol DataBase)
[root@localhost ~]# cd /usr/local/src/ //进入目录
[root@localhost src]# tar -zxvf redis-5.0..tar.gz //解压
[root@localhost src]# cd redis-5.0./ //进入目录
[root@localhost redis-5.0.]# make //安装
[...] Hint: It's a good idea to run 'make test' ;) make[]: Leaving directory `/usr/local/src/redis-5.0./src'
[root@localhost redis-5.0.]# cd src/ //进入目录
[root@localhost src]# make install PREFIX=/usr/local/redis-5.0.
CC Makefile.dep Hint: It's a good idea to run 'make test' ;) INSTALL install
INSTALL install
INSTALL install
INSTALL install
INSTALL
[root@localhost src]# cp redis-server redis-cli /usr/local/bin
[root@localhost src]# cp redis-sentinel redis-benchmark redis-check-aof redis-check-rdb /usr/local/bin
[root@localhost src]# mkdir /etc/redis
[root@localhost src]# mkdir -p /var/lib/redis/
[root@localhost src]# sysctl -w vm.overcommit_memory= //为了使Redis正常工作,您需要设置一些内核选项,将 vm.overcommit_memory 设置为1,这意味着总是这样,这将避免数据被截断
vm.overcommit_memory =
[root@localhost src]# sysctl -w net.core.somaxconn=. //将backlog连接的最大数量更改为比 redis.conf 的 tcp-backlog 选项的值(默认为511)更高的值,您可以在 kernel.org 网站上的基于sysctl的ip网络"tunning"中找到更多信息
sysctl: setting key "net.core.somaxconn": Invalid argument
net.core.somaxconn = .
[root@localhost src]# echo never > /sys/kernel/mm/transparent_hugepage/enabled //禁用透明的大页面支持,这已知会导致Redis的延迟和内存访问问题
[root@localhost src]# find /|grep redis.conf
/usr/local/src/redis-5.0./redis.conf
[root@localhost src]# cp /usr/local/src/redis-5.0./redis.conf /etc/redis/.conf //将样本 redis.conf 复制到 /etc/redis/6379.conf 中
[root@localhost redis-5.0.]# vi /etc/redis/.conf #bind 127.0.0.1
protected-mode no
daemonize no
dir /usr/local/redis-5.0./data
appendfilename "appendonly.aof"
daemonize no
pidfile /var/run/redis_6379.pid
port
loglevel notice
logfile /var/log/redis_6379.log
dir /var/lib/redis/ [root@localhost redis-5.0.]# mkdir -p /usr/local/redis-5.0./data
[root@localhost redis-5.0.]# /usr/local/bin/redis-server &
:C Sep ::18.107 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
:C Sep ::18.107 # Redis version=5.0., bits=, commit=, modified=, pid=, just started
:C Sep ::18.107 # Warning: no config file specified, using the default config. In order to specify a config file use /usr/local/bin/redis-server /path/to/redis.conf
:M Sep ::18.107 * Increased maximum number of open files to (it was originally set to ).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0. (/) bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port:
| `-._ `._ / _.-' | PID: 14414
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' :M Sep ::18.211 # WARNING: The TCP backlog setting of cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of .
:M Sep ::18.211 # Server initialized
:M Sep ::18.211 * Ready to accept connections
//回车
[root@localhost redis-5.0.]# pgrep -l redis
redis-server
[root@localhost redis-5.0.]# find /|grep redis_init_script
/usr/local/src/redis-5.0./utils/redis_init_script
/usr/local/src/redis-5.0./utils/redis_init_script.tpl
[root@localhost redis-5.0.]# cp /usr/local/src/redis-5.0./utils/redis_init_script /etc/init.d/redis-5.0.5_6379
[root@localhost redis-5.0.]# vi /etc/systemd/system/redis-5.0.5_6379.service
[Unit] Description=Redis on port
[Service] Type=forking
ExecStart=/etc/init.d/redis-5.0.5_6379 start &
ExecStop=/etc/init.d/redis-5.0.5_6379 stop &
[Install] WantedBy=multi-user.target
echo -e "vm.overcommit_memory = 1\nnet.core.somaxconn=512" >> /etc/sysctl.conf
[root@localhost redis-5.0.]# cat /etc/sysctl.conf
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf() and sysctl.d().
vm.overcommit_memory =
net.core.somaxconn=
[root@localhost redis-5.0.]# echo "echo never > /sys/kernel/mm/transparent_hugepage/enabled" >> /etc/rc.local
[root@localhost redis-5.0.]# cat /etc/rc.local
#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot. touch /var/lock/subsys/local
echo never > /sys/kernel/mm/transparent_hugepage/enabled
[root@localhost redis-5.0.]# chmod +x /etc/rc.d/rc.local
[root@localhost redis-5.0.]# pkill redis-server
[root@localhost redis-5.0.]# pgrep -l redis*
[root@localhost redis-5.0.]# /etc/init.d/redis-5.0.5_6379 start &
Starting Redis server..
//回车 [root@localhost ~]# ps -ef | grep redis
root : pts/ :: /bin/sh /etc/init.d/redis-5.0.5_6379 start
root : pts/ :: /usr/local/bin/redis-server *:
root : pts/ :: grep --color=auto redis
[root@localhost ~]# (cd /usr/local/bin/;./redis-cli)
127.0.0.1:> set foo bar
OK
127.0.0.1:> get foo
"bar"
127.0.0.1:> exit
[root@localhost ~]#
//firewall-cmd --zone=public --add-port=6379/tcp --permanent
//firewall-cmd --reload
redis 客户端管理工具:Redis Desktop Manager
redis-clent-curl https://redisdesktop.com/
如下图:刚刚创建的foo库命令为bar
// du | sort | awk | sed | grep | egrep | tr | wc 管道抽样输出用法 //
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k '-' -d //显示文件占用资源按字母排列
32M /usr/local/redis-5.0./bin/
4.2M /usr/local/redis-5.0./bin/redis-benchmark
7.8M /usr/local/redis-5.0./bin/redis-check-aof
7.8M /usr/local/redis-5.0./bin/redis-check-rdb
4.6M /usr/local/redis-5.0./bin/redis-cli
/usr/local/redis-5.0./bin/redis-sentinel
7.8M /usr/local/redis-5.0./bin/redis-server
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k '-' -d -o sort-redis.txt //将输出写入文件sort-redis.txt
[root@localhost src]# cat sort.txt
32M /usr/local/redis-5.0./bin/
4.2M /usr/local/redis-5.0./bin/redis-benchmark
7.8M /usr/local/redis-5.0./bin/redis-check-aof
7.8M /usr/local/redis-5.0./bin/redis-check-rdb
4.6M /usr/local/redis-5.0./bin/redis-cli
/usr/local/redis-5.0./bin/redis-sentinel
7.8M /usr/local/redis-5.0./bin/redis-server
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -hr //显示文件占用资源按多到少排列
32M /usr/local/redis-5.0./bin/
7.8M /usr/local/redis-5.0./bin/redis-server
7.8M /usr/local/redis-5.0./bin/redis-check-rdb
7.8M /usr/local/redis-5.0./bin/redis-check-aof
4.6M /usr/local/redis-5.0./bin/redis-cli
4.2M /usr/local/redis-5.0./bin/redis-benchmark
/usr/local/redis-5.0./bin/redis-sentinel
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -h //显示文件占用资源按少到多排列
/usr/local/redis-5.0./bin/redis-sentinel
4.2M /usr/local/redis-5.0./bin/redis-benchmark
4.6M /usr/local/redis-5.0./bin/redis-cli
7.8M /usr/local/redis-5.0./bin/redis-check-aof
7.8M /usr/local/redis-5.0./bin/redis-check-rdb
7.8M /usr/local/redis-5.0./bin/redis-server
32M /usr/local/redis-5.0./bin/
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk '{print $2}' |uniq|wc -l [root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk '{print $2}'| grep -v redis-cli
/usr/local/redis-5.0./bin/
/usr/local/redis-5.0./bin/redis-benchmark
/usr/local/redis-5.0./bin/redis-check-aof
/usr/local/redis-5.0./bin/redis-check-rdb
/usr/local/redis-5.0./bin/redis-sentinel
/usr/local/redis-5.0./bin/redis-server
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="/"}{print $6}'|sed '/^$/d'
redis-benchmark
redis-check-aof
redis-check-rdb
redis-cli
redis-sentinel
redis-server
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="-"}{print $0}'|sed '/^$/d'
32M /usr/local/redis-5.0./bin/
4.2M /usr/local/redis-5.0./bin/redis-benchmark
7.8M /usr/local/redis-5.0./bin/redis-check-aof
7.8M /usr/local/redis-5.0./bin/redis-check-rdb
4.6M /usr/local/redis-5.0./bin/redis-cli
/usr/local/redis-5.0./bin/redis-sentinel
7.8M /usr/local/redis-5.0./bin/redis-server
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="-"}{print $1}'|sed '/^$/d'
32M /usr/local/redis
4.2M /usr/local/redis
7.8M /usr/local/redis
7.8M /usr/local/redis
4.6M /usr/local/redis
/usr/local/redis
7.8M /usr/local/redis
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="-"}{print $2}'|sed '/^$/d'
5.0./bin/
5.0./bin/redis
5.0./bin/redis
5.0./bin/redis
5.0./bin/redis
5.0./bin/redis
5.0./bin/redis
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="-"}{print $3}'|sed '/^$/d'
benchmark
check
check
cli
sentinel
server
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="/"}{print $6}'|sed '/^$/d'|egrep 'redis-check-aof|redis-benchmark'|grep -v cli
redis-benchmark
redis-check-aof
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="/"}{print $6}'|sed '/^$/d'|egrep 'redis-check-*'|grep -v rdb
redis-check-aof
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="-"}{print $1,$2,$3,$4,$5,$6}'|sed '/^$/d'
32M /usr/local/redis 5.0./bin/
4.2M /usr/local/redis 5.0./bin/redis benchmark
7.8M /usr/local/redis 5.0./bin/redis check aof
7.8M /usr/local/redis 5.0./bin/redis check rdb
4.6M /usr/local/redis 5.0./bin/redis cli
/usr/local/redis 5.0./bin/redis sentinel
7.8M /usr/local/redis 5.0./bin/redis server
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="/";OFS=" "}{print $1,$2,$3,$4,$5,$6,1234567,000,888}'|sed '/^$/d'
32M usr local redis-5.0. bin
4.2M usr local redis-5.0. bin redis-benchmark
7.8M usr local redis-5.0. bin redis-check-aof
7.8M usr local redis-5.0. bin redis-check-rdb
4.6M usr local redis-5.0. bin redis-cli
usr local redis-5.0. bin redis-sentinel
7.8M usr local redis-5.0. bin redis-server
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="/";OFS=" "}{print $1,$2,$3,$4,$5,$6,1234567,000,888}'|sed '/^$/d'|tr " " ";"
32M ;usr;local;redis-5.0.;bin;;;;
4.2M ;usr;local;redis-5.0.;bin;redis-benchmark;;;
7.8M ;usr;local;redis-5.0.;bin;redis-check-aof;;;
7.8M ;usr;local;redis-5.0.;bin;redis-check-rdb;;;
4.6M ;usr;local;redis-5.0.;bin;redis-cli;;;
;usr;local;redis-5.0.;bin;redis-sentinel;;;
7.8M ;usr;local;redis-5.0.;bin;redis-server;;;
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="/";OFS=" "}{print $1,$2,$3,$4,$5,$6,1234567,000,888}'|sed '/^$/d'|tr " " "|"
32M |usr|local|redis-5.0.|bin||||
4.2M |usr|local|redis-5.0.|bin|redis-benchmark|||
7.8M |usr|local|redis-5.0.|bin|redis-check-aof|||
7.8M |usr|local|redis-5.0.|bin|redis-check-rdb|||
4.6M |usr|local|redis-5.0.|bin|redis-cli|||
|usr|local|redis-5.0.|bin|redis-sentinel|||
7.8M |usr|local|redis-5.0.|bin|redis-server|||
[root@localhost src]# du -alh /usr/local/redis-5.0./bin/|sort -k -t '-'|awk 'BEGIN{FS="/";OFS=" "}{print $1,$2,$3,$4,$5,$6,1234567,000,888}'|sed '/^$/d'|tr " " "|"|tr "|" " "
32M usr local redis-5.0. bin
4.2M usr local redis-5.0. bin redis-benchmark
7.8M usr local redis-5.0. bin redis-check-aof
7.8M usr local redis-5.0. bin redis-check-rdb
4.6M usr local redis-5.0. bin redis-cli
usr local redis-5.0. bin redis-sentinel
7.8M usr local redis-5.0. bin redis-server
// du | sort | awk | sed | grep | egrep | tr | wc 管道抽样输出用法 //
centos 7 安装 redis-5.0.5的更多相关文章
- centos 上安装redis 3.0.5
官网下载安装包,直接使用make编译,报如下错误 : [root@localhost redis-3.0.5]# make cd src && make all make[1]: 进入 ...
- centos / Linux 服务环境下安装 Redis 5.0.3
原文:centos / Linux 服务环境下安装 Redis 5.0.3 1.首先进入你要安装的目录 cd /usr/local 2.下载目前最新稳定版本 Redis 5.0.3 wget http ...
- CentOS 7.3 安装redis 4.0.2服务
CentOS 7.3 安装redis 4.0.2服务 1.下载解压 下载地址:/home/xiaoming/ wget http://download.redis.io/releases/redis- ...
- CentOS7.2 安装redis 3.0.6集群
1.环境确认 a.系统版本查看 [hadoop@p168 ~]$ cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) b.安装依 ...
- Centos 7 安装redis,修改配置文件不生效、外网不能访问。
前提: 在用Centos 7 安装 redis 时,遇上一下几个问题 ,记录下 . 1.修改配置文件,按官网步骤启动,不生效. 2.外网无法访问redis. 步骤: 1.打开centos 虚拟机 ,按 ...
- centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named '_ctypes'
centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named '_ctypes'的解决办法 3.7版本需要一个新的包libffi-de ...
- 安装Redis 4.0单实例
一.Redis简单介绍 转载于网络 Redis是一个开源(BSD许可)的内存中的数据结构存储系统,它可以用作数据库.缓存和消息中间件.由于Redis采用运行在内存中的数据集工作方式,其性能卓越,能支持 ...
- liunx 安装redis 4.0
liunx 上安装redis 4.0.1 第一步:将 redis-4.0.1.tar.gz 压缩问上传至/home目录下 第二步: 解压文件 tar -zxvf redis-4.0.1.tar.g ...
- CentOS 7安装Hadoop 3.0.0
最近在学习大数据,需要安装Hadoop,自己弄了好久,最后终于弄好了.网上也有很多文章关于安装Hadoop的,但总会遇到一些问题,所以把在CentOS 7安装Hadoop 3.0.0的整个过程记录下来 ...
- 解决CentOS 7安装zabbix 3.0 无法启动zabbix-server的问题[segfault at 18 ip 00007f78842b4bd0 sp 00007fff1995a818 error 4 in libpthread-2.17.so[7f78842ab000+16000]]
解决CentOS 7安装zabbix 3.0 无法启动zabbix-server的问题 [root@localhost sbin]# service zabbix-server start Redir ...
随机推荐
- 虚拟化技术原理(CPU、内存、IO)
本文来自:http://www.ywnds.com/?p=5856 虚拟化 云计算现在已经非常成熟了,而虚拟化是构建云计算基础架构不可或缺的关键技术之一. 云计算的云端系统, 其实质上就是一个大型的分 ...
- 详解nohup和& 区别
nohup 一.[解释] 不挂断地运行命令.no hangup的缩写,意即“不挂断”.一般理解&记住一个命令最简单的方法是记住它是什么缩写,就自然理解了这个命令.nohup运行由 Comman ...
- Appium移动自动化测试(三)之元素定位
实验简介 做过UI自动化(web自动化, 移动自动化)的同学都会知道, 除去框架的选型和搭建以外, 落到实处的对元素进行定位就成了最重要的技能. 做过UI自动化的同学会知道, 对页面元素的定位方式有8 ...
- 阶段3 3.SpringMVC·_03.SpringMVC常用注解_5 RequestHeader注解
- iOS 企业版 打包
iOS 企业版 打包 使用 iOS 企业版的证书发布应用可以跳过 Appstore,直接发布到自己的网站,让其他人在自己的网站上下载安装,但前提是要用苹果自带的Safari 浏览器才能下载安装,其他浏 ...
- springboot和springcloud版本冲突问题
最近搭建eureka项目,出现boot和cloud版本不匹配错误,记录下来 2019-12-06 14:00:20.043 ERROR 180780 --- [ main] o.s.boot.Spri ...
- /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found错误的解决 转载
升级cmake时,提示“Error when bootstrapping CMake:Problem while running initial CMake”,第二次运行./bootstrap时,直接 ...
- unity混音
前言在游戏中,通常我们需要控制整个游戏的主音量(全局音量),并且单独控制背景音乐和其他音效(攻击.爆炸之类)的音量,这时我们可以用Audio Mixer来解决. 如果文章中有哪些地方写的不对, 欢迎指 ...
- python爬虫概述
爬虫的使用:爬虫用来对网络的数据信息进行爬取,通过URL的形式,将数据保存在数据库中并以文档形式或者报表形式进行展示. 爬虫可分为通用式爬虫或特定式爬虫,像我们经常用到的搜索引擎就属于通用式爬虫,如果 ...
- nginx配置反向代理支持session
Nginx反向代理tomcat,很是方便,但是也有些细节的问题需要注意:今天遇到了这样一个问题,tomcat中路径“host/web1”,nginx中直接“host/”代理,这时候session就无法 ...