广告
返回顶部
首页 > 资讯 > 数据库 >redis-4.0.1安装配置(CentOS 6.6)
  • 706
分享到

redis-4.0.1安装配置(CentOS 6.6)

2024-04-02 19:04:59 706人浏览 安东尼
摘要

一.Redis服务安装配置1.        下载解压redis软件包# wget Http://download.redis.io/r

一.Redis服务安装配置

1.        下载解压redis软件包

# wget Http://download.redis.io/releases/redis-4.0.1.tar.gz

# tar zxvf redis-4.0.1.tar.gz

# cd redis-4.0.1

2.        编译安装redis

# make MALLOC=jemalloc

# make PREFIX=/application/redis-4.0.1 install

# ln -s /application/redis-4.0.1/ /application/redis

# tree /application/redis/bin/

/application/redis/bin/

|-- redis-benchmark   #Redis性能测试工具测试redis在你的系统及你的配置下读写性能

|-- redis-check-aof    #更新日志检查

|-- redis-check-rdb

|-- redis-cli     #Redis命令行操作工具,也可以用telnet根据纯文本协议操作

|-- redis-sentinel -> redis-server

`-- redis-server   #Redis服务器的daemon启动程序

3.        配置环境变量

# echo "export PATH=/application/redis/bin:$PATH" >>/etc/profile

# source /etc/profile

# redis-server --help

# mkdir /application/redis/conf

[root@wangning redis-4.0.1]# cp redis.conf  /application/redis/conf/

4.        启动关闭redis服务

# redis-server /application/redis/conf/redis.conf &          #启动redis服务

[1] 10047

[root@wangning redis-4.0.1]# 10047:C 26 Jul 15:19:17.150 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo

10047:C 26 Jul 15:19:17.150 # Redis version=4.0.1, bits=64, commit=00000000, modified=0, pid=10047, just started

10047:C 26 Jul 15:19:17.150 # Configuration loaded

10047:M 26 Jul 15:19:17.152 * Increased maximum number of open files to 10032 (it was originally set to 1024).

                _._                                                 

           _.-``__ ''-._                                            

      _.-``    `.  `_.  ''-._           Redis 4.0.1 (00000000/0) 64 bit

  .-`` .-```.  ```\/    _.,_ ''-._                                   

 (    '      ,       .-`  | `,    )     Running in standalone mode

 |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379

 |    `-._   `._    /     _.-'    |     PID: 10047

  `-._    `-._  `-./  _.-'    _.-'                                   

 |`-._`-._    `-.__.-'    _.-'_.-'|                                 

 |    `-._`-._        _.-'_.-'    |           http://redis.io       

  `-._    `-._`-.__.-'_.-'    _.-'                                  

 |`-._`-._    `-.__.-'    _.-'_.-'|                                 

 |    `-._`-._        _.-'_.-'    |                                 

  `-._    `-._`-.__.-'_.-'    _.-'                                  

      `-._    `-.__.-'    _.-'                                      

          `-._        _.-'                                          

              `-.__.-'                                              

 

10047:M 26 Jul 15:19:17.162 # WARNING: The tcp backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.

10047:M 26 Jul 15:19:17.162 # Server initialized

10047:M 26 Jul 15:19:17.162 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

10047:M 26 Jul 15:19:17.163 # 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.

10047:M 26 Jul 15:19:17.163 * Ready to accept connections

# ps -ef|grep redis

root      11627   6315  0 15:40 pts/1    00:00:00 redis-server 127.0.0.1:6379

# kill 11627

# echo 1024 >/proc/sys/net/core/somaxconn   #设置的值要大于511

# sysctl vm.overcommit_memory=1      #临时生效

# echo never > /sys/kernel/mm/transparent_hugepage/enabled   #临时生效

# redis-server /application/redis/conf/redis.conf &

# lsof -i:6379

# redis-cli shutdown      #关闭redis服务

 

5.        连接redis服务测试

交互式用法

[root@wangning redis-4.0.1]# redis-cli

127.0.0.1:6379>

127.0.0.1:6379> help get

 

  GET key

  summary: Get the value of a key

  since: 1.0.0

  group: string

 

127.0.0.1:6379> help set

 

  SET key value [EX seconds] [PX milliseconds] [NX|XX]

  summary: Set the string value of a key

  since: 1.0.0

  group: string

 

127.0.0.1:6379> set no002 wangning

OK

127.0.0.1:6379> get no002

"wangning"

127.0.0.1:6379> quit

或者

[root@wangning redis-4.0.1]# telnet 127.0.0.1 6379

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

set no002 wangning

+OK

get no002

$8

wangning

quit

+OK

Connection closed by foreign host.

非交互式用法

# redis-cli -h 127.0.0.1 -p 6379 set no002 wangning

# redis-cli -h 127.0.0.1 -p 6379 get no002

"wangning"

或者

# redis-cli set no002 wangning

# redis-cli get no002 

"wangning"

 

# redis-cli -h 10.0.0.21 -p 6379 info   #统计信息

 

二.为PHP安装redis客户端扩展

# wget https://GitHub.com/nicolasff/phpredis/arcHive/master.zip

# unzip master.zip

# cd phpredis-master/

# /application/php/bin/phpize

# ./configure  --with-php-config=/application/php/bin/php-config

# make

# make install

# echo "extension = redis.so" >>/application/php/lib/php.ini

# killall php-fpm

# /application/php/sbin/php-fpm


您可能感兴趣的文档:

--结束END--

