Apache Shiro to use the custom cache to implement the CacheManager and cache for both interfaces
Shiro has three important cache Interfaces:cachemanager cache Cachemanageraware
A CacheManager returns cache instances and various Shiro components
single-Machine multi-instance Redis master-slave replication configuration
Redis principal and subordinate copy principle look here.
Master Redis's main configuration file is as follows:
/etc/init.d/redis_6379 boot
/etc/redis/redis_6379.conf
After we install the Redis service, then we look at the basic configuration.
Redis configuration file default location/etc/redis.conf:
Egrep-v "(^#|^$)"/etc/redis.conf
Enter the Redis command line:
Redis-cli
Where 6379 is the listening
The previous company in the development phase of the Redis has been the formal environment, the recent boss let me in a local area network for the development phase of the Redis connection use, build process also encountered some problems,
First, Redis introduction
Redis is one of the most popular NoSQL systems, and it is a key-value storage system. Similar to memcache, but largely compensates for the lack of memcache, which supports a relatively large number of stored value types,
When connecting to a remote Redis with Jedis today, throw the connection Timeout exception: Connect timed out. The specific information is as follows:
Exception in thread "main"
View the status of a Redis native
Redis-cli-h 192.168.12.12-p 6379-a a603fd9c-f96a-43d9-8913-c49947ee14fe info Replication start Redis service
Sudo/usr/bin/redis-server/etc/redis/redis.conf starting the Redis service as a Redis identity
Sudo-u
One: Problem Description:Using supervisor to manage the celery process, the broker uses Redis, and the Gevent pool runs Task,celery uses a version of 4.0.2, randomly appearing missed hearbeat worker, running normally after restarting the
http://my.oschina.net/OutOfMemory/blog/300173
Redis version currently in use?
1 2
#redis-cli-v REDIS-CLI 2.6. 4
MULTI, EXEC, DISCARD, and watch are the basis of Redis transactions
The 1.MULTI command is used to open a
Jedis is a Redis Java client that, through a period of time, Jedis basically implements all of Redis's capabilities, and Jedis Redis data sharding on the client, Redis itself has no data distribution capabilities. First, download Jedis code
Jedis
The jump table is an ordered data structure that supports the average O (logn) and worst O (N) complexity of node lookups. Jumping tables are applied to the scene of an ordered set key and a cluster node. This article refers to the Redis3.0 version
Transactions in Redis are essentially collections of a set of commands. All commands in a transaction are serialized and executed serially in sequence without being inserted by another command.Redis supports transactions with the following five
Package Com.zm.blog.config.shiro;
Import org.apache.shiro.session.Session;
Import Org.apache.shiro.session.SessionListener;
public class Myshirosessionlistener implements Sessionlistener {
//The session is created with the trigger
@Override
Redis persistence mechanism
Redis is an in-memory database that supports persistence, which means that Redis often needs to synchronize the in-memory data to the hard disk to persist.
Redis persistence two ways RDB and AOF
1.snapshotting
Reason: Related to the database configuration parameters of the Yii Redis
Array (
"Framework.vendors.yiiredis.ARedisConnection",
"127.0.0.1",
= 6379,
= 0,
"",
"", "
)
Under Redis, a database is identified by an integer
Today, I accidentally saw a piece of code that was previously optimized for a similar problem. But this problem again and again again appear, really think yards nong, also not who can be good. Details determine success or failure, the style of doing
(Error) DENIED Redis is running in protected mode because protected mode is enabledRedis Protected-mode is a new feature added after 3.2, and in Redis.conf's comments we can see that his specific role and enabling conditions
Redis can only be linked
If Redis is installed with apt-get or yum install, you can stop/start/restart Redis directly with the following command
/etc/init.d/redis-server Stop
/etc/init.d/redis-server start
/etc/init.d/redis-server restartIf you are installing Redis via
Login and Cookie caching
There are two common ways to log on to cookies: one is a signed (signed) cookie, and the other is a token cookie.
A signature cookie typically stores a user name, possibly a user ID, the last time a user successfully logged
1, decompression: TAR-ZXVF redis-3.0.0.tar.gz2, LL3. CD redis-3.0.0Must have makefile at compile time4. Make
[Root@localhost redis-3.0.0]# make
cd src && do all
make[1]: Enter directory "/USR/JAVA/REDIS-3.0.0/SRC"
CC ADLIST.O in
file included
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service