安装golang
centos7 直接安装golang
yum install golang
centos6需添加软件源,然后再安装
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
yum install golang
安装依赖包
yum groupinstall 'Development tools'
yum install glibc-static sqlite-devel.x86_64 libselinux-static libsepol-static
yum install libuuid-devel libattr-devel zlib-devel libacl-devel e2fsprogs-devel libblkid-devel lzo-devel asciidoc xmlto
编译device mapper
git clone --no-checkout https://git.fedorahosted.org/git/lvm2.git /usr/local/lvm2 && cd /usr/local/lvm2 && git checkout -q v2_02_103
#如果下载超时,使用https://github.com/steven676/lvm2.git代替,或直接从https://git.fedorahosted.org/cgit/lvm2.git/refs/tags下载
cd /usr/local/lvm2 && ./configure --enable-static_link && make && make install
此处要注意别用./configure --enable-static_link && make device-mapper && make install_device-mapper只编译device mapper,这样有可能
因为lvm与device mapper不匹配,而导致lvm无法运行,在物理机下次重启时,所有lvm文件系统都不可用,只能重装操作系统了。
编译安装sqlite
wget http://www.sqlite.org/2015/sqlite-autoconf-3080803.tar.gz
./configure
make
make install
安装btrfs-progs
centos7
yum install btrfs-progs
centos6
git clone git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
cd btrfs-progs
./autogen.sh
./configure
make
make install
export GOPATH&