、Redis 安装

Redis 安装

Redis 下载链接

bash 复制代码
[root@iZhp3i77hpofuqqxvoc790Z ~]# mkdir redis
[root@iZhp3i77hpofuqqxvoc790Z ~]# ll
总用量 4
drwxr-xr-x 2 root root 4096 10月  8 15:23 redis
[root@iZhp3i77hpofuqqxvoc790Z ~]# cd redis/
# 将 redis 安装包上传至当前目录下
# 解压当前文件夹 
[root@iZhp3i77hpofuqqxvoc790Z redis]# tar xzvf redis-5.0.4.tar.gz 
redis-5.0.4/
redis-5.0.4/.gitignore
redis-5.0.4/00-RELEASENOTES
redis-5.0.4/BUGS
# ....... 中间就省略了
redis-5.0.4/utils/releasetools/02_upload_tarball.sh
redis-5.0.4/utils/releasetools/03_test_release.sh
redis-5.0.4/utils/releasetools/04_release_hash.sh
redis-5.0.4/utils/releasetools/changelog.tcl
redis-5.0.4/utils/speed-regression.tcl
redis-5.0.4/utils/whatisdoing.sh
[root@iZhp3i77hpofuqqxvoc790Z redis]# ll
总用量 1928
drwxrwxr-x 6 root root    4096 3月  19 2019 redis-5.0.4
-rw-r--r-- 1 root root 1966337 10月  8 15:23 redis-5.0.4.tar.gz

# 由于redis 是c语言开发的,因此需要安装gcc编译器来编译代码
# 安装 最新版本的 gcc 最新版本
[root@iZhp3i77hpofuqqxvoc790Z redis]# yum install gcc-c++
已加载插件:fastestmirror
Determining fastest mirrors
# .....中间省略了     
extras                                                                                                                             | 2.9 kB  00:00:00     
updates                                                                                                                            | 2.9 kB  00:00:00     
软件包 gcc-c++-4.8.5-44.el7.x86_64 已安装并且是最新版本
无须任何处理
[root@iZhp3i77hpofuqqxvoc790Z local]# mv /root/redis /usr/local/
[root@iZhp3i77hpofuqqxvoc790Z local]# ll
总用量 48
drwxr-xr-x  8 root root 4096 9月  12 13:58 aegis
drwxr-xr-x. 2 root root 4096 6月  28 12:35 bin
drwxr-xr-x. 2 root root 4096 4月  11 2018 etc
drwxr-xr-x. 2 root root 4096 4月  11 2018 games
drwxr-xr-x. 2 root root 4096 4月  11 2018 include
drwxr-xr-x. 3 root root 4096 6月  28 12:35 lib
drwxr-xr-x. 3 root root 4096 6月  28 12:35 lib64
drwxr-xr-x. 2 root root 4096 4月  11 2018 libexec
drwxr-xr-x  3 root root 4096 10月  8 15:24 redis
drwxr-xr-x. 2 root root 4096 4月  11 2018 sbin
drwxr-xr-x. 7 root root 4096 9月  20 14:43 share
drwxr-xr-x. 2 root root 4096 4月  11 2018 src
[root@iZhp3i77hpofuqqxvoc790Z local]# cd redis/
[root@iZhp3i77hpofuqqxvoc790Z redis]# ll
总用量 1928
drwxrwxr-x 6 root root    4096 3月  19 2019 redis-5.0.4
-rw-r--r-- 1 root root 1966337 10月  8 15:23 redis-5.0.4.tar.gz
[root@iZhp3i77hpofuqqxvoc790Z redis]# cd redis-5.0.4/
[root@iZhp3i77hpofuqqxvoc790Z redis-5.0.4]# ll
总用量 256
-rw-rw-r--  1 root root 99445 3月  19 2019 00-RELEASENOTES
-rw-rw-r--  1 root root    53 3月  19 2019 BUGS
-rw-rw-r--  1 root root  1894 3月  19 2019 CONTRIBUTING
-rw-rw-r--  1 root root  1487 3月  19 2019 COPYING
drwxrwxr-x  6 root root  4096 3月  19 2019 deps
-rw-rw-r--  1 root root    11 3月  19 2019 INSTALL
-rw-rw-r--  1 root root   151 3月  19 2019 Makefile
-rw-rw-r--  1 root root  4223 3月  19 2019 MANIFESTO
-rw-rw-r--  1 root root 20555 3月  19 2019 README.md
-rw-rw-r--  1 root root 62155 3月  19 2019 redis.conf
-rwxrwxr-x  1 root root   275 3月  19 2019 runtest
-rwxrwxr-x  1 root root   280 3月  19 2019 runtest-cluster
-rwxrwxr-x  1 root root   281 3月  19 2019 runtest-sentinel
-rw-rw-r--  1 root root  9710 3月  19 2019 sentinel.conf
drwxrwxr-x  3 root root  4096 3月  19 2019 src
drwxrwxr-x 10 root root  4096 3月  19 2019 tests
drwxrwxr-x  8 root root  4096 3月  19 2019 utils
[root@iZhp3i77hpofuqqxvoc790Z redis-5.0.4]# make
cd src && make all
make[1]: 进入目录"/usr/local/redis/redis-5.0.4/src"
    CC Makefile.dep
