首页 技术 正文
技术 2022年11月11日
0 收藏 870 点赞 2,652 浏览 2851 个字

 

1.安装Redis

1.下载、解压Redis

  1. [wch@localhost Redis]$ ll
  2. total 1248
  3. -rwxrwxr-x.1 wch wch 1276198Sep2023:31 redis-2.8.22.tar.gz
  4. [wch@localhost Redis]$ tar -zxvf redis-2.8.22.tar.gz

2.安装Redis

  1. [wch@localhost Redis]$ ll
  2. total 1252
  3. drwxrwxr-x.6 wch wch 4096Sep801:03 redis-2.8.22
  4. -rwxrwxr-x.1 wch wch 1276198Sep2023:31 redis-2.8.22.tar.gz
  5. [wch@localhost Redis]$ cd redis-2.8.22
  6. [wch@localhost redis-2.8.22]$ make PREFIX=/home/wch/InstallSoft/redis install
  7. cd src && make install
  8. make[1]:Entering directory `/home/wch/SoftWare/Redis/redis-2.8.22/src'
  9. Hint: It's a good idea to run 'make test' ;)
  10. INSTALL install
  11. INSTALL install
  12. INSTALL install
  13. INSTALL install
  14. INSTALL install
  15. make[1]: Leaving directory `/home/wch/SoftWare/Redis/redis-2.8.22/src'
  16. [wch@localhost redis-2.8.22]$

默认安装路径:/usr/local/bin,只需要使用命令:make install指定安装路径:make PREFIX=/some/other/directory install,注意PREFIX大小写不能变!

2.启动Redis服务

1.启动服务端进入安装路径,可以看到有一个bin目录,进入bin目录,启动Redis服务

  1. [wch@localhost bin]$ ll
  2. total 15208
  3. -rwxr-xr-x.1 wch wch 4574611Oct104:39 redis-benchmark
  4. -rwxr-xr-x.1 wch wch 22201Oct104:39 redis-check-aof
  5. -rwxr-xr-x.1 wch wch 45411Oct104:39 redis-check-dump
  6. -rwxr-xr-x.1 wch wch 4676357Oct104:39 redis-cli
  7. lrwxrwxrwx.1 wch wch 12Oct104:39 redis-sentinel -> redis-server
  8. -rwxr-xr-x.1 wch wch 6242453Oct104:39 redis-server
  9. [wch@localhost bin]$ ./redis-server
  10. [13745]01Oct04:45:05.889# Warning: no config file specified, using the default config. In order to specify a config file use ./redis-server /path/to/redis.conf
  11. [13745]01Oct04:45:05.890# You requested maxclients of 10000 requiring at least 10032 max file descriptors.
  12. [13745]01Oct04:45:05.890# Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
  13. [13745]01Oct04:45:05.890# Current maximum open files is 1024. maxclients has been reduced to 992 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
  14. _._
  15. _.-``__ ''-._
  16. _.-```. `_.''-._ Redis2.8.22(00000000/0)64 bit
  17. .-``.-```. ```\/ _.,_ ''-._
  18. (' , .-` | `, ) Running in stand alone mode
  19. |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
  20. | `-._ `._ / _.-' | PID: 13745
  21. `-._ `-._ `-./ _.-' _.-'
  22. |`-._`-._ `-.__.-' _.-'_.-'|
  23. | `-._`-._ _.-'_.-' | http://redis.io
  24. `-._ `-._`-.__.-'_.-' _.-'
  25. |`-._`-._ `-.__.-' _.-'_.-'|
  26. |`-._`-._ _.-'_.-'|
  27. `-._ `-._`-.__.-'_.-' _.-'
  28. `-._ `-.__.-' _.-'
  29. `-._ _.-'
  30. `-.__.-'
  31. [13745]01Oct04:45:05.900# Server started, Redis version 2.8.22
  32. [13745]01Oct04:45:05.900# 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.
  33. [13745]01Oct04:45:05.901# WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
  34. [13745]01Oct04:45:05.901*The server is now ready to accept connections on port 6379

2.使用客户端连接Redis服务

  1. [wch@localhost bin]$ ./redis-cli
  2. 127.0.0.1:6379> ping
  3. PONG
  4. 127.0.0.1:6379>set name wch
  5. OK
  6. 127.0.0.1:6379> get name
  7. "wch"
  8. 127.0.0.1:6379>

 ——————————————————————————————————————————-来自为知笔记(Wiz)

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,999
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,511
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,357
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,140
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,770
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,848