准备环境
- Ubuntu 16.04 LTS
- Apache Geode 1.8
配置Java环境变量
JAVA_HOME=/opt/jdk1.8.0_144
export JAVA_HOME
下载源码并解压
1.官网地址:http://geode.apache.org/releases/
2.下载相关信息
构建源码
rain@ubuntu:/opt/apache-geode-1.8.0-src$ ./gradlew build -Dskip.tests=true
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 111M 100 111M 0 0 667k 0 0:02:50 0:02:50 --:--:-- 714k
~/.gradle/wrapper/dists/gradle-4.10.1-all/45fb98074adbe6353572feba33bdcc85 /opt/apache-geode-1.8.0-src
/opt/apache-geode-1.8.0-src
Welcome to Gradle 4.10.1!
Here are the highlights of this release:
- Incremental Java compilation by default
- Periodic Gradle caches cleanup
- Gradle Kotlin DSL 1.0-RC6
- Nested included builds
- SNAPSHOT plugin versions in the `plugins {}` block
For more details see https://docs.gradle.org/4.10.1/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
BUILD SUCCESSFUL in 6h 48m 9s
368 actionable tasks: 110 executed, 258 up-to-date
提醒:如果构建失败,可以尝试构建多次,因为有些依赖包可能没有完全下载。
验证源码构建
rain@ubuntu:/opt/apache-geode-1.8.0-src$ cd geode-assembly/build/install/apache-geode
rain@ubuntu:/opt/apache-geode-1.8.0-src/geode-assembly/build/install/apache-geode$ bin/gfsh version
1.8.0
## 打印更多构建信息
rain@ubuntu:/opt/apache-geode-1.8.0-src/geode-assembly/build/install/apache-geode$ bin/gfsh version --full
Build-Date: 2018-12-14 16:46:07 +0800
Build-Id: root 0
Build-Java-Version: 1.8.0_144
Build-Platform: Linux 4.4.0-31-generic amd64
Product-Name: Apache Geode
Product-Version: 1.8.0
Source-Date: 2018-11-21 12:12:35 -0800
Source-Repository: release/1.8.0
Source-Revision: 671671b5e81acde2684df3331aedf176cc927e6e
Native version: native code unavailable
Running on: /192.168.108.132, 1 cpu(s), amd64 Linux 4.4.0-31-generic
GEODE使用配置
## 创建geode运行目录
root@ubuntu:/opt# mkdir apache-geode-1.8.0
## 复制源码构建的程序和脚本到新创建的geode运行目录
root@ubuntu:/opt# cp -R /opt/apache-geode-1.8.0-src/geode-assembly/build/install/apache-geode/* /opt/apache-geode-1.8.0/
## 编辑/etc/profile,配置环境变量
root@ubuntu:/opt# vim /etc/profile
## 添加GEODE_HOME环境
export GEODE_HOME=/opt/apache-geode-1.8.0
export PATH=$GEODE_HOME/bin:$PATH
root@ubuntu:/opt# source /etc/profile
rain@ubuntu:/opt$ gfsh version
1.8.0
参照官网:
http://geode.apache.org/docs/guide/18/getting_started/installation/install_standalone.html