NSD NOSQL DAY01
1 案例1:搭建Redis服务器
1.1 问题
- 具体要求如下:
- 在主机 192.168.4.51 上安装并启用 redis 服务
- 设置变量test,值为123
- 查看变量test的值
1.2 步骤
实现此案例需要按照如下步骤进行。
步骤一:搭建redis服务器
1)安装redis服务器
- [root@redis1 ~]# cd redis
- [root@redis1 redis]# ls
- lnmp redis-4.0.8.tar.gz
- [root@redis1 redis]# yum -y install gcc gcc-c++ make
- [root@redis1 redis]# tar -zxf redis-4.0.8.tar.gz
- [root@redis1 redis]# cd redis-4.0.8/
- [root@redis1 redis-4.0.8]# ls
- 00-RELEASENOTES CONTRIBUTING deps Makefile README.md runtest runtest-sentinel src utils
- BUGS COPYING INSTALL MANIFESTO redis.conf runtest-cluster sentinel.conf tests
- [root@redis1 redis-4.0.8]# make
- [root@redis1 redis-4.0.8]# make install
- [root@redis1 redis-4.0.8]# cd utils/
- [root@redis1 utils]# ./install_server.sh
- Welcome to the redis service installer
- This script will help you easily set up a running redis server
- Please select the redis port for this instance: [6379]
- Selecting default: 6379
- Please select the redis config file name [/etc/redis/6379.conf]
- Selected default - /etc/redis/6379.conf
- Please select the redis log file name [/var/log/redis_6379.log]
- Selected default - /var/log/redis_6379.log
- Please select the data directory for this instance [/var/lib/redis/6379]
- Selected default - /var/lib/redis/6379
- Please select the redis executable path [/usr/local/bin/redis-server]
- Selected config:
- Port : 6379 //端口号
- Config file : /etc/redis/6379.conf //配置文件目录
- Log file : /var/log/redis_6379.log //日志目录
- Data dir : /var/lib/redis/6379 //数据库目录
- Executable : /usr/local/bin/redis-server //启动程序的目录
- Cli Executable : /usr/local/bin/redis-cli //命令行的连接工具
- Is this ok? Then press ENTER to go on or Ctrl-C to abort. //回车完成配置
- Copied /tmp/6379.conf => /etc/init.d/redis_6379 //服务启动脚本
- Installing service...
- Succe