greenplum4单机单节点本地安装Installing a Single-Node Greenplum Database Instance

Installing a Single-Node Greenplum Database Instance

一.Add the Greenplum Database Administrative User Account.You cannot run the Greenplum Database server as root.
For a production system, Pivotal recommends that you:
• designate a user account that will own the Greenplum Database installation
• always start and administer Greenplum Database as this user

  linu系统为Greenplum增加一个管理用户,因为你不能用root用户运行Greenplum服务.

  为了简单,用当前linu用户安装Greenplum.

 二.Install the Greenplum Database Software

1.Download or copy the Greenplum Database installer file to the system on which
you want to install Greenplum Database. Installer files are available at
http://www.gopivotal.com/products/pivotal-greenplum-database.

下载并复制Greenplum数据库安装文件到你想要安装的目录.安装文件可以从...此网站下载.
2.Unzip the installer file. For example:
# unzip greenplum-db-4.2.x.x-PLATFORM.zip

解压安装文件,例如:


3.As the root user, run the installer using bash. For example:
# /bin/bash greenplum-db-4.2.x.x-PLATFORM.bin

 我是在当前用户下执行./greenplum-db-4.2.x.x-PLATFORM.bin 执行安装的,如果没权限,请增加执行权限,如

chmod +x greenplum-db-4.2.x.x-PLATFORM.bin.


4.The installer prompts you to accept the Greenplum Database license agreement.
Type yes to accept the license agreement.

  安装程序提醒你接受Greenplum数据库授权协议.输入yes 接受授权协议.


5.The installer prompts you to provide an installation path. Press ENTER to accept
the default install path (/usr/local/greenplum-db-4.2.x.x), or enter an
absolute path to an installation location. You must have write permissions to the
location you specify.

 安装程序提示你提供安装路径.按回车键表示接受默认路径.或者输入一个绝对路径让其安装在此.

当前用户必须拥有此路径的写权限.我的安装路径为:/home/doctor/greenplum4. 用当前用户doctor安装,肯定有写权限了.
6.The installer installs the Greenplum Database software and creates a
greenplum-db symbolic link one directory level above your version-specific
Greenplum Database installation directory. The symbolic link is used to facilitate
patch maintenance and upgrades between versions. The installed location is
referred to as $GPHOME.

 安装程序安装完 Greenplum 数据库后,还会创建一个名为greenplum-db的符号连接,他连接到你实际安装的数据库目录.这个符号连接主要为了数据库的维护和升级.安装路径的环境变量为$GPHOME.

[doctor@localhost greenplum4]$ echo $GPHOME
/home/doctor/greenplum-db/.
[doctor@localhost greenplum4]$ 

7.Change the ownership of your Greenplum Database installation so greenplum-dbthat it is owned
by the gpadmin user or group. For example, run the following commands as
root:
# chown -R gpadmin /usr/local/greenplum-db-4.2.x.x
# chgrp -R gpadmin /usr/local/greenplum-db-4.2.x.x

这个我就不用执行了.当前用户.

三.Prepare the Data Directory Locations

  到此数据库安装成功了.现在准备数据字典的目录吧.
Each Greenplum Database master and segment has a designated storage area on disk
that is called the data directory location. This is the file system location where the
database data is stored. In a single-node Greenplum Database, you initialize a
Greenplum Database master instance and two or more segment instances on the same
system, each requiring a data directory location. These directories should have
sufficient disk space for your data and be owned by the gpadmin user.
Remember that the data directories of the segment instances are where the user data
resides, so they must have enough disk space to accommodate your expected data
capacity. For the master instance, only system catalog tables and system metadata are
stored in the master data directory.


To create the data directory locations:
1.
 Create or choose a directory that will serve as your master data storage area. For
example, run the following commands as root :
# mkdir /gpmaster
# chown gpadmin /gpmaster
# chgrp gpadmin /gpmaster
2.
 Create or choose the directories that will serve as your segment storage areas. For
