First prepared to use Redis, a well-known NoSQL cache database.
Here is the first day, simply write the installation under Windows, some of the problems encountered, and then simply use and test, and then use and test in the code.
After the test in the production environment, the installation test under Linux, for the cache cluster, for the time being not ready to use, if you encounter later to explain.
The first is the download: a lot of online Baidu came out that the Windows version of the above on GitHub is Https://github.com/MSOpenTech/redis
But for many newbies (and I'm among them), GitHub is an open source project, not the actual files we need to install, the files we need to install are:
Https://github.com/MSOpenTech/redis/releases
Download the latest version.
Then unzip the installation directly
Run the following command in CMD mode, it should be easy to play Linux.
C:\users\xx>e:
E:\>CD redis-x64-3.2.100
E:\redis-x64-3.2.100>redis-server.exe redis.windows.conf
Then do not close this window, let the service open, and then open another CMD window
After entering the same directory
E:\redis-x64-3.2.100>redis-cli.exe-h localhost-p 6379
So we get into redis.
Then simply use the set and get commands to do the test.
Set key value [EX seconds] [PX milliseconds] [nx| XX]
When you enter set, you see the hints that appear, and you know the parameters.
The main attention to the following several, English is very simple I will not translate
EX
Seconds-Set The specified expire time, in seconds.
PX
Milliseconds-Set The specified expire time, in milliseconds.
NX
--only set the key if it does not already exist.
XX
--only set the key if it already exist.
The get command doesn't say much.
Tomorrow update how to use Redis in a Java project
Redis (1) Installation and testing in a Windows environment