本文标题: redis-4.0.1安装配置(CentOS 6.6)

本文链接: https://www.lsjlt.com/news/37935.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • redis-4.0.1安装配置(CentOS 6.6)
    一.redis服务安装配置1.        下载解压redis软件包# wget http://download.redis.io/r...
    99+
    2022-10-18
  • CentOS 6.6下Redis安装配置记录
    在先前的文章中介绍过redis,以下内容为自己在CentOS上安装Redis的记录。供后期在做改进。 1、安装需要的支持环境 在安装Redis之前首要先做的是安装Unix的Tcl工具,如果不安装的话后期将无...
    99+
    2022-06-04
    CentOS Redis
  • CentOS下如何安装redis-4.0.1
    这篇文章主要为大家展示了“CentOS下如何安装redis-4.0.1”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“CentOS下如何安装redis-4.0.1...
    99+
    2022-10-18
  • CentOS 6.6安装单节点Redis 3.0.3
    1、下载redis-3.0.3并解压缩 # cd /usr/local # wget http://download.redis.io/releases/redis-3.0.3...
    99+
    2022-10-18
  • CentOS 6.6 MySQL 5.5.32 绿色版安装配置
    MySQL 5.5.32 绿色版安装配置 基本信息系统版本:CentOS 6.6MySQL版本:5.5.32 绿色版 初始化MySQL,出现×××部分两个OK,表示初始化正确[root@...
    99+
    2022-10-18
  • CentOS 6.6安装python3.
        CentOS6.6_x64中yum运行需要python2.6环境,安装了python3.4.3后,yum运行会出错。经测试,用下面方法安装python3后修改yum可以使yum仍能正常使用。一、安装python3.4.31、从官站下...
    99+
    2023-01-31
    CentOS
  • Linux(Centos 7) 安装配置 redis
    Linux(Centos 7)  安装配置 redis   1.下载reids ( 官网:redis.io,中文网:www.redis.cn)      我下载的是5.0.8版本的   第二步:安装 解压(到opt目录) ...
    99+
    2018-05-26
    Linux(Centos 7) 安装配置 redis
  • 多节点 安装redis cluster安装部署-4.0.1
    环境节点数量IP:172.17.7.11   CPU :12 核  MEM:96G   启动服务数量:6   使用端口:7001~12IP:172.17.7.25   CPU :12 核  MEM:96G ...
    99+
    2022-10-18
  • CentOS 7安装配置Redis数据库
    Redis就是一种基于key-value的非关系型数据库。这里我将介绍Redis在CentOS 7下如何安装配置。 Redis源码获取进入Redis官网获取Redis最新稳定版下载地址http:/...
    99+
    2022-10-18
  • CentOS 6.6的安装过程由哪些
    这篇文章主要介绍“CentOS 6.6的安装过程由哪些”,在日常操作中,相信很多人在CentOS 6.6的安装过程由哪些问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”CentOS 6.6的安装过程由哪些”的疑...
    99+
    2023-06-10
  • CentOS 6.6如何安装单节点FastDFS
    这篇文章主要为大家展示了“CentOS 6.6如何安装单节点FastDFS”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“CentOS 6.6如何安装单节点FastDFS”这篇文章吧。一、下载下面...
    99+
    2023-06-04
  • CentOS 6.6下如何编译安装MariaDB-10.0.24
    这篇文章主要为大家展示了“CentOS 6.6下如何编译安装MariaDB-10.0.24”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“CentOS 6.6下如...
    99+
    2022-10-19
  • 如何字符化安装centos 6.6系统
    这期内容当中小编将会给大家带来有关如何字符化安装centos 6.6系统,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。界面说明:Install or upgrade an existing system ...
    99+
    2023-06-07
  • centos的安装配置
    当你首次安装完CentOs后,还需要做一些事,才能更好的使用该操作系统。关闭selinuxselinux这个软件功能确实很强大,但是他太复杂了,另外还凌驾于root之上,root都不能突破他的限制。所以,一...
    99+
    2022-10-18
  • CentOs安装redis
    yum install gcc-c++ yum install -y tcl yum install wget 或者 yum install -y gcc g++ gcc-c++ make 2、上传redis源码文件 3、使用ta...
    99+
    2017-04-18
    CentOs安装redis
  • Redis(一)安装配置
    Redis简介   Redis(REmote DIctionary Server)是一个开源的使用ANSI C语言编写、遵守BSD协议、支持网络、可基于内存亦可持久化的日志型、Key-V...
    99+
    2022-10-18
  • Linux安装配置Redis
    一、Redis介绍Redis是由意大利人Salvatore Sanfilippo(网名:antirez)开发的一款内存高速缓存数据库。Redis全称为:Remote Dictionary Server(远程...
    99+
    2022-10-18
  • Redis Cluster--安装配置
    背景本篇主要讲Redis Cluster的安装,让我们先用起来,感受一下到底是怎么回事,后面再继续学习有关如何Cluster如何failover,添加节点,删除节点,迁移slots等功能。Redis Clu...
    99+
    2022-10-18
  • CentOS系统中Redis数据库的安装配置指南
    1、检查安装依赖程序 yum install gcc-c++ yum install -y tcl yum install wget 2、获取安装文件 wget http://download....
    99+
    2022-06-04
    数据库 指南 系统
  • CentOS怎么安装配置maven
    这篇文章主要介绍CentOS怎么安装配置maven,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!一. 下载官方下载地址:maven download二. 解压tar -zxvf apache-maven-3.3.9-...
    99+
    2023-06-10
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作