How to install InfluxDB in Windows - linux

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?

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"

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)
PREVIOUS DOWNLOADS
COMPILATION
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

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

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

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.

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.

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

Update 2020 - InfluxDB is NOT recommended on windows
After going through countless of articles, it is generally NOT recommended to install InfluxDB directly on Windows. There are many issues. In terms of performance and stability. Official InfluxDB too does not support windows and has no plans for it in the future. This is further proven as the latest InfluxDB 2.0 does not include any windows binaries.
InfluxDB 2.0 does not include windows binaries
so?
Work Around? => DOCKERS for WINDOWS, Try it, it's easy and free
Dockers are free. If you intend to install docker on Windows Server, it's also free for Windows Server 2016 and above (Microsoft made a special deal with docker to provide them for free)
For those who are still in the VM world:
Dockers are NOT like Virtual Machines. It interacts directly with the host's file system via a windows service
Check the link below for a step by step guide:
https://www.open-plant.com/knowledge-base/how-to-install-influxdb-docker-for-windows-10/

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

For create influxdb configuration file we can also use the below command
influxd config > influxdb.generated.conf

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.

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 binary

Related

A solution to rEFInd unable to load using shim when Secure Boot is enabled

Background
Ubuntu 21.10 can load on my computer through secure boot, and the shim version is 15.4. Then refer to the official tutorial, I installed rEFInd v0.13.2 (the latest version when I posted this blog) via PPA in Ubuntu 21.10. However, when I restart the system and load rEFInd, it always fails with the message Verification failed:(0x1A)Security Violation. I'm sure that both refind_local.cer and refind.cer under the EFI/refind/keys/ have been enrolled through MokManager (Although only refind_local.cer is needed through PPA installation).
Cause
From this post, I got that rEFInd currently (v0.13.2) lacks the .sbat section. For shim 15.3 and later versions, SBAT is mandatory, resulting in failure to start rEFInd.
The post also indicates that the author of rEFInd is currently studying how to solve the related problems. I hope the later versions can fix this issue.
Solution
To conclude, you need to use shim 15 to solve this problem. For this purpose, you can perform the following steps (applicable to amd64. Steps are also similar if you are on other architectures):
Obtain MokManager and the shim efi file signed by Microsoft from Ubuntu launchpad. To achieve this, download shim_15+1552672080.a4a1fbe-0ubuntu2_amd64.deb and shim-signed_1.45+15+1552672080-064ubuntub_bed64.deb.
Unpack the downloaded shim_15+1552672080.a4a1fbe-0ubuntu2_amd64.deb and take out the mmx64.efi file. (data.tar.xz-> . -> usr/lib/shim/mmx64.efi)
Unpack the download shim-signed_1.45+15+1552672080.a4a1fbe-0ubuntu2_amd64.deb, take out the shimx64.efi.dualsigned file. (data.tar.xz-> . -> usr/lib/shim/shimx64.efi.dualsigned) Rename it to shimx64.efi.
Go to download refind-bin-0.13.2.zip. Then create a new folder, and put the two files taken out together with the downloaded zip file into the new folder.
Open terminal in the fore-mentioned folder, then execute the following commands:
unzip refind-bin-0.13.2.zip
cd refind-bin-0.13.2
sudo ./refind-install --shim ../shimx64.efi
If you encounter any confirmation during the installation process, just enter y to confirm.
After restarting, if it prompts Verification failed, refer to step 9 of the official tutorial. Select Enroll key from disk, and then select the ESP disk where you installed rEFInd. Finally, choose the file of path EFI/refind/keys/refind.cer to import.
If you use a non-Ubuntu Linux system on your computer, you can continue to import the cer files corresponding to your distributions in EFI/refind/keys as above. Failure to do so may cause your Linux distribution to be unable to boot via rEFInd.

Installing ChromeDriver on self-hosted Azure DevOps Agent

