Deploying the Grafana development environment under Windows

Source: Internet
Author: User
Tags install node grafana
This is a creation in Article, where the information may have evolved or changed.

Grafana requires the following environments for normal development:

    • node. js
    • Go

Install node. js

Download the latest version of the MSI installation package from the node. JS website based on your development environment

Follow the steps to complete the installation, basically no pits, skip.

Installing the Golang development environment

Download the installation package from Golang official website

Next, using the default installation, the installation will automatically create a new environment variable named Goroot in the system environment variable.
The value of this variable is the same as the installation path of your go.

The go code must be in the working space. A workspace is a directory that contains three subdirectories:

    • srcInside each subdirectory, is a package. Baone is the go source file
    • pkgThe target file of the package that is generated after compilation
    • binThe resulting executable file.

After installation we need to manually add an environment variable named Gopath, which is the path to the workspace.
You can create a new folder as a workspace for go, for example, I've created a new D:\code\go folder as a working space.


Then add the Bin folder under the Go workspace to the system environment variable


Enter in CMD or PowerShell $ go version and a similar prompt should appear if the installation succeeds.


The Go compilation environment is now installed

Installing GCC

GCC is required for go compiling Grafana
Installing GCC under windows, we recommend using the Win-builds tool


Run after the download is complete, wait for the following window to appear


Here choose native Windows and x86_64, and then select or create a new one 空文件夹 as the installation directory, I have a random one here D:\wingw-w64 .



Directly click on the upper right corner of process to start the installation. (This will install some additional tools that can be removed as needed)

After installation, create a new entry in the path of the system variable, with the value of the installation directory you selected in the Win-buildsbin
For example I have just installed D:\wingw-w64 under, then the system variable path should beD:\wingw-w64\bin


Enter in CMD or PowerShell $ gcc -v and a similar prompt should appear if the installation succeeds.


Now that GCC is installed, the configuration is complete

Configure Grafana

    1. Run the following command directly in CMD or PowerShell (you will need to install git if you do not have Git installed, please Baidu yourself)
      $ go get github.com/grafana/grafana
      A similar prompt appears for Get success


    2. Next, create the following directory in your Go workspacesrc/golang.org/x/
      For example, mine is.D:\code\go\src\golang.org\x
      And then run$ git clone git@github.com:golang/sync.git --depth 1
      Wait for git clone to complete

    3. Run again $ go get github.com/Unknwon/bra , (this package does not prompt, after the command is completed to the corresponding directory to confirm the file)
      Enter the bra directory ($GOPATH \src\github.com\unknwon\bra) and run the following command to compile the bra
      $ go run bra.go run

    4. Go to the Grafana directory and run the following command in turn

Build back-end

$ go run build.go setup$ go run build.go build

Build Front End

$ npm install -g yarn$ yarn install --pure-lockfile$ npm run build

Start Grafana
$ bra run

Open http://localhost:3000 , with 用户名/密码 = admin/admin login
If Grafana is working properly, the basic development environment has been built.

Grafana Development Documentation Reference

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.