參考鏈接:https://blog.csdn.net/zyp1376308302/article/details/84257606
參開鏈接2:https://www.cnblogs.com/guanbin-529/p/9180840.html
略有閑暇,准備深入下Redis
下載與安裝:
1. 官網http://redis.io/ 下載最新的穩定版本,這里是5.0.0
2. 將解壓后的文件放入指定目錄
3. 終端進入解壓后的目錄
4. sudo make test 測試編譯
5. sudo make install //安裝redis
如果在第5步測試時報如下錯:
Executing test client: couldn't execute "src/redis-benchmark": no such file or directory.
則執行以下兩個步驟
1.sudo make distclean
2.sudo make
啟動:
redis-server //啟動命令
cmd+n 開啟新的終端
redis-cli //測試客戶端程序
使用-語法:
http://redisdoc.com/string/set.html
使用-spring data
官網:https://docs.spring.io/spring-data/redis/docs/2.1.5.RELEASE/reference/html/#get-started
參考文檔:https://blog.csdn.net/winter_chen001/article/details/80614331
demo:https://download.csdn.net/download/the_fool_/10992866
依賴:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
、