redis 5.0.12 install
redis 5.0.12 install
## check directory
ls -l /XXXXXXX
##create dir
mkdir -p /XXXXXXX/dataredis
mkdir -p /XXXXXXX/soft
## create user
groupadd redis -g 2100
useradd -g redis -u 2100 redis
usermod -aG redis redis
chown -R redis:redis /XXXXXXX/dataredis
## system config
cat >> /etc/sysctl.conf <<eof
vm.overcommit_memory=1
vm.swappiness=1
net.ipv4.tcp_max_syn_backlog = 1024
net.core.somaxconn = 1024
eof
sysctl -p cat >> /etc/rc.local <<eof
echo never > /sys/kernel/mm/transparent_hugepage/enabled
eof cat /etc/rc.local cat >> /etc/security/limits.conf<<eof
redis soft nproc 2047
redis hard nproc 16384
redis soft nofile 1024
redis hard nofile 65536
eof cat /etc/security/limits.conf
## download
mkdir -p /XXXXXXX/soft ;cd /XXXXXXX/soft
curl -L -o redis-5.0.12.tar.gz http://10.112.6.253:9999/soft/redis/redis-5.0.12.tar.gz
tar -zxvf redis-5.0.12.tar.gz
cd redis-5.0.12
yum install -y gcc
make MALLOC=libc
make install
## redis 服务自启动--没有路径,就用手动启动,如果有可以使用系统命令起服务。
cd /usr/lib/systemd/system
cat >redis.service <<eof
[Unit]
Description=redis
##After=redis-sentinel [Service]
Group=redis
User=redis
ExecStart=/usr/local/bin/redis-server /XXXXXXX/dataredis/redis.conf --daemonize no
ExecStop=/usr/local/bin/redis-cli -h 127.0.0.1 -p 6379 -a 'redis!0okm9ijn' shutdown nosave
Restart=always [Install]
WantedBy=multi-user.target
eof
## config parameter
cp /XXXXXXX/soft/redis-5.0.12/redis.conf /XXXXXXX/dataredis sed -i \
-e 's/bind 127.0.0.1/#bind 127.0.0.1/gi' \
-e 's/timeout 0/timeout 600/gi' \
-e 's/supervised no/supervised systemd/gi' \
-e 's#logfile ""#logfile "/XXXXXXX/dataredis/redis.log"#gi' \
-e 's#dir ./#dir /XXXXXXX/dataredis #gi' \
-e 's#dir ./#dir /XXXXXXX/dataredis #gi' \
-e 's/# masterauth <master-password>/masterauth PICCredis!0okm9ijn/gi' \
-e 's/# maxclients 10000/maxclients 10000/gi' \
-e 's/# maxclients 10000/maxclients 10000/gi' \
-e 's/# maxmemory <bytes>/maxmemory 4G/gi' \
-e 's/# requirepass foobared/requirepass PICCredis!0okm9ijn/gi' \
/XXXXXXX/dataredis/redis.conf
cat /XXXXXXX/dataredis/redis.conf | grep -v ^# | grep -v ^$
chown -R redis:redis /XXXXXXX/dataredis
chmod -R 775 /XXXXXXX/dataredis
##服务启动
##systemctl enable redis
systemctl enable redis
##systemctl start redis
systemctl start redis
##systemctl restart redis
systemctl restart redis
##or 手工启动
which redis-server
/usr/local/bin/redis-server /XXXXXXX/dataredis/redis.conf &
[root@host01 dataredis]# more redis.log


