How to install InfluxDB in Windows

末鹿安然 提交于 2019-11-27 14:33:58

问题


I am new to InfluxDB. I could not find any details about installing InfluxDB on Windows. Is there any way to install it on a Windows machine or do I need to use a Linux server for development purposes?


回答1:


The current 0.9 branch of influxdb is pure go and can be compiled on Windows with the following commands:

cd %GOPATH%/src/github.com/influxdb
go get -u -f ./...
go build ./...

Of course you will need go (>1.4), git and hg.

If you do not want to compile your own version, you can also find here my own Windows x86 binaries for v0.9.0-rc11: https://github.com/adriencarbonne/influxdb/releases/download/v0.9.0-rc11/influxdb_v0.9.0-rc11.zip

To run InfluxDB, type: influxd.exe.

Or even better, create the following config file, save it as influxdb.conf and run 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"



回答2:


I struggled quite a lot with this issue, so I'll post the full process step by step. This will hopefully help other people that lands on this post.

Table of contents:

Edit: WARNING, this doesn't work if Go and projects folder are installed to a custom path (not c:\go). In this case go get breaks with cryptic messages about unrecognized import paths (thanks to user626528 for the info)

  1. PREVIOUS DOWNLOADS
  2. COMPILATION
  3. EXECUTION

1. PREVIOUS DOWNLOADS

Go for Windows (get the .msi): https://golang.org/dl/

GIT for Windows: http://git-scm.com/download/win


2. COMPILATION

cd to C:\Go

Create our $GOPATH in "C:\Go\projects" (anywhere but C:\Go\src, which is the $GOROOT).

> mkdir projects

Set to $GOPATH variable to this new directory:

> set GOPATH=C:\Go\projects

Pull the influxdb code from github into our $GOPATH:

> go get github.com/influxdata/influxdb

cd to C:\Go\projects\github.com\influxdata\influxdb

Pull the project dependencies:

> go get -u -f ./...

Finally, build the code:

> go build ./...

...this will create 3 executables under C:\Go\projects\bin:

influx.exe 
influxd.exe
urlgen.exe

3. EXECUTION

To start the service:

influxd -config influxdb.conf

For that, you first need to create a influxdb.conf file with the following text:

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"

Once the service is started, you can execute Chrome and go to http://localhost:8083, and start playing with InfluxDb.

Default values for username and password are:

username: root
password: root



回答3:


Few updates to Xavier Peña solution to build latest influxdb. Notice the difference in github URL and the path.

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



回答4:


Windows if officially supported. Go to https://portal.influxdata.com/downloads and download it from there.




回答5:


The current 0.9 branch of influxdb is pure go and can be compiled on Windows. The main prerequisites are go 1.4, git (e.g. tortoisegit together with msysgit), hg (e.g. tortoisehg).

Using this setup I've successfully compiled and run influxdb on Win7 x64.




回答6:


There wasn't an influxdb Windows version at Sep 30 '14, there were are only Linux and OSX versions.

Update: Current 0.9 version at present 04/09/2015 have a win version.




回答7:


The "nightlies" build actually has windows executables now. The release version does not (there is an open issue for that).

Alternatively, downloading the released version and adding the .exe extension to the file names should work as well. You would have to generate the config file using the command:

influxd config >influxdb.conf



回答8:


We don't officially support Windows at this time. However, you should now be able to build from master. See this issue to track it closely and the comments at the bottom have a link to where you can get a compiled binary: https://github.com/influxdata/influxdb/issues/5359




回答9:


For create influxdb configuration file we can also use the below command

influxd config > influxdb.generated.conf




回答10:


If you don't want to compile it yourself, the build is done by influxdata and can be found at URLs like : https://dl.influxdata.com/influxdb/releases/influxdb-1.0.0-beta2_windows_amd64.zip (just change the version number to have another (recent) version)

However, as mentionned by Paul Dix, Windows is not officially supported for the moment.




回答11:


go to influxdata.com click downloads https://portal.influxdata.com/downloads/

select version 1.7 . because currently there are no binaries for 2.0 . download windows binnary



来源:https://stackoverflow.com/questions/26116711/how-to-install-influxdb-in-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!