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的更多相关文章

  1. Redis 5.0.5 Install manual

    Redis 5.0.5 安装文档(Install manual) 一.单实例安装 标题 内容 测试环境 Centos 7 虚拟机 vbox redis版本 redis 5.0.5 1.编译安装redi ...

  2. Linux下Redis4.0.12安装、配置、优化

    一.安装 1.检查gcc环境 执行命令,如果Linux系统没有安装gcc编译器,会提示“Command not found” # gcc -v 安装gcc # yum -y install gcc 以 ...

  3. CentOS7怎样安装Redis4.0.12

    一.安装 yum -y install tcl安装相关依赖 mkdir /usr/local/redis创建redis安装目录 cd /usr/local/redis 进入redis目录 wget h ...

  4. ubuntu 12 install redis

    ubuntu 12 install redis 今天开始写数据server部分,大家初步的方案是用redis+mysql 所以要安装,下面记录安装的基本过程,留做后续参考 unbuntu 12 已经支 ...

  5. Redis 3.0 集群搭建

    Redis 3.0 集群搭建 开启两个虚拟机 分别在两个虚拟机上开启3个Redis实例 3主3从两个虚拟机里的实例互为主备 下面分别在两个虚拟机上安装,网络设置参照codis集群的前两个主机 分别关闭 ...

  6. CentOS7.2 安装redis 3.0.6集群

    1.环境确认 a.系统版本查看 [hadoop@p168 ~]$ cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core)  b.安装依 ...

  7. Linux 安装Redis 5.0

    结构如下: Redis 官方不建议Redis安装在WINDOWS 服务器上(尤其是生产中分布式事物缓存). linux 下Redis 5.0主从复制(一主二从)哨兵模式的搭建:https://www. ...

  8. Redis 5.0.5集群搭建

    Redis 5.0.5集群搭建 一.概述 Redis3.0版本之后支持Cluster. 1.1.redis cluster的现状 目前redis支持的cluster特性: 1):节点自动发现 2):s ...

  9. Linux下安装redis 3.0及C语言中客户端实现demo

    1.获取安装文件 wget http://download.redis.io/redis-stable.tar.gz 2.解压文件 tar xzvf redis-stable.tar.gz 3.进入目 ...

随机推荐

  1. 二、vue组件化开发(轻松入门vue)

    轻松入门vue系列 Vue组件化开发 五.组件化开发 1. 组件注册 组件命名规范 组件注册注意事项 全局组件注册 局部组件注册 2. Vue调试工具下载 3. 组件间数据交互 父组件向子组件传值 p ...

  2. ABC类IP地址

    A类IP地址一个A类IP地址由1字节的网络地址和3字节主机地址组成,网络地址的最高位 必须是"0", 地址范围从1.0.0.0 到126.0.0.0.可用的A类网络有126个,每个 ...

  3. Gradient checking

    所需文件:本地下载 Gradient Checking Welcome to the final assignment for this week! In this assignment you wi ...

  4. React事件处理、收集表单数据、高阶函数

    3.React事件处理.收集表单数据.高阶函数 3.1事件处理 class Demo extends React.Component { /* 1. 通过onXxx属性指定事件处理函数(注意大小写) ...

  5. (四)羽夏看C语言——循环与跳转

    写在前面   由于此系列是本人一个字一个字码出来的,包括示例和实验截图.本人非计算机专业,可能对本教程涉及的事物没有了解的足够深入,如有错误,欢迎批评指正. 如有好的建议,欢迎反馈.码字不易,如果本篇 ...

  6. Salesforce LWC学习(三十六) Quick Action 支持选择 LWC了

    本篇参考: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_quick_act ...

  7. Django——ORM打印SQL

    如果想打印ORM转换过程中的SQL,需要在settings.py中进行如下配置: LOGGING = { 'version': 1, 'disable_existing_loggers': False ...

  8. openswan框架和编译时说明

    刚开始学习openswan项目代码时,自己尝试了在虚拟机上编译.安装.运行openswan代码,由于当时刚开始学习openswan代码,因此对于其构成并不清楚,在编译.运行过程中有了问题,基本是通过百 ...

  9. SpringMVC-初见

    目录 什么是SpringMVC? DispatcherServlet 第一个MVC程序 配置版 Maven可能存在资源过滤的问题 注解版 RestFul和控制器 实现Controller接口 使用注解 ...

  10. PyCharm--帮助文档

    PyCharm官方文档翻译 PyCharm快捷键