Redis Quick Start [熟练版]
一、下载解压
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
二、查看README
Where to find complete Redis documentation?
------------------------------------------- This README is just a fast "quick start" document. You can find more detailed
documentation at http://redis.io Building Redis
-------------- Redis can be compiled and used on Linux, OSX, OpenBSD, NetBSD, FreeBSD.
We support big endian and little endian architectures. It may compile on Solaris derived systems (for instance SmartOS) but our
support for this platform is "best effort" and Redis is not guaranteed to
work as well as in Linux, OSX, and *BSD there. It is as simple as: % make You can run a 32 bit Redis binary using: % make 32bit After building Redis is a good idea to test it, using: % make test Fixing build problems with dependencies or cached build options
—--------
Redis has some dependencies which are included into the "deps" directory.
"make" does not rebuild dependencies automatically, even if something in the
source code of dependencies is changes. When you update the source code with `git pull` or when code inside the
dependencies tree is modified in any other way, make sure to use the following
command in order to really clean everything and rebuild from scratch: make distclean This will clean: jemalloc, lua, hiredis, linenoise. Also if you force certain build options like 32bit target, no C compiler
optimizations (for debugging purposes), and other similar build time options,
those options are cached indefinitely until you issue a "make distclean"
command. Fixing problems building 32 bit binaries
--------- If after building Redis with a 32 bit target you need to rebuild it
with a 64 bit target, or the other way around, you need to perform a
"make distclean" in the root directory of the Redis distribution. In case of build errors when trying to build a 32 bit binary of Redis, try
the following steps: * Install the packages libc6-dev-i386 (also try g++-multilib).
* Try using the following command line instead of "make 32bit": make CFLAGS="-m32 -march=native" LDFLAGS="-m32" Allocator
--------- Selecting a non-default memory allocator when building Redis is done by setting
the `MALLOC` environment variable. Redis is compiled and linked against libc
malloc by default, with the exception of jemalloc being the default on Linux
systems. This default was picked because jemalloc has proven to have fewer
fragmentation problems than libc malloc. To force compiling against libc malloc, use: % make MALLOC=libc To compile against jemalloc on Mac OS X systems, use: % make MALLOC=jemalloc Verbose build
------------- Redis will build with a user friendly colorized output by default.
If you want to see a more verbose output use the following: % make V=1 Running Redis
------------- To run Redis with the default configuration just type: % cd src
% ./redis-server If you want to provide your redis.conf, you have to run it using an additional
parameter (the path of the configuration file): % cd src
% ./redis-server /path/to/redis.conf It is possible to alter the Redis configuration passing parameters directly
as options using the command line. Examples: % ./redis-server --port 9999 --slaveof 127.0.0.1 6379
% ./redis-server /etc/redis/6379.conf --loglevel debug All the options in redis.conf are also supported as options using the command
line, with exactly the same name. Playing with Redis
------------------ You can use redis-cli to play with Redis. Start a redis-server instance,
then in another terminal try the following: % cd src
% ./redis-cli
redis> ping
PONG
redis> set foo bar
OK
redis> get foo
"bar"
redis> incr mycounter
(integer) 1
redis> incr mycounter
(integer) 2
redis> You can find the list of all the available commands here: http://redis.io/commands Installing Redis
----------------- 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. Make install will just install binaries in your system, but will not configure
init scripts and configuration files in the appropriate place. This is not
needed if you want just to play a bit with Redis, but if you are installing
it the proper way for a production system, we have a script doing this
for Ubuntu and Debian systems: % cd utils
% ./install_server.sh The script will ask you a few questions and will setup everything you need
to run Redis properly as a background daemon that will start again on
system reboots. You'll be able to stop and start Redis using the script named
/etc/init.d/redis_<portnumber>, for instance /etc/init.d/redis_6379. Code contributions
--- Note: by contributing code to the Redis project in any form, including sending
a pull request via Github, a code fragment or patch via private email or
public discussion groups, you agree to release your code under the terms
of the BSD license that you can find in the COPYING file included in the Redis
source distribution. Please see the CONTRIBUTING file in this source distribution for more
information. Enjoy!
README
三、安装
make MALLOC=libc
可能需要
yum install gcc
yum install tcl
四、测试
make test
五、启动(src目录下)
./redis-server &
六、进入客户端模式
./redis-cli
七、存取
set mykey 123456
get mykey
八、关闭服务器
./redis-cli
shutdown
Redis Quick Start [熟练版]的更多相关文章
- Redis 3.0正式版发布,正式支持Redis集群
Redis是一个开源.基于C语言.基于内存亦可持久化的高性能NoSQL数据库,同时,它还提供了多种语言的API.近日,Redis 3.0在经过6个RC版本后,其正式版终于发布了.Redis 3.0的最 ...
- 使用.NET简单实现一个Redis的高性能克隆版(二)
译者注 该原文是Ayende Rahien大佬业余自己在使用C# 和 .NET构建一个简单.高性能兼容Redis协议的数据库的经历. 首先这个"Redis"是非常简单的实现,但是他 ...
- 使用.NET简单实现一个Redis的高性能克隆版(三)
译者注 该原文是Ayende Rahien大佬业余自己在使用C# 和 .NET构建一个简单.高性能兼容Redis协议的数据库的经历. 首先这个"Redis"是非常简单的实现,但是他 ...
- 使用.NET简单实现一个Redis的高性能克隆版(四、五)
译者注 该原文是Ayende Rahien大佬业余自己在使用C# 和 .NET构建一个简单.高性能兼容Redis协议的数据库的经历. 首先这个"Redis"是非常简单的实现,但是他 ...
- 使用.NET简单实现一个Redis的高性能克隆版(六)
译者注 该原文是Ayende Rahien大佬业余自己在使用C# 和 .NET构建一个简单.高性能兼容Redis协议的数据库的经历. 首先这个"Redis"是非常简单的实现,但是他 ...
- 使用.NET简单实现一个Redis的高性能克隆版(七-完结)
译者注 该原文是Ayende Rahien大佬业余自己在使用C# 和 .NET构建一个简单.高性能兼容Redis协议的数据库的经历. 首先这个"Redis"是非常简单的实现,但是他 ...
- Redis Quick Start [遇到问题解决问题版]
http://redis.io/topics/quickstart make test 时的问题: 问题:gcc: Command not found 解决:yum install gcc [root ...
- Redis 主从配置(Windows版)
安装从库 1.复制一份 Redis 文件,当做从库. 2.修改从库文件中 redis.windows.conf 的端口号. 3.安装服务,需要重新设置名称.然后去服务中,开启“redis6380”(此 ...
- 使用Spring Data Redis操作Redis(集群版)
说明:请注意Spring Data Redis的版本以及Spring的版本!最新版本的Spring Data Redis已经去除Jedis的依赖包,需要自行引入,这个是个坑点.并且会与一些低版本的Sp ...
随机推荐
- CCFlow工作流程起航
详细可参考SDK请假流程.但请假流程中定义的四个表单只是四个节点表单,首先要依靠访问指向这个请假流程,两种方法进入: 一.是在流程设计中点击运行: 二.先访问 WF\App\Simple\login. ...
- UOJ 348 【WC2018】州区划分——子集卷积
题目:http://uoj.ac/problem/348 参考:https://www.cnblogs.com/NaVi-Awson/p/9242645.html#%E5%AD%90%E9%9B%86 ...
- hive 处理小文件,减少map数
1.hive.merge.mapfiles,True时会合并map输出.2.hive.merge.mapredfiles,True时会合并reduce输出.3.hive.merge.size.per. ...
- Java 权限框架 Shiro 实战一:理论基础
Apache Shiro 官网地址:http://shiro.apache.org/ Apache Shiro is a powerful and easy-to-use Java security ...
- Android中Parcelable与Serializable接口用法
转自: Android中Parcelable接口用法 1. Parcelable接口 Interface for classes whose instances can be written to a ...
- Linq模型ObjectContext下查看Sql语句。
ObjectContext 并没有提供 LINQ to SQL DataContext.Log 这样的功能,要查看实际生成的 T-SQL 语句,要么借助 SQL Server Sql Profiler ...
- 【转】Java中的内部类和匿名类
Java内部类(Inner Class),类似的概念在C++里也有,那就是嵌套类(Nested Class),乍看上去内部类似乎有些多余,它的用处对于初学者来说可能并不是那么显著,但是随着对它的 ...
- cuDNN下载地址和指南
我出现了报错 Could not find 'cudnn64_7.dll'. TensorFlow requires that this DLL be installed in a directory ...
- Bootstrap-Plugin:弹出框(Popover)插件
ylbtech-Bootstrap-Plugin:弹出框(Popover)插件 1.返回顶部 1. Bootstrap 弹出框(Popover)插件 弹出框(Popover)与工具提示(Tooltip ...
- 用Tensorflow搭建网络
层 创建层 创建密集连接层,并应用激活函数 x = tf.placeholder(tf.float32, shape=[None, 3]) linear_model = tf.layers.Dense ...