我刚接触InfluxDB,找不到有关在Windows上安装InfluxDB的详细信息。是否有办法在Windows机器上安装它,还是我需要使用Linux服务器进行开发?
我刚接触InfluxDB,找不到有关在Windows上安装InfluxDB的详细信息。是否有办法在Windows机器上安装它,还是我需要使用Linux服务器进行开发?
目前的InfluxDB 0.9分支是纯Go语言编写的,可以使用以下命令在Windows上进行编译:
cd %GOPATH%/src/github.com/influxdb
go get -u -f ./...
go build ./...
当然,您需要安装(>1.4)的 go、git 和 hg。
如果您不想编译自己的版本,您也可以在此处找到我自己的 Windows x86 二进制文件 v0.9.0-rc11: https://github.com/adriencarbonne/influxdb/releases/download/v0.9.0-rc11/influxdb_v0.9.0-rc11.zip
要运行 InfluxDB,请输入:influxd.exe
。
或者更好的方法是创建以下配置文件,将其保存为 influxdb.conf
并运行 influxd --config influxdb.conf
:
reporting-disabled = true
#[logging]
#level = "debug"
#file = "influxdb.log"
[admin]
enabled = true
port = 8083
[api]
port = 8086
[data]
dir = "data"
[broker]
dir = "broker"
influxd -config influxdb.conf
(带有 'd')。 - Felipe Cruz我在这个问题上挣扎了很久,所以我将全过程逐步发布。这将有望帮助其他人来到这篇文章。
目录:
编辑:警告,如果Go和项目文件夹安装在自定义路径(而不是c:\go),则此方法无效。在这种情况下,go get会出现关于无法识别导入路径的晦涩消息(感谢user626528提供信息)
1. 先前的下载
Windows版Go(获取.msi文件): https://golang.org/dl/
Windows版GIT: http://git-scm.com/download/win
2. 编译
cd 进入C:\Go
在"C:\Go\projects"中创建我们的$GOPATH(除了C:\Go\src之外的任何地方都可以,因为它是$GOROOT)。
> mkdir projects
> set GOPATH=C:\Go\projects
> go get github.com/influxdata/influxdb
进入 C:\Go\projects\github.com\influxdata\influxdb 目录:
拉取项目所需的依赖:
> go get -u -f ./...
> go build ./...
...这将在 C:\Go\projects\bin 目录下创建3个可执行文件:
influx.exe
influxd.exe
urlgen.exe
3. 执行
启动服务:
influxd -config influxdb.conf
reporting-disabled = true
#[logging]
#level = "debug"
#file = "influxdb.log"
#write-tracing = false
[admin]
enabled = true
port = 8083
[api]
port = 8086
[data]
dir = "data"
[broker]
dir = "broker"
服务启动后,您可以执行 Chrome 并访问 http://localhost:8083,开始使用 InfluxDb 进行交互。
用户名和密码的默认值为:
username: root
password: root
influxd config > influxdb.generated.conf
命令并编辑所需内容。 - Adarshago get
会出现关于无法识别导入路径的晦涩信息。 - user626528code in directory C:\Go\projects\src\github.com\uber-go\zap expects import "go.uber.org/zap"
。有什么想法如何解决它吗? - syfantidgdm restore
(https://github.com/influxdata/influxdb/issues/8733) - ziya对于Xavier Peña构建最新influxdb的解决方案进行了一些更新。请注意github URL和路径的差异。
C:\Go\projects>go get github.com/influxdata/influxdb
C:\Go\projects>go get github.com/sparrc/gdm
C:\Go\projects>cd C:\Go\projects\src\github.com\influxdata\influxdb
C:\Go\projects\src\github.com\influxdata\influxdb>go get -u -f ./...
C:\Go\projects\src\github.com\influxdata\influxdb>c:\Go\projects\bin\gdm.exe restore
C:\Go\projects\src\github.com\influxdata\influxdb>go build ./...
C:\Go\projects\src\github.com\influxdata\influxdb>go install ./...
C:\Go\projects\bin>influxd config > influxdb.generated.conf
C:\Go\projects\bin>influxd -config influxdb.generated.conf
无法加载包:package github.com/influxdata/influxdb: C:\Go\src\github.com\influxdata\influxdb 中没有可构建的 Go 源文件
。 - andr111经过无数篇文章的研究,一般不建议直接在Windows上安装InfluxDB。存在许多问题,例如性能和稳定性。官方的InfluxDB也不支持Windows,并且将来也没有计划。这一点进一步证明了最新的InfluxDB 2.0不包括任何Windows二进制文件。
InfluxDB 2.0不包括Windows二进制文件
那怎么办呢?
Docker是免费的。如果您打算在Windows Server上安装docker,则对于Windows Server 2016及以上版本,也是免费的(Microsoft与Docker达成特别协议以免费提供它们)。
对于那些还在VM世界中的人:
Docker不像虚拟机。它通过Windows服务直接与主机文件系统交互
请查看下面的链接以获取逐步指南:
https://www.open-plant.com/knowledge-base/how-to-install-influxdb-docker-for-windows-10/
在2014年9月30日时,influxdb没有Windows版本,只有Linux和OSX版本。
更新:当前版本0.9在2015年4月9日已经有了Windows版本。
目前的influxdb 0.9分支是纯go语言编写的,可以在Windows上进行编译。主要先决条件是go 1.4、git(例如tortoisegit和msysgit),hg(例如tortoisehg)。
使用这个设置,我已经成功地在Win7 x64上编译并运行了influxdb。
前往influxdata.com,点击下载
https://portal.influxdata.com/downloads/
选择版本1.7,因为目前没有2.0的二进制文件。
下载Windows二进制文件
如果您不想自己编译,构建是由influxdata完成的,可以在以下网址找到:https://dl.influxdata.com/influxdb/releases/influxdb-1.0.0-beta2_windows_amd64.zip(只需更改版本号以获取另一个(最新)版本)
但是,正如Paul Dix所提到的,Windows目前尚未得到官方支持。