网站开发专业培训,企业建站 炫酷模板,数据分析师简历,网站不收录原因【README】
本文旨在阐述在linux上安装 redis 的步骤#xff1b; 【1】具体步骤
step1#xff09; 把 redis 压缩包 上传到 /opt/software, 并解压 step2#xff09;打开 redis目录#xff0c;执行 make#xff0c; 若没有gcc编译器#xff0c; 执行命令安装gcc#…【README】
本文旨在阐述在linux上安装 redis 的步骤 【1】具体步骤
step1 把 redis 压缩包 上传到 /opt/software, 并解压 step2打开 redis目录执行 make 若没有gcc编译器 执行命令安装gcc
yum -y install gcc automake autoconf libtool make
step3 在 redis目录执行make 安装 step4在redis目录执行 make install 安装
1、./configure 是用来检测你的安装平台的目标特征的。比如它会检测你是不是有CC或GCC并不是需要CC或GCC它是个shell脚本。
2、make 是用来编译的它从Makefile中读取指令然后编译。
3、make install是用来安装的它也从Makefile中读取指令安装到指定的位置。
注意AUTOMAKE和AUTOCONF是非常有用的用来发布C程序的东西。
step5修改redis配置文件
修改1 把redis.conf 文件拷贝到 /myredis 文件夹下
修改2 修改 daemonize yes
修改3 指定pid文件名字
修改4 指定端口 默认是6379可以保留默认
修改5指定log文件名字
修改6指定 dump.rdb 名字 // redis.conf################################ GENERAL ###################################### 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# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
# default. You can specify a custom pid file location here.
pidfile /var/run/redis6381.pid# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
port 6381# Specify the log file name. Also the empty string can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
logfile 6381.log# The filename where to dump the DB
dbfilename dump6381.rdb
step6开启redis服务 和 redis客户端连接 [rootcentos201 /]# redis-server /myredis/redis6379.conf
[rootcentos201 /]#
[rootcentos201 /]# redis-cli -p 6379
127.0.0.1:6379
127.0.0.1:6379 set k1 v111
OK