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.进入目 ...
随机推荐
- 字符串拷贝函数递归与非递归的C语言实现
初学递归的时候,觉得很抽象,不好分析,确实如此,尤其是有些时候控制语句不对,导致程序进去无限次的调用,更严重的是栈溢出.既要正确的控制结束语句,又要有正确的进入下次递归的语句,还要有些操作语句.... ...
- ABC类IP地址
A类IP地址一个A类IP地址由1字节的网络地址和3字节主机地址组成,网络地址的最高位 必须是"0", 地址范围从1.0.0.0 到126.0.0.0.可用的A类网络有126个,每个 ...
- 原来:HTTP可以复用TCP连接
问题 线上的一个项目会和微信服务器有API请求(目的是获取用户的微信信息),但会有偶发的报错: 'Connection aborted.', ConnectionResetError(104, 'Co ...
- git tag的用法及意义
git tag 介绍 命令是用来给当前项目状态(在某次commit后)打标签的,目的是便于以后将项目状态回滚到当时打标签的状态.可以把它与虚拟机的snapshot(快照)进行类比. 回想当时在看< ...
- linux 查看用户密码
2021-07-26 1.查看前三个密码 head -3 / etc / passwd # 注解 /etc/passwd 中一行记录对应着一个用户,每行记录又被冒号 (:) 分隔为 7 个字段,其格式 ...
- ☕【Java技术指南】「并发编程专题」CompletionService框架基本使用和原理探究(基础篇)
前提概要 在开发过程中在使用多线程进行并行处理一些事情的时候,大部分场景在处理多线程并行执行任务的时候,可以通过List添加Future来获取执行结果,有时候我们是不需要获取任务的执行结果的,方便后面 ...
- linux网络编程(一)
============================================================== 第一天:基本概念.TCP.FTP: =================== ...
- vim的配置文件
网上一个比较常见的配置文件设置如下,这个配置还是很棒的,尤其创建脚本或者c文件时 " All system-wide defaults are set in $VIMRUNTIME/debi ...
- 阶段总结-Java基础-超进阶
Gitee项目地址:https://gitee.com/zc10010/java_interview_guide/tree/master/知识点话术 项目叫话术,但是我觉得作为知识点学习是挺不错的. ...
- CodeForce-791B Bear and Friendship Condition(并查集)
Bear Limak examines a social network. Its main functionality is that two members can become friends ...