NoSQL-Redis服务部署

当下nosql软件类型

NoSQL-Redis服务部署_第1张图片
其中前三位是用的最多的,memcached与mongodb平分秋色,redis独占鳌头


测试环境:mysql51、mysql50
安装gcc源码编译工具make没有的话也要按照(系统自带就不用)

[root@mysql51 redis]# rpm -q gcc || yum -y install ('||'此符号作用:前条命执行是否成功决定是否执行后面的命令)
......巴拉巴拉一大堆安装完毕
[root@mysql51 redis]# ls
lnmp  redis-3.2.1.gem  redis-4.0.8.tar.gz  ruby-devel-2.0.0.648-30.el7.x86_64.rpm
[root@mysql51 redis]# tar xf redis-4.0.8.tar.gz  (此包提前下载好)
[root@mysql51 redis]# cd redis-4.0.8/
[root@mysql51 redis-4.0.8]# make&&make install #进行源码编译并安装
.....又是巴拉巴拉一大堆安装完毕
[root@mysql51 redis-4.0.8]# /etc/init.d/net #配置网口
netconsole  network 
#执行自带的shell-script,它会帮你自动配置并启动服务
[root@mysql51 redis-4.0.8]# ./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                   #redis数据存放目录
Executable     : /usr/local/bin/redis-server           #服务启动程序
Cli Executable : /usr/local/bin/redis-cli              #命令行链接命令(进入redis库命令)
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...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!
[root@mysql51 redis-4.0.8]#
#redis跟memcahced等一些NOsql用法大致一样
[root@mysql51 ~]# redis-cli  #链接命令
127.0.0.1:6379> ping #检测是否链接成功
PONG  #出现此信息为成功
127.0.0.1:6379> set name ak #存入数据
OK
127.0.0.1:6379> keys * #查看所有key
1) "name"
127.0.0.1:6379> quit
[root@mysql51 ~]# /etc/init.d/redis_6379 stop #启服务
Stopping ...
Redis stopped
[root@mysql51 ~]# /etc/init.d/redis_6379 start #停服务
Starting Redis server...

简单的redis雏形部署完毕

你可能感兴趣的:(NoSQL)