Ubuntu安装配置Redis

安装Redis

安装并启动

// 安装
$ sudo apt-get update
$ sudo apt-get install redis-server
// 启动
$ sudo /etc/init.d/redis-server start

检查Redis是否运行

$ redis-cli
# 该命令会打开如下Redis提示:
127.0.0.1:6379> 
# 输入ping
127.0.0.1:6379> ping
PONG
# 说明成功安装

ubuntu安装Redis桌面管理器

# 下载rdm的deb安装包
$ wget https://github.com/uglide/RedisDesktopManager/releases/download/0.8.3/redis-desktop-manager_0.8.3-120_amd64.deb --no-check-certificate
# 先安装libicu52,rdm依赖于libicu52
$ wget http://security.ubuntu.com/ubuntu/pool/main/i/icu/libicu52_52.1-8ubuntu0.2_amd64.deb
# 安装libicu52
$ sudo dpkb -i libicu52_52.1-8ubuntu0.2_amd64.deb
# 安装rdm
$ sudo dpkg -i redis-desktop-manager_0.8.3-120_amd64.deb

Redis配置

查看配置项
127.0.0.1:6379> CONFIG GET CONFIG_SETTING_NAME
# 如:
127.0.0.1:6379> CONFIG GET dbfilename
1) "dbfilename"
2) "dump.rdb"
# 获取所有配置项
127.0.0.1:6379> CONFIG GET *
编辑配置
redis 127.0.0.1:6379> CONFIG SET CONFIG_SETTING_NAME NEW_CONFIG_VALUE
# 如: 
127.0.0.1:6379> CONFIG GET loglevel
1) "loglevel"
2) "notice"
127.0.0.1:6379> CONFIG SET loglevel warning
OK
127.0.0.1:6379> CONFIG GET loglevel
1) "loglevel"
2) "warning"
    原文作者:lianginet
    原文地址: https://www.jianshu.com/p/c8723b677304
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