Wednesday, September 7, 2022

Redis on Windows

 最近要在Windows起一個Redis:

先使用 Windows 子系統 Linux 版 安裝 Linux ,開一個Powershell。

輸入: wsl --install

按照指示進行安裝,自動重啓後就會進入ubuntu界面,如果之後要再入ubuntu,用cmd輸入bash即可。


安裝Redis:

  • curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
  • echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
  • sudo apt-get update
  • sudo apt-get install redis


設定路徑在︰/etc/redis/redis.conf

執行路徑在︰/etc/init.d/redis-server start


需要打開ubuntu防火牆︰sudo ufw allow 6379

No comments: