【Redis】安裝配置

安裝步驟(CentOS7.5安裝Redis5.0(tar.gz))

  1. 下載redis安裝包到指定目錄
    • wget http://221.180.170.26/cache/download.redis.io/releases/redis-5.0.4.tar.gz?ich_args2=129-10234207025837_5461eefd1ae1de1982edb3ff74280d08_10001002_9c89612bd2c3f3d8923c518939a83798_37983210af4ed9c1da3498e3bb7c448f
  2. 安裝gcc依賴
    • yum install gcc
  3. 編譯安裝
    • make MALLOC=libc
  4. 將當前目錄/src下的文件加到/usr/local/bin目錄
    • cd src && make install
  5. 修改redis.conf文件
    • daemonize no → daemonize yes 守護進程
    • requirepass XXX 密碼
    • bind 127.0.0.1 註釋掉即可讓所有ip訪問,若想指定ip訪問,使用"bind ip"指定即可
  6. 啓動redis服務
    • cd src
    • ./redis-server /opt/DevTools/Redis/redis-5.0.3/redis.conf
  7. 登錄
    • redis-cli -p 6379
  8. 認證密碼
    • auth 123456
  9. 關閉redis服務
  • ps -aux | grep redis
  • kill -9 PID

其他命令

  1. 獲取密碼
    • config get requirepass

解決問題

  1. 問題:org.springframework.data.redis.RedisSystemException: Error in execution; nested exception is io.lettuce.core.RedisCommandExecutionException: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
    • 解答:config set stop-writes-on-bgsave-error no
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章