1. 获取hcache源代码:
wget https://github.com/silenceshell/hcache/archive/master.zip
unzip master
2.安装go
hcache要求go的版本不得低于1.4.本次使用go1.7
wget https://dl.google.com/go/go1.7.6.linux-amd64.tar.gz
tar zxvf go1.7.6.linux-amd64.tar.gz
mv go /usr/local
vi ~/.bash_profile
添加如下语句:
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
而后执行: source ~/.bash_profile即可。
3. build
cd hcache_master
export GO_PATH = {hcache_master的路径}
go get github.com/tobert/pcstat
此时可能会报如下错误:
正克隆到 '/home/sys_test/hcache-master/src/github.com/tobert/pcstat'...
fatal: unable to access 'https://github.com/tobert/pcstat/': SSL connect error
package github.com/tobert/pcstat: exit status 128
需要设置:
git config --glob