redis的安装

  1. 安装gcc的编译环境
[root@CentOS ~]# yum install gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.huaweicloud.com
 * updates: mirror.bit.edu.cn
Setting up Install Process
Package gcc-4.4.7-23.el6.x86_64 already installed and latest version
Nothing to do
  1. 上传安装包并解压
[root@CentOS ~]# tar -zxf redis-3.2.9.tar.gz
[root@CentOS ~]# ls
anaconda-ks.cfg  install.log.syslog  redis-3.2.9         word.txt
install.log      opt                 redis-3.2.9.tar.gz  zkdata
  1. 进行编译安装
[root@CentOS redis-3.2.9]# make

redis的安装_第1张图片


[root@CentOS redis-3.2.9]# make install
cd src && make install
make[1]: Entering directory `/root/redis-3.2.9/src'

Hint: It's a good idea to run 'make test' ;)

    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
    INSTALL install
make[1]: Leaving directory `/root/redis-3.2.9/src'

  1. 修改配置文件
[root@CentOS redis-3.2.9]# vi redis.conf
  

# JUST COMMENT THE FOLLOWING LINE.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bind CentOS


# are explicitly listed using the "bind" directive.
protected-mode no



# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
daemonize yes

  1. 启动redis
[root@CentOS redis-3.2.9]# ./src/redis-server redis.conf

  1. 连接redis

[root@CentOS redis-3.2.9]# ./src/redis-cli -h CentOS -p 6379
CentOS:6379>
CentOS:6379> keys *
(empty list or set)
CentOS:6379>

你可能感兴趣的:(redis安装,非关系型数据库)