部署應用於kong網關的簡單PostgreSQL集羣

##Postgres-XL is composed of three major components: the GTM (Global Transaction Manager), the Coordinator and the Datanode. Their features are given in the following sections.html

###GTM (Global Transaction Manager) ####The GTM is a key component of Postgres-XL to provide consistent transaction management and tuple visibility control. As described later in this manual, PostgreSQL's transaction management is based upon MVCC (Multi-Version Concurrency Control) technology. Postgres-XL extracts this technology into separate component such as the GTM so that any Postgres-XL component's transaction management is based upon single global status. Details will be described in Chapter 50.node

###Coordinator ####The Coordinator is an interface to the database for applications. It acts like a conventional PostgreSQL backend process, however the Coordinator does not store any actual data. The actual data is stored by the Datanodes as described below. The Coordinator receives SQL statements, gets Global Transaction Id and Global Snapshots as needed, determines which Datanodes are involved and asks them to execute (a part of) statement. When issuing statement to Datanodes, it is associated with GXID and Global Snapshot so that Multi-version Concurrency Control (MVCC) properties extend cluster-wide.sql

###Datanode ####The Datanode actually stores user data. Tables may be distributed among Datanodes, or replicated to all the Datanodes. The Datanode does not have a global view of the whole database, it just takes care of locally stored data. Incoming statements are examined by the Coordinator as described next, and subplans are made. These are then transferred to each Datanode involved together with a GXID and Global Snapshot as needed. The datanode may receive request from various Coordinators in separate sessions. However, because each transaction is identified uniquely and associated with a consistent (global) snapshot, each Datanode can properly execute in its transaction and snapshot context. ###本地起pgsql mac os 參考https://www.jianshu.com/p/10ced5145d39 ###設定方案 1 GTM 2 Datanode Coordinator和GTM裝在Datanode節點上 ##安裝步驟 默認在所有機器使用下列命令 ###先更改每臺機器的hosts vim /etc/hosts/ ###關閉防火牆以後 重啓機器 ufw disable/enable ###添加新的數據庫用戶數據庫

useradd pgsqlname
passwd pgspasswd

###將新建用戶添加sudo權限vim

su -
visudo

在最後加上一行保存退出 usrname ALL=(ALL) ALL 以後在/home路徑建立usrname文件夾,進入之後建立ssh免密鏈接,在GTM節點使用下列命令session

su - usrname
ssh-keygen -t rsa #選取路徑爲用戶名下.ssh文件夾 密碼設定爲空
http://www.ruanyifeng.com/blog/2013/12/getting_started_with_postgresql.html
相關文章
相關標籤/搜索