1.前期准备

1.1安装jdk

1.2安装maven

  1. cd /export/software/
  2. tar -zxvf apache-maven-3.0.5-bin.tar.gz -C ../server/
  3. vim /etc/profile
  4. export MAVEN_HOME=/export/server/apache-maven-3.0.5
  5. export MAVEN_OPTS="-Xms4096m -Xmx4096m"
  6. export PATH=:$MAVEN_HOME/bin:$PATH
  7. source /etc/profile
  8. #本地路径可以不设置
  9. cd /export/server/apache-maven-3.0.5/conf
  10. vim settings.xml
  11. <mirror>
  12. <id>mirrorId</id>
  13. <mirrorOf>repositoryId</mirrorOf>
  14. <name>Human Readable Name for this Mirror.</name>
  15. <url>http://my.repository.com/repo/path</url>
  16. </mirror>
  17. <mirror>
  18. <id>alimaven</id>
  19. <name>aliyun maven</name>
  20. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  21. <mirrorOf>central</mirrorOf>
  22. </mirror>

1.3linux安装依赖

  1. yum -y install autoconf automake libtool cmake
  2. yum -y install ncurses-devel
  3. yum -y install openssl-devel
  4. yum -y install lzo-devel zlib-devel gcc gcc-c++
  5. yum -y install bzip2-devel

1.4安装protobuf

  1. cd /export/software
  2. tar -zxvf protobuf-2.5.0.tar.gz -C ../server/
  3. cd /export/server/protobuf-2.5.0
  4. ./configure
  5. make && make install

1.5安装snappy

  1. cd /export/software/
  2. tar -zxvf snappy-1.1.1.tar.gz -C ../server/
  3. cd ../server/snappy-1.1.1/
  4. ./configure
  5. make && make install
  6. 验证ll /usr/local/lib/ | grep snappy

1.6开始编译
解压文件后,进入文件执行mvn package -DskipTests -Pdist,native -Dtar -Drequire.snappy -e -X
image.png