01: NoSQL概述 部署Redis服务 、 部署LNMP+Redis

这篇博客介绍了如何搭建Redis服务器,修改Redis服务运行参数,以及部署LNMP+Redis。内容包括安装Redis,设置Redis服务参数,连接Redis,以及在LNMP环境中安装php-redis模块并进行Redis连接测试。
摘要由CSDN通过智能技术生成

Top

NSD NOSQL DAY01

  1. 案例1:搭建Redis服务器
  2. 案例2:修改Redis服务运行参数
  3. 案例3:部署LNMP+Redis

1 案例1:搭建Redis服务器

1.1 问题

  • 具体要求如下:
  • 在主机 192.168.4.51 上安装并启用 redis 服务
  • 设置变量test,值为123
  • 查看变量test的值

1.2 步骤

实现此案例需要按照如下步骤进行。

步骤一:搭建redis服务器

1)安装redis服务器

 
  1. [root@redis1 ~]# cd redis
  2. [root@redis1 redis]# ls
  3. lnmp redis-4.0.8.tar.gz
  4. [root@redis1 redis]# yum -y install gcc gcc-c++ make
  5. [root@redis1 redis]# tar -zxf redis-4.0.8.tar.gz
  6. [root@redis1 redis]# cd redis-4.0.8/
  7. [root@redis1 redis-4.0.8]# ls
  8. 00-RELEASENOTES CONTRIBUTING deps Makefile README.md runtest runtest-sentinel src utils
  9. BUGS COPYING INSTALL MANIFESTO redis.conf runtest-cluster sentinel.conf tests
  10. [root@redis1 redis-4.0.8]# make
  11. [root@redis1 redis-4.0.8]# make install
  12. [root@redis1 redis-4.0.8]# cd utils/
  13. [root@redis1 utils]# ./install_server.sh
  14. Welcome to the redis service installer
  15. This script will help you easily set up a running redis server
  16.  
  17. Please select the redis port for this instance: [6379]
  18. Selecting default: 6379
  19. Please select the redis config file name [/etc/redis/6379.conf]
  20. Selected default - /etc/redis/6379.conf
  21. Please select the redis log file name [/var/log/redis_6379.log]
  22. Selected default - /var/log/redis_6379.log
  23. Please select the data directory for this instance [/var/lib/redis/6379]
  24. Selected default - /var/lib/redis/6379
  25. Please select the redis executable path [/usr/local/bin/redis-server]
  26. Selected config:
  27. Port : 6379                  //端口号
  28. Config file : /etc/redis/6379.conf //配置文件目录
  29. Log file : /var/log/redis_6379.log //日志目录
  30. Data dir : /var/lib/redis/6379 //数据库目录
  31. Executable : /usr/local/bin/redis-server //启动程序的目录
  32. Cli Executable : /usr/local/bin/redis-cli //命令行的连接工具
  33. Is this ok? Then press ENTER to go on or Ctrl-C to abort. //回车完成配置
  34. Copied /tmp/6379.conf => /etc/init.d/redis_6379 //服务启动脚本
  35. Installing service...
  36. Succe
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值