linux下redis安装之HelloWorld
来源:互联网 发布:css与js实现的小游戏 编辑:程序博客网 时间:2024/06/07 03:05
1.下载redis
网址:https://redis.io/download,我这里用的是redis-3.2.11.tar.gz
2.将下载的安装文件放到opt目录下
3.使用命令解压tar.gz文件
[root@localhost opt]# tar -xzvf redis-3.2.11.tar.gz
4.cd到redis-3.2.11目录,在当前目录下执行make命令
[root@localhost opt]# cd redis-3.2.11[root@localhost redis-3.2.11]# ls00-RELEASENOTES CONTRIBUTING deps Makefile README.md runtest runtest-sentinel src utilsBUGS COPYING INSTALL MANIFESTO redis.conf runtest-cluster sentinel.conf tests[root@localhost redis-3.2.11]# make
5.上一步完成后,继续执行make install命令
[root@localhost redis-3.2.11]# make install
6.查看默认安装目录
[root@localhost bin]# cd /usr/local/bin[root@localhost bin]# lltotal 38396-rwxr-xr-x. 1 root root 101 Aug 28 18:51 2to3-rwxr-xr-x. 1 root root 10881 Aug 28 19:30 curve_keygen-rwxr-xr-x. 1 root root 99 Aug 28 18:51 idle-rwxr-xr-x. 1 root root 84 Aug 28 18:51 pydoc-rwxr-xr-x. 2 root root 6139490 Aug 28 18:51 python-rwxr-xr-x. 2 root root 6139490 Aug 28 18:51 python2.7-rwxr-xr-x. 1 root root 1624 Aug 28 18:53 python2.7-configlrwxrwxrwx. 1 root root 16 Aug 28 18:53 python-config -> python2.7-config-rwxr-xr-x 1 root root 5580551 Oct 10 07:17 redis-benchmark-rwxr-xr-x 1 root root 22177 Oct 10 07:17 redis-check-aof-rwxr-xr-x 1 root root 7833305 Oct 10 07:17 redis-check-rdb-rwxr-xr-x 1 root root 5709379 Oct 10 07:17 redis-clilrwxrwxrwx 1 root root 12 Oct 10 07:17 redis-sentinel -> redis-server-rwxr-xr-x 1 root root 7833305 Oct 10 07:17 redis-server-rwxr-xr-x. 1 root root 18547 Aug 28 18:51 smtpd.py
7.在根目录创建一个目录,用来存放redis.conf
[root@localhost redis-3.2.11]# cd /[root@localhost /]# mkdir myredis[root@localhost /]# cp /opt/redis-3.2.11/redis.conf /myredis[root@localhost /]# cd /myredis[root@localhost myredis]# lsredis.conf
8.cd到默认安装目录,启动redis
[root@localhost myredis]# cd /usr/local/bin[root@localhost bin]# ls2to3 idle python python2.7-config redis-benchmark redis-check-rdb redis-sentinel smtpd.pycurve_keygen pydoc python2.7 python-config redis-check-aof redis-cli redis-server[root@localhost bin]# redis-server /myredis/redis.conf 6772:M 10 Oct 07:28:43.541 * Increased maximum number of open files to 10032 (it was originally set to 1024). _._ _.-``__ ''-._ _.-`` `. `_. ''-._ Redis 3.2.11 (00000000/0) 64 bit .-`` .-```. ```\/ _.,_ ''-._ ( ' , .-` | `, ) Running in standalone mode |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379 | `-._ `._ / _.-' | PID: 6772 `-._ `-._ `-./ _.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | http://redis.io `-._ `-._`-.__.-'_.-' _.-' |`-._`-._ `-.__.-' _.-'_.-'| | `-._`-._ _.-'_.-' | `-._ `-._`-.__.-'_.-' _.-' `-._ `-.__.-' _.-' `-._ _.-' `-.__.-'
9.至此redis启动成功,开启另一个命令窗口
查看redis进程[root@localhost ~]# ps -ef|grep redisroot 6772 3119 0 07:28 pts/1 00:00:00 redis-server 127.0.0.1:6379 root 6808 6790 0 07:31 pts/2 00:00:00 grep redis开启客户端[root@localhost ~]# cd /usr/local/bin[root@localhost bin]# ls2to3 idle python python2.7-config redis-benchmark redis-check-rdb redis-sentinel smtpd.pycurve_keygen pydoc python2.7 python-config redis-check-aof redis-cli redis-server[root@localhost bin]# redis-cli -p 6379127.0.0.1:6379> pingPONG127.0.0.1:6379> set hello worldOK127.0.0.1:6379> get hello"world"127.0.0.1:6379>
10.退出客户端
127.0.0.1:6379> shutdownnot connected> exit[root@localhost bin]#
阅读全文
0 0
- linux下redis安装之HelloWorld
- Linux(centos7)安装redis及第一个helloWorld
- Redis--Linux下安装Redis
- linux下redis安装
- linux下安装redis
- Linux下安装redis
- Linux 下安装Redis
- linux 下安装redis
- Linux 下安装redis
- linux下安装redis
- Linux下安装redis
- linux下redis安装
- Linux下安装redis
- linux 下安装redis
- linux下redis安装
- linux下redis安装
- linux下redis安装
- Linux下安装Redis
- Android Studio在创建/导入项目的时候,一直处于building “XXX”gradle project info的解决办法
- 工控机与笔记本通讯---ssh 登陆
- JavaBean规范
- 编写代码模拟手机与SIM卡的组合关系。
- [教程]Oracle VM VirtualBox 中添加共享文件夹
- linux下redis安装之HelloWorld
- Linux下的虚拟地址映射详解(一)逻辑地址到线性地址的映射
- HDU 6194 string string string
- 【观察】全面云化时代的探索和创新 神州数码定义中国云MSP之路
- opencv学习中——CvPoint、CvSize、CvRect、CV_RGB、cvRectangle
- 文章标题
- HDU 6003 Problem Buyer(鸽笼原理)
- 数据结构栈的基本的操作(C语言)
- 在web项目中使用mongoDB(一)