Redis学习(一) - 安装

1.安装wget

yum -y install wget

2.获取连接并解压

mkdir /opt/software/redis -p && cd /opt/software/redis
wget https://github.com/redis/redis/archive/7.2.4.tar.gz

3.编译安装

yum -y install lsb-release curl gpg gcc*
make && make install # 使用make install会自动安装到/usr/local/bin

根据redis自带的README.md可以知道
In order to install Redis binaries into /usr/local/bin, just use:
% make install
You can use make PREFIX=/some/other/directory install if you wish to use a
different destination.


以上便可以直接使用redis命令, 因为他的安装目录归属于PATH
当我们在生产环境使用的时候需要继续安装.基于上述步骤进行补充即可

  1. 确保redis make&& make install
  2. 切回到redis的解压目录
  3. 进入utils目录, 执行脚本
cd utils
./install_server.sh

在这里插入图片描述

在执行脚本的时候可能会报错
Welcome to the redis service installer
This script will help you easily set up a running redis server
This systems seems to use systemd.
Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!!

在这里插入图片描述
这个时候我们需要去脚本里面注释一段代码,重新执行即可

#_pid_1_exe="$(readlink -f /proc/1/exe)"
#if [ "${_pid_1_exe##*/}" = systemd ]
#then
#       echo "This systems seems to use systemd."
#       echo "Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!"
#       exit 1
#fi

在这里插入图片描述

4.查看运行状态

 yum -y install bash-completion # 自动补全命令
 systemctl status redis_6379.service

5.测试

redis-cli #进行客户端
redis-cli -h # 命令帮助

登入redis客户端

help #帮助命令

在这里插入图片描述

help @string # help @group, 获取这个组别的所有命令, 这个通常可以用来查看reids对应的数据类型, string, list, hash, set, sorted-set

在这里插入图片描述

help set # 用于查找具体命令的使用,以及作用,组别

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值