Centos7上面部署redis

Centos7上面部署redis

编写这个部署redis,只是为了另一个文章入侵redis做准备,网上还有好多类似的文章,这个单纯的就是部署安装,并简单的测试使用以下

关联其他文章
[1]VMware上面安装部署centos7镜像系统【详细含镜像】
[2]血的教训—入侵redis并远程控制你的机器场景复现

redis版本 3.0.4

系统版本IP地址详解
Centos7192.168.144.128部署redis-server端

废话不多,直接开干

部署redis

用的是redis-3.0.4的呦

#下载源码包
[root@localhost ~]# wget https://download.redis.io/releases/redis-3.0.4.tar.gz
--2022-10-26 15:09:31--  https://download.redis.io/releases/redis-3.0.4.tar.gz
正在解析主机 download.redis.io (download.redis.io)... 45.60.125.1
正在连接 download.redis.io (download.redis.io)|45.60.125.1|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1364993 (1.3M) [application/octet-stream]
正在保存至: “redis-3.0.4.tar.gz”100%[====================================================================================================================================================================>] 1,364,993   1.59MB/s 用时 0.8s2022-10-26 15:09:33 (1.59 MB/s) - 已保存 “redis-3.0.4.tar.gz” [1364993/1364993])[root@localhost ~]# ls
anaconda-ks.cfg  mysql-5.6.39.tar.gz  php-5.6.40.tar.gz   zabbix-4.0.3.tar.gz                   zabbix_dd.py        zabbix_wx.py
msyh.ttf         nginx-1.16.1.tar.gz  redis-3.0.4.tar.gz  zabbix_agent-4.0.0-windows-amd64.zip  zabbix_sendmail.py
## 开始解压源码包
[root@localhost ~]# tar  xvf redis-3.0.4.tar.gz
redis-3.0.4/
redis-3.0.4/.gitignore
redis-3.0.4/00-RELEASENOTES
redis-3.0.4/BUGS
redis-3.0.4/CONTRIBUTING
redis-3.0.4/COPYING
**********省略好多*********************************
[root@localhost ~]# ls
anaconda-ks.cfg  mysql-5.6.39.tar.gz  php-5.6.40.tar.gz  redis-3.0.4.tar.gz   zabbix_agent-4.0.0-windows-amd64.zip  zabbix_sendmail.py
msyh.ttf         nginx-1.16.1.tar.gz  redis-3.0.4        zabbix-4.0.3.tar.gz  zabbix_dd.py                          zabbix_wx.py
[root@localhost ~]# cd redis-3.0.4
[root@localhost redis-3.0.4]# ls
00-RELEASENOTES  BUGS  CONTRIBUTING  COPYING  deps  INSTALL  Makefile  MANIFESTO  README  redis.conf  runtest  runtest-cluster  runtest-sentinel  sentinel.conf  src  tests  utils
##开始编译
[root@localhost redis-3.0.4]# make && make install
make[1]: 进入目录“/root/redis-3.0.4/src”
rm -rf redis-server redis-sentinel redis-cli redis-benchmark redis-check-dump redis-check-aof *.o *.gcda *.gcno *.gcov redis.info lcov-html
(cd ../deps && make distclean)
make[2]: 进入目录“/root/redis-3.0.4/deps”
(cd hiredis && make clean) > /dev/null || true
(cd linenoise && make clean) > /dev/null || true
(cd lua && make clean) > /dev/null || true
(cd jemalloc && [ -f Makefile ] && make distclean) > /dev/null || true
(rm -f .make-*)
******************省略好多********************LINK redis-serverINSTALL redis-sentinelCC redis-cli.oLINK redis-cliCC redis-benchmark.oLINK redis-benchmarkCC redis-check-dump.oLINK redis-check-dumpCC redis-check-aof.oLINK redis-check-aofHint: It's a good idea to run 'make test' ;)make[1]: 离开目录“/root/redis-3.0.4/src”
[root@localhost redis-3.0.4]# ls
00-RELEASENOTES  BUGS  CONTRIBUTING  COPYING  deps  INSTALL  Makefile  MANIFESTO  README  redis.conf  runtest  runtest-cluster  runtest-sentinel  sentinel.conf  src  tests  utils
[root@localhost redis-3.0.4]# ls
00-RELEASENOTES  BUGS  CONTRIBUTING  COPYING  deps  INSTALL  Makefile  MANIFESTO  README  redis.conf  runtest  runtest-cluster  runtest-sentinel  sentinel.conf  src  tests  utils
[root@localhost redis-3.0.4]# cd src/
[root@localhost src]# ls
adlist.c     anet.o       cluster.h  debug.c        intset.c   Makefile         object.o  redisassert.h       redis-cli.c     rio.c           sha1.c          syncio.c    t_zset.o      zmalloc.c
adlist.h     aof.c        cluster.o  debug.o        intset.h   Makefile.dep     pqsort.c  redis-benchmark     redis-cli.o     rio.h           sha1.h          syncio.o    util.c        zmalloc.h
adlist.o     aof.o        config.c   dict.c         intset.o   memtest.c        pqsort.h  redis-benchmark.c   redis.h         rio.o           sha1.o          testhelp.h  util.h        zmalloc.o
ae.c         asciilogo.h  config.h   dict.h         latency.c  memtest.o        pqsort.o  redis-benchmark.o   redis.o         scripting.c     slowlog.c       t_hash.c    util.o
ae_epoll.c   bio.c        config.o   dict.o         latency.h  mkreleasehdr.sh  pubsub.c  redis.c             redis-sentinel  scripting.o     slowlog.h       t_hash.o    valgrind.sup
ae_evport.c  bio.h        crc16.c    endianconv.c   latency.o  multi.c          pubsub.o  redis-check-aof     redis-server    sds.c           slowlog.o       t_list.c    version.h
ae.h         bio.o        crc16.o    endianconv.h   lzf_c.c    multi.o          rand.c    redis-check-aof.c   redis-trib.rb   sds.h           solarisfixes.h  t_list.o    ziplist.c
ae_kqueue.c  bitops.c     crc64.c    endianconv.o   lzf_c.o    networking.c     rand.h    redis-check-aof.o   release.c       sds.o           sort.c          t_set.c     ziplist.h
ae.o         bitops.o     crc64.h    fmacros.h      lzf_d.c    networking.o     rand.o    redis-check-dump    release.h       sentinel.c      sort.o          t_set.o     ziplist.o
ae_select.c  blocked.c    crc64.o    help.h         lzf_d.o    notify.c         rdb.c     redis-check-dump.c  release.o       sentinel.o      sparkline.c     t_string.c  zipmap.c
anet.c       blocked.o    db.c       hyperloglog.c  lzf.h      notify.o         rdb.h     redis-check-dump.o  replication.c   setproctitle.c  sparkline.h     t_string.o  zipmap.h
anet.h       cluster.c    db.o       hyperloglog.o  lzfP.h     object.c         rdb.o     redis-cli           replication.o   setproctitle.o  sparkline.o     t_zset.c    zipmap.o##启动redis-server
[root@localhost src]# ./redis-server
4203:C 26 Oct 15:11:20.884 # Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
4203:M 26 Oct 15:11:20.885 * Increased maximum number of open files to 10032 (it was originally set to 1024)._.__.-``__ ''-.__.-``    `.  `_.  ''-._           Redis 3.0.4 (00000000/0) 64 bit.-`` .-```.  ```\/    _.,_ ''-._(    '      ,       .-`  | `,    )     Running in standalone mode|`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379|    `-._   `._    /     _.-'    |     PID: 4203`-._    `-._  `-./  _.-'    _.-'|`-._`-._    `-.__.-'    _.-'_.-'||    `-._`-._        _.-'_.-'    |           http://redis.io`-._    `-._`-.__.-'_.-'    _.-'|`-._`-._    `-.__.-'    _.-'_.-'||    `-._`-._        _.-'_.-'    |`-._    `-._`-.__.-'_.-'    _.-'`-._    `-.__.-'    _.-'`-._        _.-'`-.__.-'4203:M 26 Oct 15:11:20.885 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
4203:M 26 Oct 15:11:20.885 # Server started, Redis version 3.0.4
4203:M 26 Oct 15:11:20.885 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
4203:M 26 Oct 15:11:20.885 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
4203:M 26 Oct 15:11:20.885 * The server is now ready to accept connections on port 6379
^C4203:signal-handler (1666768287) Received SIGINT scheduling shutdown...
4203:M 26 Oct 15:11:27.404 # User requested shutdown...
4203:M 26 Oct 15:11:27.404 * Saving the final RDB snapshot before exiting.
4203:M 26 Oct 15:11:27.405 * DB saved on disk
4203:M 26 Oct 15:11:27.405 # Redis is now ready to exit, bye bye...ctrl + c停止掉redis[root@localhost redis-3.0.4]# vim ../redis.conf       ##添加密码
# 设置需要密码才能访问,123456为示例,请改为强密码
requirepass 123456[root@localhost src]# ./redis-server ../redis.conf      ##带配置文件启动
[root@localhost src]#
[root@localhost src]#
[root@localhost src]#
[root@localhost src]#
[root@localhost src]#
[root@localhost src]# ps -ef | grep redis     ##过滤下redis进程
root       4245   4219  0 15:13 pts/1    00:00:00 ./redis-cli
root       4250      1  0 15:16 ?        00:00:00 ./redis-server *:6379
root       4254   1310  0 15:16 pts/0    00:00:00 grep --color=auto redis
## 到这我们的redis-server就已经布置好了
## 大家可以看下其他的几个文章,来了解下我们要干什么吧,嘻嘻

常见遇见问题

缺少gcc gcc-c++依赖包,报错如下
在这里插入图片描述
直接yum安装就可以解决yum -y install gcc gcc-c++

在这里插入图片描述
如果你的服务器yum不能够直接安装,建议你可以看看yum的离线安装方式
yum不安装只下载rpm包(含centos6,centos7)

注意安装完gcc后,需要删掉之前解压的redis包,并重新解压一下,才能正常编译,否则还是报错如下:
在这里插入图片描述

结束语

这篇文章只是简单的一个部署测试,是为了跟同一专栏里面的其他的文章打基础的
[1]VMware上面安装部署centos7镜像系统【详细含镜像】
[2]血的教训—入侵redis并远程控制你的机器场景复现

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/222048.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

汽车转向桥设计转向节转向桥机械设计

wx供重浩:创享日记 对话框发送:转向桥 获取完整报告说明书工程源文件 转向节图 装配图 本文设计的是JY1061A型采用前置后轮驱动的载货汽车转向桥,因此该转向桥为从动桥。从动桥的功用:从动桥也称非驱动桥,又称从动车轴…

【沐风老师】3DMAX快速地板屋顶墙面铺设插件使用方法详解

3DMAX快速地板屋顶墙面铺设插件使用教程 3DMAX快速地板屋顶墙面铺设插件,一键生成各种地板、墙面纹理模型,是一款非常实用的室内设计和建筑建模插件。 【适用版本】 3dMax7或更新版本 【安装方法】 该插件无需安装,直接在建模过程中使用&a…

基于单片机寻迹巡线避障智能小车系统设计

**单片机设计介绍, 基于单片机寻迹巡线避障智能小车系统设计 文章目录 一 概要二、功能设计设计思路 三、 软件设计原理图 五、 程序六、 文章目录 一 概要 基于单片机的寻迹巡线避障智能小车系统是一种能够自动跟随线路并避开障碍物的智能小车。下面是一个简要的系…

“2024杭州人工智能展览会”加快推进浙江省人工智能产业创新发展

杭州市人民政府加快推进人工智能产业创新发展,贯彻党的二十大精神和新的发展理念,把握人工智能技术演进趋势和创新发展新范式,以促进人工智能与实体经济深度融合为主线,以优质算力普惠供给为基础,到2025年,…

图论——最小割问题

Capacity(S,T) Min-Cut(通俗的说就是用最小的力气隔断) 最小割并不唯一 最大流最小割定理 对于一个网络流问题,最大流的流量最小割的容量 寻找最小割 可以使用Edmonds-karp or Dinic algorithm 首先寻找任意一个最大流&#xff…

Pinctrl子系统和GPIO子系统实验

驱动入口出口函数: static int __init led_init(void) {return 0; } static void __exit led_exit(void) { }module_init(led_init);module_exit(led_exit);MODULE_LICENSE("GPL");字符设备驱动那一套 先创建设备结构体 (cdev) 1…

属性级情感分析

笔记为自我总结整理的学习笔记,若有错误欢迎指出哟~ 属性级情感分析 简介数据集介绍数据加载和预处理(data_utils.py)预训练模型(skep)模型定义模块(model.py)训练配置(config.py&am…

js最新随机字符串,进制数随机字符串,更优秀的随机字符串方式,你绝对没用过的随机字符串方式,可控制位数!

js最新随机字符串,进制数随机字符串,更优秀的随机字符串方式,你绝对没用过的随机字符串方式,可控制位数! 函数封装和传参 首先我们,要封装这样一个函数,首先要确定,传入哪些参数。…

Java抽象类和接口(2)

🐵本篇文章继续对接口相关知识进行讲解 一、排序 1.1 给一个对象数组排序: class Student {public String name;public int age;public Student(String name, int age) {this.name name;this.age age;}public String toString() {return "name:…

2023年10个最受欢迎的性能测试工具

当下软件的性能也是软件成败的一个关键因素。在高负载情况下软件产品出现各种性能问题,比如变慢、宕机都会严重影响客户对产品的信任进而影响客户对公司的信任。比如本次双十一,阿里云全线产品宕机事件,都让阿里集团遭到技术、信誉层面的双重…

基于C#实现十字链表

上一篇我们看了矩阵的顺序存储,这篇我们再看看一种链式存储方法“十字链表”,当然目的都是一样,压缩空间。 一、概念 既然要用链表节点来模拟矩阵中的非零元素,肯定需要如下 5 个元素(row,col,val,down,right),其中&…

C#开发的OpenRA游戏之属性SelectionDecorations(10)

C#开发的OpenRA游戏之属性SelectionDecorations(10) 前面分析了选择属性,继续分析前面的内容,不过这里不再是选择,而是选择相关的属性。 当用玩家选择地图上一个物品,或者士兵,或者坦克时,就会在周边画上一些指示标记,并且有一个状态条。 通过上图,可以看到建筑物周…