记录Grafana7在ARM环境(鲲鹏)上编译

简单记录下,在华为云上按需买一台鲲鹏服务器。2C8G,最初买了2C4G,编译过程遇到问题:
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of me
扩容下内存,最少要8G才能成功编译。
下载并安装node和go,如下url下载地址,版本要匹配。
https://npm.taobao.org/mirrors/node/v12.4.0/node-v12.4.0-linux-arm64.tar.gz
https://studygolang.com/dl/golang/go1.15.2.linux-arm64.tar.gz
在/etc/profile里配置环境变量。
export PATH=/usr/local/go/bin:/root/node-v12.4.0-linux-arm64/bin:$PATH:.
keyserver只有hkp://pgp.mit.edu这个可用。其他的都会报错gpgkeys: HTTP fetch error 6: Could not resolve host: keys.gnupg.net; Unknown error无法导入公钥。

# yum install gcc gcc-c++
# yum install bzip2
# yum -y install ruby rubygems ruby-devel
# gem sources -a http://gems.ruby-china.com/
# gem sources --remove http://rubygems.org/
# gpg --keyserver hkp://pgp.mit.edu --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
# curl -sSL https://get.rvm.io | bash -s stable
# source /usr/local/rvm/scripts/rvm
# rvm install 2.4.1
# rvm use 2.4.1 --default
# gem install fpm
# npm config rm proxy
# npm config rm https-proxy
# npm config set registry https://registry.npm.taobao.org
# npm config set disturl https://npm.taobao.org/dist
# npm install -g yarn
# yarn config set sass-binary-site http://npm.taobao.org/mirrors/node-sass
# yarn config set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD 1
# export GOPROXY=https://goproxy.io
# export GO111MODULE=on
# make
# go run build.go build package

编译过程巨漫长。

你可能感兴趣的:(记录Grafana7在ARM环境(鲲鹏)上编译)