this two-segment, single-node example system, run the following commands as
root:
$ mkdir /gpdata1
$ chown gpadmin /gpdata1
$ chgrp gpadmin /gpdata1
$ mkdir /gpdata2
$ chown gpadmin /gpdata2
$ chgrp gpadmin /gpdata2


Configure Greenplum Database Environment Variables
A greenplum_path.sh file is provided in your $GPHOME directory with environment
variable settings for Greenplum Database. You can source this in the gpadmin user’s
startup shell profile (such as .bashrc), or in /etc/profile if you want to set the
environment variables for all users.
For example, you could add a line similar to the following to your chosen profile files:
source /usr/local/greenplum-db/greenplum_path.sh
After editing the chosen profile file, source it as the correct user to make the changes
active. For example:
$ source ~/.bashrc
or
$ source /etc/profile


Note: The .bashrc file should not produce any output. If you wish to have a message
display to users upon logging in, use the .profile file.


Initialize Greenplum Database
The Greenplum gpinitsystem utility initializes the Greenplum Database system. For
a single-node Greenplum Database system, you are initializing a master and two (or
more) segment instances on the same system.
After the Greenplum Database system is initialized and started, you can then create
and manage databases by connecting to the Greenplum master database process.
To initialize Greenplum Database:
1.
 Log in to the system as the gpadmin user:
su - gpadmin
2.
 Copy the hostlist_singlenode and gpinitsystem_singlenode example
files from your Greenplum Database installation to the current directory:
cp $GPHOME/docs/cli_help/gpconfigs/*_singlenode .
3.
 Make the hostlist_singlenode and gpinitsystem_singlenode files
writable so that you can edit them:
chmod +w *_singlenode
4.
 Edit the gpinitsystem_singlenode file and enter your configuration settings.
There are informative comments within the file to help you make your changes.
At minimum, you must set the MASTER_HOSTNAME parameter to the name of your
system, or 127.0.0.1.
5.
6.
7.
Here is an example of the default parameters in this file:
ARRAY_NAME="GPDB SINGLENODE"
MACHINE_LIST_FILE=./hostlist_singlenode
SEG_PREFIX=gpsne
PORT_BASE=40000
declare -a DATA_DIRECTORY=(/gpdata1 /gpdata2)
MASTER_HOSTNAME=127.0.0.1
MASTER_DIRECTORY=/gpmaster
MASTER_PORT=5432
Edit the hostlist_singlenode file and replace the first line with the name of
your system or 127.0.0.1.
Run the gpssh-exkeys utility to exchange ssh keys for the local host:
$ gpssh-exkeys -h 127.0.0.1
Run the following command to initialize Greenplum Database:
$ gpinitsystem -c gpinitsystem_singlenode


The utility verifies your setup information and makes sure that the data directories
specified in the gpinitsystem_singlenode configuration file are accessible. If
all of the verification checks are successful, the utility prompts you to confirm
your Greenplum Database configuration before creating the system. For example:
=> Continue with Greenplum creation? y
8.
The utility begins setup and the initialization of the master instance and each
segment instance in the system. This process can take several minutes (depending
on the number of segments to initialize).
At the end of a successful setup, the utility starts your Greenplum Database
system. You should see:
=> Greenplum Database instance successfully created.
Note: For a single-node Greenplum Database instance, you can disregard the
warning messages about the use of ‘127.0.0.1’ or ‘localhost’. These warnings only
apply to a multi-node Greenplum Database system.
Set the MASTER_DATA_DIRECTORY Environment Variable
The Greenplum Database management utilities require that you set the
MASTER_DATA_DIRECTORY environment variable. This variable points to the directory
created by the gpinitsystem utility in the master data directory location.
For example, add a line similar to the following to the gpadmin user’s profile file
(such as .bashrc):
MASTER_DATA_DIRECTORY=/gpmaster/gpsne-1
export MASTER_DATA_DIRECTORY
After editing the chosen profile file, source it as the correct user to make the changes
active. For example:
$ source ~/.bashrc

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值