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. Inject-APC(Ring0)

    1 #include "stdafx.h" 2 #include <iostream> 3 #include <Windows.h> 4 #include ...

  2. IDEA不自动提示仓库中有的包maven

  3. py2neo学习记录

    py2neo 通用 # -*- coding: UTF-8 -*- from py2neo import Graph, Node, Relationship, walk, NodeMatcher, R ...

  4. nios eclipse提示LED_PIO_BASE没有声明,怎么回事?

    这是因为名字不一致引起的比如,在生成SOPC系统时,双击PIO(Parallel I/O)(在Avalon Modules -> Other 下),为系统添加输出接口,你没有把该组件改名成LED ...

  5. cmd(命令行 )的命令

    cmd是command的缩写.即命令行 CMD命令锦集 1. gpedit.msc-----组策略 2. sndrec32-------录音机 3. Nslookup-------IP地址侦测器 ,是 ...

  6. CountDownLatch能不能在多个线程上添加await?

    在CountDownLatch类的使用过程中,发现了一个很奇怪的现象: CountDownLatch countDownLatch = new CountDownLatch(2); Runnable ...

  7. c# List集合类常用操作:二、增加

    所有操作基于以下类 class Employees { public int Id { get; set; } public string Name { get; set; } public stri ...

  8. CSS002. 字体穿透蒙层(用img设置字体的color)

    之前在逛Apple Store时看到了下面的UI: 交互图标非常圆滑上手也很舒服,虽然背景底色本就是白底,但是只依赖css能不能使  "+" 穿透背景看到底色 ? 大致思路如下: ...

  9. 第23篇-虚拟机对象操作指令之getstatic

    Java虚拟机规范中定义的对象操作相关的字节码指令如下表所示. 0xb2 getstatic 获取指定类的静态域,并将其值压入栈顶 0xb3 putstatic 为指定的类的静态域赋值 0xb4 ge ...

  10. freeswitch 编译安装后的配置

    --------------------FreeSWITCH configuration------------Locations: prefix: /usr/local/freeswitchexec ...