Redis:修订间差异
跳到导航
跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
(→設定) |
(→設定) |
||
(未显示同一用户的5个中间版本) | |||
第6行: | 第6行: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
sudo add-apt-repository -y ppa:redislabs/redis; sudo apt install -y redis | sudo add-apt-repository -y ppa:redislabs/redis; sudo apt install -y redis; sudo apt clean | ||
</syntaxhighlight> | |||
如果只要裝client端的話: | |||
<syntaxhighlight lang="bash"> | |||
sudo add-apt-repository -y ppa:redislabs/redis; sudo apt install -y redis-tools; sudo apt clean | |||
</syntaxhighlight> | </syntaxhighlight> | ||
== 設定 == | == 設定 == | ||
這邊假定Redis放在內部信任網路裡。 | |||
修改<code>/etc/redis/redis.conf</code>,把預設只聽localhost的部份改成所有界面都聽,然後把<code>protected-mode</code>關閉: | 修改<code>/etc/redis/redis.conf</code>,把預設只聽localhost的部份改成所有界面都聽,然後把<code>protected-mode</code>關閉: | ||
第18行: | 第26行: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
開機啟動: | 如果要打開密碼認證,舊版的設定方式是這樣: | ||
<syntaxhighlight lang="apache"> | |||
bind * -::* | |||
protected-mode yes | |||
requirepass PassW0rd | |||
</syntaxhighlight> | |||
設定 開機啟動: | |||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> |
2023年8月11日 (五) 08:02的最新版本
Redis是一套NoSQL。
安装
在Ubuntu下可以直接安装官方的APT Repository:
sudo add-apt-repository -y ppa:redislabs/redis; sudo apt install -y redis; sudo apt clean
如果只要装client端的话:
sudo add-apt-repository -y ppa:redislabs/redis; sudo apt install -y redis-tools; sudo apt clean
设定
这边假定Redis放在内部信任网络里。
修改/etc/redis/redis.conf
,把预设只听localhost的部分改成所有界面都听,然后把protected-mode
关闭:
bind * -::*
protected-mode no
如果要打开密码认证,旧版的设定方式是这样:
bind * -::*
protected-mode yes
requirepass PassW0rd
设定开机启动:
sudo systemctl enable redis-server.service
外部链接
- 官方网站 (英文)