Ubuntu 18.04 安装greenplum

2023-03-17 00:00:00 创建 专区 订阅 付费 暂停

About Greenplum Database
Greenplum Database is an MPP SQL Database based on PostgreSQL. Its used in production in hundreds of large corporations and government agencies around the world and including the open source has over thousands of deployments globally. Greenplum Database scales to multi-petabyte data sizes with ease and allows a cluster of powerful servers to work together to provide a single SQL interface to the data. In addition to using SQL for analyzing structured data, Greenplum provides modules and extensions on top of the PostgreSQL abstractions for in database machine learning and AI, Geospatial analytics, Text Search (with Apache Solr) and Text Analytics with Python and Java, and the ability to create user-defined functions with Python, R, Java, Perl, C or C++.

Open Source Greenplum Database on Ubuntu Installation Instructions
First, ensure you have a supported Ubuntu OS version. At the time of this writing, Ubuntu builds of Greenplum are built for the 18.04 and 16.04 LTS (long-term support) release versions of Ubuntu. Check the PPA page, for current information about which versions are available. Add the Greenplum PPA repository to your Ubuntu System:

sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:greenplum/db

Update your Ubuntu system to retrieve information from the recently added repository:

sudo apt update
sudo apt install greenplum-db-6

The above command will install the Greenplum Database software and any required dependencies on the system automatically and put the resulting software in /opt directory as seen below:


Load Greenplum Database software into your environment with the following command. Note you should pick the exact path of the Greenplum software directory based on the version of Greenplum Database installed:

source /opt/greenplum-db-6.20.3/greenplum_path.sh
which gpssh
/opt/greenplum-db-6.20.3/bin/gpssh

You can see the software is on the path by testing using the which command as above. Now you can copy a Greenplum cluster configuration file template into your local directory for editing like this:

cp $GPHOME/docs/cli_help/gpconfigs/gpinitsystem_singlenode .

Edit gpinitsystem Configuration File

vim gpinitsystem_singlenode

The following edits can be made for the most simple cluster configuration running locally. Create this file and put only your hostname into the file:

touch hostlist_singlenode


MACHINE_LIST_FILE=./hostlist_singlenode

Update this line to an existing directory you want to use for primaries for example:
declare -a DATA_DIRECTORY=(/home/gpadmin/primary /home/gpadmin/primary)
The number of times the directory is repeated controls the number of segments.

Update this line to have the hostname of your machine, in my case, the hostname is ‘ubuntu’:
MASTER_HOSTNAME=ubuntu

Update the master data directory entry in the file and ensure it exists by making the directory:
MASTER_DIRECTORY=/home/gpadmin/master
That’s enough to get the database initialized and up running, so close the file and let’s initialize the cluster. We will have a master segment instance and two primary segment instances with this configuration. In more advanced setups you would configure a standby master and segment mirrors on additional hosts, and the data would be automatically both sharded (distributed) between the primary segments and mirrored from primaries to mirrors.

mkdir /home/gpadmin/master
sudo chmod 777 -R /home/gpadmin/master
mkdir home/gpadmin/primary
sudo chmod 777 -R home/gpadmin/primary

Run gpinitsystem
First, let’s make sure ssh keys are exchanged by running the following command. Screenshot from my system is shown below:

gpssh-exkeys -f hostlist_singlenode

Ok, we need to start the cluster, let’s get started. Run the following command:

gpinitsystem -c gpinitsystem_singlenode

至此安装成功可以创建数据库了


创建用户命令:create user ysr superuser password '123456';

修改密码命令:alter user pguser with password 'new password';

关于配置greenplum远程访问
https://gpdb.docs.pivotal.io/6-4/client_tool_guides/cfg_remote.html

关于greenplum创建分表
https://zhuanlan.zhihu.com/p/452483823

greenplum 建表语句等
https://gpdb.docs.pivotal.io/6-0/ref_guide/sql_commands/CREATE_TABLE.html#:~:text=To%20be%20able%20to%20create%20a%20table%2C%20you,Greenplum%20creates%20the%20table%20in%20the%20current%20schema.

启动和暂停greenplum
http://www.dbaref.com/greenplum/startingandstoppinggreenplum

需要注意的是气功暂停需要输入-d 参数,也就是master的路径,我们设置在
/home/gpadmin/master/gpsne-1
因此启动参数是

gpstart -d /home/gpadmin/master/gpsne-1


本文来源:https://blog.csdn.net/weixin_43632687/article/details/124420785

相关文章