1. Redis officially does not have native installation packages under Windows. as shown in Figure 1
Figure 1
2. Reference:The project is no longer actively maintained. If you are looking for a Windows version of Redis, you may need to check Memurai. Please note that Microsoft does not officially recognize the product in any way. Decided to use memurai. as shown in Figure 2
Figure 2
3. After installing memurai-developer-v4.1.2.msi, restart the computer to make the environment variable take effect.
4. In the end, it was found that there was no effect, and c:program filesmemurai did not exist. Execute: C:>msiExec /quiet/i memurai.msi , still no effect. Finally decided to give up.
PS C:> wsl --install
正在安装: 虚拟机平台
已安装 虚拟机平台。
正在安装: 适用于 Linux 的 Windows 子系统
已安装 适用于 Linux 的 Windows 子系统。
正在安装: 适用于 Linux 的 Windows 子系统
已安装 适用于 Linux 的 Windows 子系统。
正在安装: Ubuntu
已安装 Ubuntu。
请求的操作成功。直到重新启动系统前更改将不会生效。
PS C:>
7. Install redis, enter ubuntu, and install the latest stable version of redis, packages.redis.io from the official apt repository. Add the repository to the apt index, update it, and install it. as shown in Figure 4
Figure 4
8. Edit the configuration file of redis /etc/redis/redis.conf. To the Bind option (Bind), usually the default is binding to 127.0.0.1, and modify it to bind to all interfaces 0.0.0.0. as shown in Figure 5
Figure 5
9. Save and close the file. Then restart the redis service for changes to take effect:
sudo service redis-server restart
10. Run ip addr in the wsl terminal to find the ip address of wsl
root@DESKTOP-H4MGQIU:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:15:5d:7b:2d:f2 brd ff:ff:ff:ff:ff:ff
inet 172.24.155.141/20 brd 172.24.159.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe7b:2df2/64 scope link
valid_lft forever preferred_lft forever
root@DESKTOP-H4MGQIU:~#
11. Set the authentication password for the default user, otherwise you may not be able to access Redis from the external Windows host. Then restart the service. as shown in Figure 6
Figure 6
root@DESKTOP-H4MGQIU:~# vi /etc/redis/redis.conf
root@DESKTOP-H4MGQIU:~# sudo service redis-server restart
root@DESKTOP-H4MGQIU:~#
12. Connect to Redis in WSL on Windows, the connection is successful. as shown in Figure 7
Figure 7
Leave a Reply