The following are the exception details:
Exception in thread "main" Redis.clients.jedis.exceptions.JedisDataException:MISCONF Redis be configured to save RDB snap Shots, but is currently isn't able to persist on disk. Commands that may modify the
First you need to install Redis, install Php_redis extensions after installation, Php_redis extended download address as follows:
PHP Redis Extensions:Download Address:
1, http://windows.php.net/downloads/pecl/releases/redis/
2,
Operating on Linux: REDIS-CLI link redis-cli-a password
You can also enter the password individually: 127.0.0.1:6379>auth d3bcc7a988ad2d652276bca0ad8141a5
To view an existing key value pair: 127.0.0.1:6379> keys *
Configure master-Slave
Installing the Redis on a Linux machine is very easy, not to be introduced here. Since I have only one machine to learn from the master-slave copy function, I need to start multiple Redis instances on a single machine. We need to copy the default
Redis download Address, agreed version number The last even-numbered stable version, the odd is an unstable version, I download here is the redis-4.0.8 version of the/usr/local under the new Redis directory, will download the Redis compression
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
Redis provides two persistence mechanisms for RDB and AOF: The RDB saves a snapshot of the database (snapshot) to disk in a binary way. AOF, in the form of protocol text, logs all commands (and their parameters) that have been written to the
The internal structure of Redis is shown in the following figure:
The function modules are described as follows:
File event: Processing of files events (multiplexing in multiple clients, accepting command requests from them (read events), and
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
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
Reference article: https://blog.csdn.net/fgf00/article/details/52917154
I. Introduction of RedisRedis is a key-value storage system. Similar to memcached, it supports storing more value types, including string (string), list (linked list), set (set),
Redis installation and running One, Windows environment installation, running the author's version for Redis 3.2, download link redis3.2-win32.zip download directly after the decompression does not need to install, the operation needs to enter the
incr
usage
incr Key, you can increment the key value atom by 1 and return the new value corresponding to the key after the increment operation. If the specified key does not exist, its value is set to 0 before the incr operation is performed.
/*
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
Redis receives a connection from a client by listening to a TCP port or a UNIX socket, and when a connection is established, the following actions are performed within Redis:
• First, the client socket is set to non-blocking mode because Redis uses
Redis Learning Manual (opening)
Http://www.cnblogs.com/stephen-liu74/archive/2012/02/13/2348935.html
First, Introduction
Second, the advantages of Redis
Third, the current version of the main problems of Redis
Iv. Comparison of relational databases
Each hash can store 4,294,967,295 key-value pairs
Type of hash (hash):
Hset Assignment Value
127.0.0.1:6379> hset H1 username java1234(integer) 1127.0.0.1:6379> hset H1 Password 123456(integer) 1
Hget value
127.0.0.1:6379> Hget H1 username"Java1
1, the introduction of RedisRedis Open Source memory database, storing data in key-value way; Redis features: 1), Redis data is completely stored in memory, using disk only to persist data, solve the problem of data loss caused by restarting the
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