关于Linux的Windows子系统上的InfluxDB"无法分配内存"

时间:2017-12-04 20:41:49

标签: influxdb windows-subsystem-for-linux

在运行Ubuntu 16.04的Windows的Linux子系统上,我根据Influx documentation安装了InfluxDB 1.4.2。我无法将其作为服务或使用systemctl运行,可能是因为WSL不支持(请参阅GitHub问题9941579),因此这些都不起作用:

$ sudo service influxdb start
influxdb: unrecognized service
$ sudo systemctl start influxdb
Failed to connect to bus: No such file or directory

如果我运行$ sudo influxd,Influx会启动,但随后会显示消息

run: open server: open tsdb store: cannot allocate memory

如何修复"无法分配内存"错误吗

2 个答案:

答案 0 :(得分:0)

在Win10 Spring 2018 Update上,我运行了以下内容:

sudo apt install influxdb influxdb-client -y

安装正常。

按照文档...... enter image description here

...使用以下方式启动服务:

sudo service influxdb start

开始罚款: enter image description here

让我们连接,检查和创建数据库: enter image description here

如果我在这里做错了重复,请告诉我,否则,看起来这个问题已经解决了。

答案 1 :(得分:0)

在WSL中进行安装时,我只是遇到了此问题,但已安装systemd。安装influxdb软件包时,它注册了一个systemd单元,因此我无法使用init.d启动它。我使用this guide解决了这个问题。我搜索了一个较旧的版本并发现了this,而不是指向init.sh脚本的无效链接。

使InfluxDB在WSL中运行的步骤(至少在安装了systemd的情况下):

  1. 使用sudo apt install influxdb
  2. 安装influxdb
  3. this file的内容复制到位置/etc/init.d/influxdb的新文件中
  4. 您现在可以使用sudo service influxdb start启动influxdb。

对我来说,它在启动时显示了一条错误消息,但仍然可以正确启动。