make[1]: 离开目录"/usr/local/redis/redis-5.0.4/src"
make[1]: 进入目录"/usr/local/redis/redis-5.0.4/src"
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-rdb redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html Makefile.dep dict-benchmark
# ..... 中间省略了
    LINK redis-benchmark
    INSTALL redis-check-rdb
    INSTALL redis-check-aof

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

make[1]: 离开目录"/usr/local/redis/redis-5.0.4/src"
[root@iZhp3i77hpofuqqxvoc790Z redis-5.0.4]# cd /usr/local/redis/redis-5.0.4
[root@iZhp3i77hpofuqqxvoc790Z redis-5.0.4]# vi redis.conf



bash 复制代码
# 将配置文件 放置启动目录下
[root@iZhp3i77hpofuqqxvoc790Z redis-5.0.4]# cp redis.conf /usr/local/bin/
# 启动 redis
[root@iZhp3i77hpofuqqxvoc790Z bin]# ./redis-server redis.conf
22240:C 08 Oct 2024 15:53:03.834 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
22240:C 08 Oct 2024 15:53:03.834 # Redis version=5.0.4, bits=64, commit=00000000, modified=0, pid=22240, just started
22240:C 08 Oct 2024 15:53:03.834 # Configuration loaded
# 查看进程
[root@iZhp3i77hpofuqqxvoc790Z ~]# ps -ef |grep redis
root     22241     1  0 15:53 ?        00:00:01 ./redis-server 0.0.0.0:6379
root     31390 30672  0 16:15 pts/0    00:00:00 grep --color=auto redis
相关推荐
CodeJourney.2 小时前
EndNote与Word关联:科研写作的高效助力
数据库·人工智能·算法·架构
trigger3332 小时前
MongoDB 简介
数据库·mongodb
许心月2 小时前
MongoDB#常用语句
数据库·mongodb
Jason95102 小时前
使用大语言模型(Deepseek)构建一个基于 SQL 数据的问答系统
数据库·sql·问答系统·大语言模型·deepseek
苍老流年2 小时前
Redis底层数据结构
数据结构·数据库·redis
三天不学习3 小时前
Redis面试宝典【刷题系列】
数据库·redis·面试
HaoHao_0103 小时前
如何将MySQL数据库迁移至阿里云
服务器·数据库·阿里云·云计算·云服务器·迁移
Мартин.3 小时前
[Meachines] [Easy] Wifinetic FTP匿名登录+Reaver WPS PIN密码泄露权限提升
数据库·postgresql·wps
茂桑3 小时前
MVCC(多版本并发控制)
java·开发语言·数据库
卷心菜不卷Iris3 小时前
第1章大型互联网公司的基础架构——1.9 LSM Tree
数据库·lsm-tree·互联网大厂·基础架构