10916:C 17 Jun 2021 06:59:45.486 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
10916:C 17 Jun 2021 06:59:45.486 # Redis version=5.0.12, bits=64, commit=00000000, modified=0, pid=10916, just started
10916:C 17 Jun 2021 06:59:45.486 # Configuration loaded
10916:C 17 Jun 2021 06:59:45.486 # systemd supervision requested, but NOTIFY_SOCKET not found
10916:M 17 Jun 2021 06:59:45.488 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 5.0.12 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 10916
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-' 10916:M 17 Jun 2021 06:59:45.489 # Server initialized
10916:M 17 Jun 2021 06:59:45.489 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage
issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local
in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
10916:M 17 Jun 2021 06:59:45.489 * Ready to accept connections
##login
redis-cli
redis 5.0.12 install的更多相关文章
- Redis 5.0.5 Install manual
Redis 5.0.5 安装文档(Install manual) 一.单实例安装 标题 内容 测试环境 Centos 7 虚拟机 vbox redis版本 redis 5.0.5 1.编译安装redi ...
- Linux下Redis4.0.12安装、配置、优化
一.安装 1.检查gcc环境 执行命令,如果Linux系统没有安装gcc编译器,会提示“Command not found” # gcc -v 安装gcc # yum -y install gcc 以 ...
- CentOS7怎样安装Redis4.0.12
一.安装 yum -y install tcl安装相关依赖 mkdir /usr/local/redis创建redis安装目录 cd /usr/local/redis 进入redis目录 wget h ...
- ubuntu 12 install redis
ubuntu 12 install redis 今天开始写数据server部分,大家初步的方案是用redis+mysql 所以要安装,下面记录安装的基本过程,留做后续参考 unbuntu 12 已经支 ...
- Redis 3.0 集群搭建
Redis 3.0 集群搭建 开启两个虚拟机 分别在两个虚拟机上开启3个Redis实例 3主3从两个虚拟机里的实例互为主备 下面分别在两个虚拟机上安装,网络设置参照codis集群的前两个主机 分别关闭 ...
- CentOS7.2 安装redis 3.0.6集群
1.环境确认 a.系统版本查看 [hadoop@p168 ~]$ cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) b.安装依 ...
- Linux 安装Redis 5.0
结构如下: Redis 官方不建议Redis安装在WINDOWS 服务器上(尤其是生产中分布式事物缓存). linux 下Redis 5.0主从复制(一主二从)哨兵模式的搭建:https://www. ...
- Redis 5.0.5集群搭建
Redis 5.0.5集群搭建 一.概述 Redis3.0版本之后支持Cluster. 1.1.redis cluster的现状 目前redis支持的cluster特性: 1):节点自动发现 2):s ...
- Linux下安装redis 3.0及C语言中客户端实现demo
1.获取安装文件 wget http://download.redis.io/redis-stable.tar.gz 2.解压文件 tar xzvf redis-stable.tar.gz 3.进入目 ...
随机推荐
- redis并发锁
1.应对并发场景 避免操作数据不一致 将对redis加锁 2.考虑到异常状况无法释放锁,导致死锁 将代码块进行try-catch处理 3.考虑try时宕机依然导致死锁 对锁添加时效性,添加过期时间 4 ...
- 关于Ubuntu18.04 linux系统使用搜狗输入法 出现乱码
解决: 执行下面的命令即可!无需重启系统 killall fcitx
- JavaWeb之JavaMail
时间:2016-12-19 11:58 --邮件协议1.收发邮件 发邮件是从客户端把邮件发送到服务器,收邮件是把邮件服务器的邮件下载到客户端 2.邮件协议概述 与HTTP协议相同, ...
- Linux centos 安装 maven 3.5.4
一.maven下载 1.官方下载 打开网址:http://maven.apache.org/download.cgi 下拉滚动条,找到标记处并点击 选择自己想要的版本,我这里选择的是 3.5.4,然后 ...
- 速查列表:Apache SkyWalking OAL 的 域(Scopes)
OAL简介 在流模式(Streaming mode)下,SkyWalking 提供了 观测分析语言(Observability Analysis Language,OAL) 来分析流入的数据. OAL ...
- Servlet学习笔记(二)之Servlet路径映射配置、Servlet接口、ServletConfig、ServletContext
Servlet路径映射配置 要使Servlet对象正常的运行,需要进行适当的配置,以告诉Web容器哪个请求调用哪个Servlet对象处理,对Servlet起到一个注册的作用.Servlet的配置信息包 ...
- js 中连续的 3 个点 three dots (...) in javascript
这个叫扩展运算符 https://dev.to/sagar/three-dots---in-javascript-26ci 5 种用法 1 function myFunc(...[x, y, z]) ...
- gimp 缩放图片 python script
滤镜 -> Python Fu -> 控制台,复制粘贴下面代码. 然后 scale_image(800, 800) 图片自动缩放为 800*800 了 这个代码是傻傻的缩放,你可以把它改成 ...
- Vuex的同步异步存值取值
1. vue中各个组件之间传值 1.父子组件 父组件-->子组件,通过子组件的自定义属性:props 子组件-->父组件,通过自定义事件:this.$emit('事件名',参数1,参数2, ...
- javascript(2)运算符
### js运算符 1.运算符 1.typeof 获取当前变量类型 运算符(特殊) 2.= 赋值运算符 3.== 简要比较运算符(忽略变量的类型) 4.=== 标准比较运算符(严格变量的类型.判断是否 ...