【Redis】Redis的基本安装及使用
在Linux上安装Redis
Redis的安装很简单。基本上是下载、解压、运行安装脚本。我用的Redis版本是3.2.1。
[nicchagil@localhost app]$ wget -q http://download.redis.io/releases/redis-3.2.1.tar.gz
[nicchagil@localhost app]$
[nicchagil@localhost app]$ ll redis-3.2.1.tar.gz
-rw-r--r--. 1 nicchagil nicchagilg 1534696 Jun 20 08:13 redis-3.2.1.tar.gz
[nicchagil@localhost app]$
[nicchagil@localhost app]$ tar -xzf redis-3.2.1.tar.gz
[nicchagil@localhost app]$
[nicchagil@localhost app]$ cd ./redis-3.2.1
[nicchagil@localhost redis-3.2.1]$
[nicchagil@localhost redis-3.2.1]$ make
启动服务器
运行src目录下的redis-server即可启动Redis。
[nicchagil@localhost redis-3.2.1]$ src/redis-server
11713:C 06 Aug 03:13:09.795 # Warning: no config file specified, using the default config. In order to specify a config file use src/redis-server /path/to/redis.conf
11713:M 06 Aug 03:13:09.803 * Increased maximum number of open files to 10032 (it was originally set to 1024).
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 3.2.1 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 11713
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | http://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
11713:M 06 Aug 03:13:09.842 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
11713:M 06 Aug 03:13:09.842 # Server started, Redis version 3.2.1
11713:M 06 Aug 03:13:09.845 # 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.
11713:M 06 Aug 03:13:09.851 # 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.
11713:M 06 Aug 03:13:09.852 * The server is now ready to accept connections on port 6379
从日志上大概上看出Redis已启动,并监听6379端口。
指定配置文件启动
我们也可以指定配置文件启动,比如使用安装后自带的配置:
[nicchagil@localhost redis-3.2.1]$ src/redis-server redis.conf
其配置默认如下,并在后面简述其作用:
[root@blog ~]# grep -v "^#" /third_package/redis-3.2.1/redis.conf | grep -v "^$"
bind 127.0.0.1 # 允许客户端连接的IP,任何IP都能连接配置0.0.0.0
protected-mode yes # 保护模式
port 6379 # 监听端口
tcp-backlog 511 # TCP监听的最大容纳数量,高并发下,Linux有可能调整此值为/proc/sys/net/core/somaxconn一致,请调整此二者的值
timeout 0 # 客户端空闲多久才关闭连接,设置0则不断开
tcp-keepalive 300 # TCP心跳,默认建议设为300
daemonize no # 是否以守护进程运行
supervised no
pidfile /var/run/redis_6379.pid # 以守护进程运行时,此文件记录进程ID
loglevel notice # 日志级别,debug/verbose/notice/warning,生产环境推荐用notice
logfile "" # 日志文件,空字符串表示标准输出,请注意,当以守护进程模式运行标准输出至/dev/null
databases 16 # 数据库数量
save 900 1 # 如果900秒内有1个key变化,则保存快照
save 300 10 # 如果300秒内有10个key变化,则保存快照
save 60 10000 # 如果60秒内有10000个key变化,则保存快照
stop-writes-on-bgsave-error yes # 如果后台保存快照出现错误,是否停止接收写操作
rdbcompression yes # 保存快照是否压缩,压缩则写入操作效率低点但数据文件小点嘛,反之写入操作块但文件大嘛
rdbchecksum yes # 是否校验快照
dbfilename dump.rdb # 快照文件
dir ./ # 快照文件和追加文件所在
slave-serve-stale-data yes # 当slave和master失联或正在复制时,slave的数据可能过时,是否返回数据
slave-read-only yes # slave是否只读
repl-diskless-sync no #
repl-diskless-sync-delay 5
repl-disable-tcp-nodelay no
slave-priority 100 # 当master不能正常工作时,哨兵从slave中选出新的master,优先级越小越优先
appendonly no # 是否开启追加持久化
appendfilename "appendonly.aof" # 追加文件
appendfsync everysec # 追加同步频率
no-appendfsync-on-rewrite no # 追加同步时是否压缩
auto-aof-rewrite-percentage 100 # 多久进行一次压缩
auto-aof-rewrite-min-size 64mb #
aof-load-truncated yes
lua-time-limit 5000
slowlog-log-slower-than 10000
slowlog-max-len 128
latency-monitor-threshold 0
notify-keyspace-events ""
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-size -2
list-compress-depth 0
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
hll-sparse-max-bytes 3000
activerehashing yes
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10
aof-rewrite-incremental-fsync yes
默认的redis.conf有几个默认的配置设置只允许本地客户端访问(如果你从其他机器访问,记得修改下哦):
- 只允许本机客户端连接
- 使用保护模式
bind 127.0.0.1
......
protected-mode yes
如果你想从其他机器访问,可改成具体IPbind xx.xx.xx.xx
,如任何IP都可访问,则bind 0.0.0.0
。
使用本地客户端连接Redis
切换另外一个会话,运行src目录下的redis-cli即可使用本地客户端连接Redis,并测试一下基本的get命令。
[nicchagil@localhost redis-3.2.1]$ src/redis-cli
127.0.0.1:6379> get some-key
(nil)
127.0.0.1:6379>
使用非本地客户端连接Redis
在此使用Java的Jeids。
为什么?只是因为公司用这个,我需要熟悉,哈哈。
引入相关包:
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.8.2</version>
</dependency>
最简单的连接程序:
package com.nicchagil.study.jedis;
import redis.clients.jedis.Jedis;
public class HowToTest {
public static void main(String[] args) {
Jedis jedis = null;
try {
jedis = new Jedis("192.168.1.9", 6379);
jedis.set("myname", "Nick Huang");
String rs = jedis.get("myname");
System.out.println(rs);
} finally {
if (jedis != null) {
jedis.close();
}
}
}
}
关于“非本地客户端连接Redis”常见问题
Redis运行在保护模式,这是默认的启动方式,提示里已经教我们如何处理了。
DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
我们可以把保护模式关掉:
[root@localhost ~]# /usr/local/redis-3.2.8/src/redis-cli
127.0.0.1:6379>
127.0.0.1:6379>
127.0.0.1:6379> config set protected-mode "no"
如果不能连接,记得检查下是否Linux的防火墙拦截了。测试阶段,最简单的方式就是把防火墙关闭。
[root@localhost ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
Jedis连接池的简单配置
Jedis自带有连接池,是在GenericObjectPoolConfig的基础上实现的。
具体的配置可以参考这篇博文:Jedis2.4.2链接池配置注释
简单的使用JedisPool:
package com.nicchagil.study.jedis;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
public class JedisPoolUtils {
public static JedisPoolConfig c = new JedisPoolConfig(); // 连接池配置
public static JedisPool jedisPool = null; // 连接池
static {
c.setBlockWhenExhausted(true); // 连接耗尽则阻塞
c.setLifo(true); // 后进先出
c.setMaxIdle(10); // 最大空闲连接数为10
c.setMinIdle(0); // 最小空闲连接数为0
c.setMaxTotal(20); // 最大连接数为20
c.setMaxWaitMillis(-1); // 设置最大等待毫秒数:无限制
c.setMinEvictableIdleTimeMillis(1800000); // 逐出连接的最小空闲时间:30分钟
c.setTestOnBorrow(true); // 获取连接时是否检查连接的有效性:是
c.setTestWhileIdle(true); // 空闲时是否检查连接的有效性:是
jedisPool = new JedisPool(c, "192.168.1.9", 6379); // 初始化连接池
}
/**
* 获取Jedis连接
* @return Jedis连接
*/
public static Jedis getJedis() {
return jedisPool.getResource();
}
public static void main(String[] args) {
/* 操作Redis */
Jedis jedis = null;
try {
jedis = JedisPoolUtils.getJedis();
jedis.set("myname", "Nick Huang");
String rs = jedis.get("myname");
System.out.println(rs);
} finally {
if (jedis != null) {
jedis.close();
}
}
}
}
用spring-data-redis集成jedis连接redis
引入相关包:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.7.10.RELEASE</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.8.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
配置连接池、连接工厂、操作模板:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jms="http://www.springframework.org/schema/jms" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms.xsd">
<!-- Spring扫描组件的路径 -->
<context:component-scan base-package="com.nicchagil" />
<!-- 连接池 -->
<bean id="poolConfig" class="redis.clients.jedis.JedisPoolConfig">
<property name="maxTotal" value="20"></property>
<property name="maxIdle" value="10"></property>
<property name="minIdle" value="0"></property>
<property name="maxWaitMillis" value="-1"></property>
<property name="minEvictableIdleTimeMillis" value="1800000"></property>
<property name="numTestsPerEvictionRun" value="3"></property>
<property name="timeBetweenEvictionRunsMillis" value="60000"></property>
<property name="testOnBorrow" value="true"></property>
<property name="testOnReturn" value="true"></property>
<property name="testWhileIdle" value="true"></property>
</bean>
<!-- 连接工厂 -->
<bean id="connectionFactory"
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
p:host-name="192.168.1.101" p:port="6379" p:password=""
p:pool-config-ref="poolConfig" />
<!-- String模板 -->
<bean id="stringRedisTemplate" class="org.springframework.data.redis.core.StringRedisTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<!-- 默认序列器是如下配置,看StringRedisTemplate源码可知 -->
<!--
<property name="KeySerializer" ref="stringRedisSerializer" />
<property name="ValueSerializer" ref="stringRedisSerializer" />
-->
</bean>
<!-- 通用模板 -->
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<!-- 默认序列器是如下配置,看RedisTemplate源码可知 -->
<!--
<property name="KeySerializer" ref="jdkSerializationRedisSerializer" />
<property name="ValueSerializer" ref="jdkSerializationRedisSerializer" />
-->
</bean>
<!-- 各种序列器 -->
<bean id="stringRedisSerializer" class="org.springframework.data.redis.serializer.StringRedisSerializer" />
<bean id="jdkSerializationRedisSerializer" class="org.springframework.data.redis.serializer.JdkSerializationRedisSerializer" />
</beans>
实体类:
package com.nicchagil.entity;
import java.io.Serializable;
public class User implements Serializable {
private static final long serialVersionUID = -5490973977018492996L;
private Integer id;
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "User [id=" + id + ", name=" + name + "]";
}
public User() {
super();
}
}
操作String的Dao:
package com.nicchagil.redis.dao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class StringDao {
@Autowired
private StringRedisTemplate stringRedisTemplate;
public void put(final String key, final String value) {
this.stringRedisTemplate.opsForValue().set(key, value);
}
public String get(final String key) {
return this.stringRedisTemplate.opsForValue().get(key);
}
public Long increment(final String key, final Long l) {
return this.stringRedisTemplate.opsForValue().increment(key, l);
}
}
操作String的测试类:
package com.nicchagil;
import java.io.IOException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.nicchagil.redis.dao.StringDao;
public class HowToUseStringDao {
public static void main(String[] args) throws IOException {
try (ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring-redis.xml"})) {
StringDao stringDao = context.getBean("stringRedisService", StringDao.class);
stringDao.put("chinese", "中文");
}
}
}
操作User的Dao:
package com.nicchagil.redis.dao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Repository;
import com.nicchagil.entity.User;
@Repository
public class UserRedisDao {
@Autowired
private RedisTemplate<Object, User> redisTemplate;
public void put(final Object key, final User value) {
this.redisTemplate.opsForValue().set(key, value);
}
public User get(final Object key) {
return this.redisTemplate.opsForValue().get(key);
}
}
操作User的测试类:
package com.nicchagil;
import java.io.IOException;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.nicchagil.entity.User;
import com.nicchagil.redis.dao.UserRedisDao;
public class HowToUseUserDao {
public static void main(String[] args) throws IOException {
}
@Test
public void put() {
try (ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring-redis.xml"})) {
UserRedisDao userRedisDao = context.getBean("userRedisDao", UserRedisDao.class);
User user = new User();
user.setId(5);
user.setName("Nick Huang");
userRedisDao.put("user_" + user.getId(), user);
}
}
@Test
public void get() {
try (ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring-redis.xml"})) {
UserRedisDao userRedisDao = context.getBean("userRedisDao", UserRedisDao.class);
User user = userRedisDao.get("user_5");
System.out.println(user);
}
}
}
RedisTemplate的调用逻辑
下图为RedisTemplate
中opsForValue().set(key, value)
的调用逻辑:
序列器的接口与实现:
配置简单的主从模式
准备好3个redis,现在我需要配置/opt/redis/redis-3.2.1-A
为master
,/opt/redis/redis-3.2.1-B
、/opt/redis/redis-3.2.1-C
为slave
。
修改如下配置文件分别监听6379
、16379
、26379
,然后两个slave
都配置slaveof xx.xx.xx.xx 6379
,其中 xx.xx.xx.xx
为master
的IP(声明:我测试的环境为3个redis均在本机,即伪集群,真集群我还没有测试)
vi /opt/redis/redis-3.2.1-A/redis.conf
vi /opt/redis/redis-3.2.1-B/redis.conf
vi /opt/redis/redis-3.2.1-C/redis.conf
然后启动:
/opt/redis/redis-3.2.1-A/src/redis-server /opt/redis/redis-3.2.1-A/redis.conf &
/opt/redis/redis-3.2.1-B/src/redis-server /opt/redis/redis-3.2.1-B/redis.conf &
/opt/redis/redis-3.2.1-C/src/redis-server /opt/redis/redis-3.2.1-C/redis.conf &
然后客户连接测试,可以尝试用info
查看各redis的信息,以及在master
操作/读取数据、在slave
读取数据。:
/opt/redis/redis-3.2.1-A/src/redis-cli -p 6379
/opt/redis/redis-3.2.1-B/src/redis-cli -p 16379
/opt/redis/redis-3.2.1-C/src/redis-cli -p 26379
配置简单的哨兵模式
默认的sentinel.conf
是这样的,另外自己加了简述:
[root@blog redis-3.2.1-A]# grep -v "^#" /opt/redis/redis-3.2.1-A/sentinel.conf | grep -v "^$"
port 26379 # 监听端口
dir /tmp
sentinel monitor mymaster 127.0.0.1 6379 2 # 监视127.0.0.1:6379,判断此服务器为失效至少需要2个哨兵同意
sentinel down-after-milliseconds mymaster 30000 # 哨兵认为此服务器断线的时间
sentinel parallel-syncs mymaster 1 # 故障转移时,最多可以有多少slave从新master同步
sentinel failover-timeout mymaster 180000 # 故障转移超时时间
我配置了3个哨兵,只修改哨兵的端口和监视的master
的IP、端口。(本人在阿里云上测试,启动时报端口已被使用,我加配了bind xx.xx.xx.xx
,具体资料见[环境配置]阿里云ecs不支持redis-sentinel么?、[基础常识]在CentOS 6 运行 redis-sentinel 程序)
然后就启动了:
vi /opt/redis/redis-3.2.1-A/sentinel.conf
vi /opt/redis/redis-3.2.1-B/sentinel.conf
vi /opt/redis/redis-3.2.1-C/sentinel.conf
/opt/redis/redis-3.2.1-A/src/redis-sentinel /opt/redis/redis-3.2.1-A/sentinel.conf &
/opt/redis/redis-3.2.1-B/src/redis-sentinel /opt/redis/redis-3.2.1-B/sentinel.conf &
/opt/redis/redis-3.2.1-C/src/redis-sentinel /opt/redis/redis-3.2.1-C/sentinel.conf &
进程如下:
[root@blog ~]# ps -ef | grep redis
root 14788 13445 0 10:40 pts/1 00:00:00 /opt/redis/redis-3.2.1-A/src/redis-server xx.xx.xx.xx:6379
root 14793 13445 0 10:40 pts/1 00:00:00 /opt/redis/redis-3.2.1-B/src/redis-server xx.xx.xx.xx:16379
root 14799 13445 0 10:40 pts/1 00:00:00 /opt/redis/redis-3.2.1-C/src/redis-server xx.xx.xx.xx:26379
root 14916 14219 0 10:49 pts/4 00:00:00 /opt/redis/redis-3.2.1-A/src/redis-sentinel xx.xx.xx.xx:6380 [sentinel]
root 14966 14943 0 10:50 pts/3 00:00:00 /opt/redis/redis-3.2.1-C/src/redis-sentinel xx.xx.xx.xx:26380 [sentinel]
root 14971 14921 0 10:50 pts/2 00:00:00 /opt/redis/redis-3.2.1-B/src/redis-sentinel xx.xx.xx.xx:16380 [sentinel]
然后关闭master
,会自动选其中一个slave
为master
,原master
再次启动则为slave
。
请注意,上述的redis.conf和sentinel.conf,Redis在运行中会生成、变更部分配置,比如,故障切换master
后,/redis-3.2.1-A/redis.conf
的最后有如下记录:
# Generated by CONFIG REWRITE
slaveof xx.xx.xx.xx 16379
以下命令仅为本人备份使用,无参考意义:
vi /third_package/redis-3.2.1/redis_A.conf
vi /third_package/redis-3.2.1/redis_B.conf
vi /third_package/redis-3.2.1/redis_C.conf
cp redis_A.conf /opt/redis/redis-3.2.1-A/redis.conf
cp redis_B.conf /opt/redis/redis-3.2.1-B/redis.conf
cp redis_C.conf /opt/redis/redis-3.2.1-C/redis.conf
/opt/redis/redis-3.2.1-A/src/redis-server /opt/redis/redis-3.2.1-A/redis.conf &
/opt/redis/redis-3.2.1-B/src/redis-server /opt/redis/redis-3.2.1-B/redis.conf &
/opt/redis/redis-3.2.1-C/src/redis-server /opt/redis/redis-3.2.1-C/redis.conf &
/opt/redis/redis-3.2.1-A/src/redis-cli -p 6379
/opt/redis/redis-3.2.1-B/src/redis-cli -p 16379
/opt/redis/redis-3.2.1-C/src/redis-cli -p 26379
vi /third_package/redis-3.2.1/sentinel_A.conf
vi /third_package/redis-3.2.1/sentinel_B.conf
vi /third_package/redis-3.2.1/sentinel_C.conf
cp sentinel_A.conf /opt/redis/redis-3.2.1-A/sentinel.conf
cp sentinel_B.conf /opt/redis/redis-3.2.1-B/sentinel.conf
cp sentinel_C.conf /opt/redis/redis-3.2.1-C/sentinel.conf
/opt/redis/redis-3.2.1-A/src/redis-sentinel /opt/redis/redis-3.2.1-A/sentinel.conf &
/opt/redis/redis-3.2.1-B/src/redis-sentinel /opt/redis/redis-3.2.1-B/sentinel.conf &
/opt/redis/redis-3.2.1-C/src/redis-sentinel /opt/redis/redis-3.2.1-C/sentinel.conf &
ps -ef | grep redis
【Redis】Redis的基本安装及使用的更多相关文章
- Redis在windows下安装过程
一.下载windows版本的Redis 去官网找了很久,发现原来在官网上可以下载的windows版本的,现在官网以及没有下载地址,只能在github上下载,官网只提供linux版本的下载 官网下载地址 ...
- 【Redis】简介与安装
Linux 安装 [root@redis ~]# wget http://download.redis.io/releases/redis-2.8.19.tar.gz 解压缩redis[root@ha ...
- Redis单机版本的安装
我的是centos-6.5的环境,安装redis的单机版本 1.下载redis源文件redis-3.0.0.tar.gz到一个目录,我的下载目录是/software 2.编译安装源文件的先觉条件是安装 ...
- redis(一) 安装以及基本数据类型操作
redis(一) 安装以及基本数据类型操作 redis安装和使用 redis安装 wget http://download.redis.io/redis-stable.tar.gz tar zxvf ...
- redis服务和扩展安装(windows)
Windows下安装redis和在php中使用phpredis扩展 原文地址:http://m.oschina.net/blog/281058 Junn 发布于 2年前,共有 0 条评论 1.redi ...
- Windows下使用Redis(一)安装使用
一.Redis 是什么 Redis 是一款依据BSD开源协议发行的高性能Key-Value存储系统(cache and store).它通常被称为数据结构服务器,因为值(value)可以是 字符串(S ...
- linux下Redis与phpredis扩展安装
++++++++++++++++++++++++++++++++++++++++++++++linux下Redis与phpredis扩展安装++++++++++++++++++++++++++++++ ...
- Redis以及Redis的php扩展安装无错版
安装Redis 下载最新的 官网:http://redis.io/ 或者 http://code.google.com/p/redis/downloads/list 第一步:下载安装编译 #wge ...
- (一)Redis初学教程之安装篇
1.下载windows下Redis服务安装程序(有32位的和64位的,识操作系统安装) 下载地址:https://github.com/dmajkic/redis/downloads 2.安装教程(详 ...
- CentOS下Redis 2.2.14安装配置详解(转载)
一. 下载redis最新版本2.2.14 cd /usr/local/src wget –c http://redis.googlecode.com/files/redis-2.2.14.tar.gz ...
随机推荐
- js 随机数 洗牌算法
function shuffle(arr){ var len = arr.length; for(var i = 0;i<len -1;i++) { var idx = Math.floor(M ...
- CacheManagerUtils.java
package com.vcredit.framework.utils; import net.sf.ehcache.Cache;import net.sf.ehcache.CacheManager; ...
- jquery 设置表格奇偶数的颜色和行被选中的颜色样式jquery 设置表格奇偶数的颜色和行被选中的颜色样式
query 代码 $(funtion(){ //设置偶数行和奇数行 $("tbody>tr:odd").addClass("ou"); //为奇数行设 ...
- eclipse汉化过程
第一步: 打开浏览器,浏览“参考资料”内给出的“eclipse语言包下载”地址,在博客新页面找到地址链接,如图所示.“Babel Language...”开头的一栏下面就是各个eclise版本的语言包 ...
- 【代码升级】【iCore3 双核心板】例程二十八:FSMC实验——读写FPGA
实验指导书及代码包下载: http://pan.baidu.com/s/1qXAxwgk iCore3 购买链接: https://item.taobao.com/item.htm?id=524229 ...
- NGUI 渲染流程深入研究 (UIDrawCall UIGeometry UIPanel UIWidget)
上图是一个简要的NGUI的图形工作流程,UIGeometry被UIWidget实例化之后,通过UIWidget的子类,也就是UISprit,UILabel等,在OnFill()函数里算出所需的Geom ...
- ExtJS4笔记 Data
The data package is what loads and saves all of the data in your application and consists of 41 clas ...
- 今天Apple证书更新,提供 "证书的签发者无效" 解决办法
首先 下载苹果新证书 developer.apple.com/certificationauthority/AppleWWDRCA.cer 然后在"钥匙串访问"中 "显 ...
- 思维导图制作工具推荐 - ProcessOn
在使用 Teambition (以下简称Tb)的时候无意中发现了 ProcessOn,由于可以与 Tb 绑定,实现实时更新,很大程度上提升了团队协作的效率. 在以前画 原型/思维导图 等草图的时候,用 ...
- JAVA CAS原理
转自: http://blog.csdn.net/hsuxu/article/details/9467651 CAS CAS: Compare and Swap java.util.concurren ...