美文网首页我爱编程
如何在Windows 10子系统Ubuntu上的Bash上配置R

如何在Windows 10子系统Ubuntu上的Bash上配置R

作者: 小闫94 | 来源:发表于2018-03-24 16:25 被阅读0次
Ubuntu on Win10
  1. 安装

首先,需要输入以下内容来安装redis-server:
sudo apt-get install redis-server
接下来,要编辑/etc/redis/redis.conf并将以下行
bind 127.0.0.1
更改为
bind 0.0.0.0
最后,键入以下命令重新启动服务:
sudo service redis-server restart

  1. 测试

接下来,可以通过输入以下内容来测试你的Redis服务器实例:

root@yan:/home/yan# redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379>
  1. redis服务自启动问题

关闭Ubuntu窗口后下次再打开,redis-cli连不上redis服务器:

yan@yan:~$ redis-cli
Could not connect to Redis at 127.0.0.1:6379: Connection refused
not connected>

解决方法:

yan@yan:~$ sudo service redis-server start
[sudo] password for yan:
Starting redis-server: redis-server.
yan@yan:~$

再次测试:

yan@yan:~$ redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> set hello world
OK
127.0.0.1:6379> get hello
"world"
127.0.0.1:6379>

好像……WSL里面每次都要自己手动启动服务……

相关文章

网友评论

    本文标题:如何在Windows 10子系统Ubuntu上的Bash上配置R

    本文链接:https://www.haomeiwen.com/subject/asgqcftx.html