依賴庫Go 1.6
NodeJS v4+
sqlite3
GO 環境搭建
vi /etc/profile export GOPATH="/root/go" export GOROOT="/usr/local/go" export PATH=$GOROOT/bin:$PATH export PATH=$GOPATH/bin:$PATH
NodeJS 環境搭建
從https://nodejs.org/en/下載node源碼包
cd /usr/local tar -zxvf node-v4.5.0-linux-x64.tar chmod -R 755 node vi /etc/profileexport NODE=/usr/local/node export PATH=${NODE}/bin:$PATH
編譯安裝前准備
創建$GOPATH/src/github.com/grafana/grafana目錄,然后git最新的代碼到此目錄.
mkdir $GOPATH/src/github.com/grafana/grafana
編譯后端源碼步驟
cd $GOPATH/src/github.com/grafana/grafana go run build.go setup go run build.go build
編譯前端源碼步驟
cd $GOPATH/src/github.com/grafana/grafana npm install --registry=http://registry.npm.taobao.org npm install -g grunt-cli --registry=http://registry.npm.taobao.org grunt
運行
./bin/grafana-server
打開瀏覽器 (默認http://localhost:3000 匿名方式登錄<部分功能存在權限限制>)
打開登陸頁面 (默認http://localhost:3000/login 用戶名/密碼 = admin/admin 功能沒有權限限制).
配置
啟動項配置
在/etc/grafana/目錄:
grafana.ini dev.ini (if found) custom.ini
基本權限配置
在/usr/share/grafana/conf
defaults.ini 2.sample.ini
程序發布各平台安裝包
發布安裝包依賴FPM工具.
####安裝GEM
sudo apt-get install ruby sudo apt-get install ruby-dev
####安裝FPM
gem install fpm
編譯發布
發布后的安裝包(.tar .deb .rpm文件)都存在在$GOPATH/src/github.com/grafana/grafana/dist目錄下面, 部分臨時文件都存在在/tmp目錄下面
go run build.go build package
對於開源項目Grafana,我已經對其完成漢化工作,如下:
https://github.com/plusplusxu/grafana