Geode/Gemfire Study Notes (1) Environment Construction, Quick Start

Geode/Gemfire is an open source, distributed NoSql in-memory database developed by Pivotal, which can be used to perform functions such as distributed caching, data persistence, distributed transactions, and dynamic expansion.

Its advantages and features:

  • Performance scaling, linear scaling, low latency for transactions and reads and writes

  • Consistent database operations through globally distributed applications

  • High availability and scalability, global scale

  • Powerful developer features

  • Simple distributed node management

  • Dynamic Replication and Partitioning Technology
  • Persistence with fast parallel recovery
  • Fast memory storage, optimized large heap memory, data compression, disk overflow recovery and data timeout mechanism
  • Distributed Location Awareness
  • Distributed Transaction ACID
  • Supports SQL-like and indexes
  • The server can notify the client of data events, respond to the client synchronously or asynchronously, and ensure the order of events
  • Highly scalable and robust cluster technology, failure detection, network partition detection

As one of the largest real-time trading systems in the world, 12306 uses #GemFire#

 

github source code download address: https://github.com/apache/incubator-geode

Geode documentation address: http://geode-docs.cfapps.io/

 

Geode is the open-source version of Gemfire, the commercial version originally used in Wall Street's financial sector where real-time data processing is critical.

 

Installation and debugging:

1. Required environment: jdk1.8

2. Compile:

1) If Geode is used, it needs to be compiled before it can be used.

Since gradle is used to compile, the client needs to install the gradle compilation environment. Gradle needs to download a large number of dependency packages for compilation, so this step must be over the * wall to download. It is recommended to use the latest version of the free *free*men, which is very easy to use.

I used XX-net at first, although I can get over the **wall, but I always get an error when downloading the dependency package. Maybe the proxy has some restrictions. I changed it to *free*men and everything went smoothly.

2) If you use the compiled version of GemFire, you don't need to worry about the above troubles, you can use it directly.

 

3. Building a distributed environment

At least two machines, and at the same time ensure that the two machines use the same version, either Geode or Gemfire, otherwise the server cannot be started.

Add environment variable GEODE_HOME=F:\dev\BigData\incubator-geode-develop\gemfire-assembly\build\install\apache-geode

Add in Path: %GEODE_HOME%\bin;

The compiled files are placed in the F:\dev\BigData\incubator-geode-develop\gemfire-assembly\build\install directory.

For the construction process, please refer to the How to Command and Quick Start Tutorial.

4. Concept introduction

Command line shell tool for gfsh geode, used to execute the following commands

The locator locator, equivalent to the master in master-slave, or zookeeper, is mainly used to manage the cluster and link different servers.

  gfsh> start locator --name=locator1

The server server can be deployed on the same machine or on different machines. When starting on a different machine, you need to connect the started locator with connect first

  connect --locator=ip[locator的port]

  start server --name=server1

region The data region, or table, is the basic unit of data storage. The following creates a region that is automatically replicated and persisted in the cluster and persists the data

  create region --name=regionA --type=REPLICATE_PERSISTENT

  put --region=regionA --key="1" --value="one"

OQL SQL-like script to look up numbers

  query --query="select * from /regionA"

The execution of the above commands is based on the cluster by default. If you want to execute it on a single machine, you need to modify the properties in the apache-geode\config\gemfire.properties file: enable-cluster-configuration=true, change it to false.

5. Quick start tutorial:

http://geode-docs.cfapps.io/docs/getting_started/15_minute_quickstart_gfsh.html

 

In the next article, I will explain how applications use Geode for caching.

For the study of Geode, the ultimate goal is to read the source code and see how Geode implements such a powerful distributed database.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326349559&siteId=291194637