I recently created a self-hosted Azure DevOps Agent and installed with Google Crome as well. Is it possible to install Chrome Driver on this server and can I select a specific version to be used?
I'd like for Chrome Driver 2.42.0.1 to be used by this Self-hosted Agent.
Any help will be much appreciated. Thanks!
One more solution to use Microsoft-hosted agents with already installed Chrome browser chrome driver.
Agents already contain environment variable with ChromeWebDriver location on Agent (It works for "windows-2019" and "vs2017-win2016"
Microsoft-hosted agents).
Also firefox and IE drivers exists on Agents (https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md).
C# code:
ChromeOptions chromeOptions = new ChromeOptions();
var driverPath = Path.Combine(Directory.GetCurrentDirectory());
var envChromeWebDriver = Environment.GetEnvironmentVariable("ChromeWebDriver");
if(!string.IsNullOrEmpty(envChromeWebDriver) &&
File.Exists(Path.Combine(envChromeWebDriver, "chromedriver.exe")))
{
driverPath = envChromeWebDriver;
}
ChromeDriverService defaultService = ChromeDriverService.CreateDefaultService(driverPath);
defaultService.HideCommandPromptWindow = true;
var driver = (IWebDriver) new ChromeDriver(defaultService, chromeOptions);
Installation I found using npm install here: :)
https://www.npmjs.com/package/chromedriver
This may be a late post but to help out the forum, which has helped me since almost a decade, here is how we sorted it out.
By default the "Azure Pipelines Hosted VS2017 image" (Or in Classic Editor Agent Specification its called vs2017-win2016) already has Google Chrome (Version 77.0.3865.90 as on 3rd December 2019) and ChromeDriver (77.0.3865.40 as on 3rd December 2019) pre-installed (More info here - https://github.com/Microsoft/azure-pipelines-image-generation/blob/master/images/win/Vs2017-Server2016-Readme.md)
But we still faced the issue of "selenium-side-runner" not able to find the ChromeDriver due to the missing PATH in the System Variables of Environment variable in Windows.
Image - Chrome Driver Not found
So we tried digging in a bit deeper and found that we could achieve this by uploading the ChromeDriver through the Build process and then copying that into the NodeJs folder within C:Program Files..! Sweet?
Lets walk through the steps briefly to see how this is achieved.
We first have to visit https://chromedriver.chromium.org/downloads
and search for the version of the driver matching the version on
Chrome installed on the Hosted Agent (Version 77 in our case as on
date)
Next we create a folder in our Azure Repos and push both the
Chromedriver.exe and our Sample.side file in that folder (Side file
can be named per your preference, and this is generated from the
Selenium IDE)
Adding ChromeDriver.exe and sample.side file in the Repo
Now we create the Build process to just zip the contents of this
folder and create an Artifact from this to be consumed in the
Release Pipeline.
Build Pipeline explained
Next we build the Release Pipeline and ensure that the
vs2017-win2016 Agent is taken
The steps assigned to the Agent include:
Extracting of the zip file
Installing the Selenium Side Runner by using NPM and custom
Command - "install -g selenium-side-runner"
We then have to copy the ChromeDriver.exe from the extracted files
to "C:\Program Files\nodejs" folder using command prompt -
copy "chromedriver.exe" "C:\Program Files\nodejs"
The final step would be to run the "selenium-side-runner"
command - selenium-side-runner sample.side
We would see the test result at the end of the task by checking the log file for the task.
Hope this helps..!

Team City "minimal build agent" Docker image - "npm: not found" Linux issue?

First of all, I think this is more of a Linux issue as the problem seems to be on a linux-flavoured Docker container, but I'm happy to accept that I can do something to the team city config to overcome this.
I'm also not very experienced with Linux, Docker or node/npm, though I do have a lot of development experience and am very comfortable with command line interfaces in general.
Background
We currently have Team City set up as a build server, for building a variety of projects:
.Net Framework,
.Net Core
Angular CLI
A couple of simple websites which use node packages to generate HTML from Markdown.
The server is running as a Docker container using Docker for Windows on a Windows Server box, and this is working well.
We have one Windows 10 Build agent (a VM) which is also working fine, and builds all the .Net and .Net Core stuff fine.
The simple docs site stuff primarily uses the markdown-to-html node package, so its build steps simply get all the source .md files and compile to html with markdown-to-html, plus use some other npm packages for SASS compilation and minification of js etc. No actual node code as such, just some jQuery. In order to not tie up the other agent, and because this stuff can run happily on Linux, I want to have this running on a small docker image rather than a full VM build agent somewhere.
I previously successfully used a node.js team city agent docker image (either jacobpeddk/teamcity-agent-nodejs or omez/teamcity-agent-nodejs - can't recall) which did work for a time, though I had issues with being able to install some npm packages globally in build scripts, which meant I had to get a bash terminal into the container and run some manual npm commands. I also I think had to run apt-get install zip to get a zipping step to work. This worked fine for a while (weeks).
I added some extra JS stuff to one of these simple projects, and suddenly I was getting errors when trying to build. I (perhaps stupidly) decided that this was probably due to the container having older versions of node and/or npm etc, so I attempted to update this by getting a bash shell into the container, installing nvm and updating node.js & npm.
This ended up with a rather broken container (node errors), so I thought I'd instead start again, but actually start with the jetbrains/minimal-build-agent Docker image instead, with the aim of ending up with a nice bespoke image for our needs specifically (as I couldn't find a very up-to-date pre-existing one)
I've running a Bash shell directly on the build agent container by executing this on the host:
docker exec -it basicagent /bin/bash
then from there I've installed nvm, Python (required for node install step) and node:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
apt-get update
apt-get install python 3.6
nvm install v8.11.1 (matching version on my dev machine)
npm install -g markdown-folder-to-html (npm package I previously found I had to install globally)
apt-get install zip (just used for a build step to zip up artifacts)
If I now run (via the bash shell) npm -version I get back 5.6.
If I try to get a build to run that uses npm in a command line step, then I get this error in the build log:
/opt/buildagent/temp/agentTmp/custom_script2764770419520852926: npm: not found
I wondered if it was an issue with the user/path that the team city agent process is using vs. the one I'm using in Bash, so I added the following to the build script:
echo PATH = $PATH
echo user var = $USER
echo user via 'id':
id -u -n
the output of which is:
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
user var =
user via id:
root
So it's running the agent as root, and doesn't appear to have node in the $PATH at all.
If I run the above directly from Bash however, I can see that I am root, but my $PATH is different:
PATH = /root/.nvm/versions/node/v8.11.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root
So I'm now confused: I've re-started the container and this has had no effect - it seems that when I'm logged in as root manually I have a certain path set, but when the build agent service is running as root it's different.
I have no idea why this happens, but I've basically worked around the problem by adding:
export PATH=$PATH:/root/.nvm/versions/node/v8.11.1/bin
to the top of every build step that uses npm in a script. To my mind this seems a rather daft thing to have to do - considering this used to work without this, and the only real difference is possibly a slightly different flavour of linux container. AFAIK the original build agent container was based on the jetbrains minimal-build-agent one, so unless they've changed what they base that on it should be roughly the same...
I also had to change the compressor being used in a node-minify build step from gcc (google closure compiler) to babel-minify as the former was basically hanging indefinitely, but that is a separate problem (though also something that was fine and now isn't...)
Thanks to anyone who took the time to read... though I do wonder if one-day I'll exhaust my own research options, and finally go ask the internet and actually get someone respond - for some reason whenever I get to the point where I have to ask, it always seems no-one else has the answer either and I end up having to work it out myself. It's probably character-building though I suppose.. (this isn't just SO - I've found this be the case for over 15 years on various forums about various things...)

Running Unity CLI on Headless Linux to build open source project - license issue

How can I run Unity CLI on Linux to build my project without getting the dreaded "Failed to activate/update license" error. Why do I need a license to do a build from the command line? This works fine for Unity CLI on macOS and Windows.
Launching Unity from the UI and signing in once is not an option as I am trying to do this on Travis CI.
Here's my .travis.yml file and related install + build scripts and here's the failing build
The doc Command line arguments mentions serial, username and password. But they seem not in your build scripts.
Also try the lastest build of Unity3D for linux.
There is a fix in the lastest release (5.6.0b10):
Fix "Manage License" UI regression
UPDATE
Just found a post about your problem. Hope it helps.
1) Network issue - Some education users will have internal network and lack of internet access (can you verify if you can ping to https://core.cloud.unity3d.com/api/login on command line?).
2) To verify if it is a CACerts.pem issue, can you follow this code:
https://github.com/justin-zheng/travisbuildtest
CACerts.pem is included in the repository
Add the CACerts.pem to the Unity license folder (in the user's .local directory: ~/.local/share/unity3d/Certificates/)
You can create and use a license file following next steps.
Create license file:
/opt/unity-editor-2018.3.0f2/Editor/Unity -batchmode -createManualActivationFile -logfile -nographics
Go to https://license.unity3d.com/manual and upload ulf generated file
Use downloaded ulf file:
/opt/unity-editor-2018.3.0f2/Editor/Unity -batchmode -manualLicenseFile Unity_v2018.x.ulf -logfile -nographics
That's all

Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine

I'm new to Play framework. Please explain the meaning of the below warning.
Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using node.js
I don't want anything that slow down my application so please advice if I should change the JS Engine to Node.js, but my PlayFramework project is using Java on the server side.
You need to install Node.js and then tell the sbt/java engine to use it.
brew install node
Edit .bash_profile and add:
export SBT_OPTS="${SBT_OPTS} -Dsbt.jse.engineType=Node -Dsbt.jse.command=$(which node)"
This eliminated the warning for me on OSX
In Windows:
Install node.js
Go to Control Panel - System and Security - System - Advanced system settings
Click Environment Variables...
Search in System variables for SBT_OPTS
If such exists, click Edit... and concatenate -Dsbt.jse.engineType=Node to Variable value
If such does NOT exist, click New... and write SBT_OPTS to Variable name and -Dsbt.jse.engineType=Node to Variable value
Click OK - OK - OK
Restart any command prompt (cmd, PowerShell) that is currently running Play Framework
in ubuntu
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
then add as above to your .profile in your home directory
export SBT_OPTS="${SBT_OPTS} -Dsbt.jse.engineType=Node -Dsbt.jse.command=$(which node)"
then
. ./.profile
to reload your .profile
For a more flexible install using node version manager check the following tutorial:
how to install node js on an ubuntu 14.04 server
Build again and the warning about using the Trireme stuff should be gone.
As an alternative to setting the environment variable, you can add this line to your build.sbt file:
JsEngineKeys.engineType := JsEngineKeys.EngineType.Node
See: https://github.com/sbt/sbt-js-engine
sbt plugins requiring a JS engine are used only in the build process, and so missing Node.js only slows down assets building stages if you use any.
The built application is not affected.
Anyway, you may want to install node.js to your PATH, where it should be auto-detected.
in Windows 10:
Install node.js from https://nodejs.org/en/
(The installer automatically adds node.js to your PATH)
then add:
export SBT_OPTS="$SBT_OPTS -Dsbt.jse.engineType=Node"
to your plugins.sbt in
. ./project/plugins.sbt
Worked for me - the warning has disappeared!
EDIT:
Apparently plugins.sbt was the wrong place to add the
export SBT_OPTS="$SBT_OPTS -Dsbt.jse.engineType=Node"
...although the warning disappeared when loading my app, it led to an error when relaunching the app a couple of hours later:
error: not found: value export
I would be glad if anyone could help and tell me where to put the export.

Resources