Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Install Greenplum5.3

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Installation environment

Two server environment configurations: centos7 + is as follows

Installation, one master, one segment.

Master is used on a separate server.

Two Segment share a server. Different Segment uses different ports.

Master is the primary node and Segment is the data node.

Comparison between Master host and Segment host

2. Create a user as the operating system user who installs greenplum

The following actions on all nodes:

To configure hostname, both master and slave need to be configured.

Vim / etc/hosts

192.168.20.41 mdw

192.168.20.42 sdw1

Create new users and user groups, or delete them if they exist

[root@mdw setup] # groupadd-g 530 gpadmin

[root@mdw setup] # useradd-g 530-u 530-m-d / home/gpadmin-s / bin/bash gpadmin

Empower folders to create passwords for new users

[root@mdw setup] # chown-R gpadmin:gpadmin / home/gpadmin

[root@mdw setup] # passwd gpadmin

Changing password for user gpadmin.

New password: changeme

BAD PASSWORD: The password fails the dictionary check-it is based ona dictionary word

Retype new password: changeme

Passwd: all authentication tokens updated successfully.

Change the permissions of the next few directories first. (all nodes operate)

Individual directories do not have permission to create because you are using the gpadmin user operation.

[root@mdw usr] # chown gpadmin:gpadmin / usr/local

[root@mdw usr] # mkdir / data

[root@mdw usr] # chown gpadmin:gpadmin / data

3. Install GPDB

Actions on the Master node:

Download the GPDB installation package: version 5.3 zip package

Greenplum-db-5.3.0-rhel7-x86_64.zip

Https://download.csdn.net/download/feature_09/10501093

Unzip it to the current directory. It doesn't matter.

[root@gp01 setup] # unzip greenplum-db-5.3.0-rhel7-x86_64.zip

After decompression, as shown in the figure:

Execute bin file, install

[root@mdw setup] # su-gpadmin

[gpadmin@mdw setup] $. / greenplum-db-5.3.0-rhel7-x86_64.bin

If this occurs, press the space to continue.

Stop when you see whether or not to accept the agreement. Enter yes.

Then prompt the default installation path: enter, you will be prompted to ask whether to install to the default path, default, just yes.

The default installation path does not exist. Prompt whether to create it or enter yes.

When it's done, wait a little while, and then it's a hint that it's been successful.

In the installation directory, you can see that it already exists and the soft link is automatically created.

Set gpadmin user environment variables

Add source / usr/local/greenplum-db/greenplum_path.sh at the bottom

[gpadmin@mdw greenplum-db] $vim / home/gpadmin/.bash_profile

[gpadmin@mdw greenplum-db] $vim / home/gpadmin/.bashrc

Finally, remember to source two scripts, and under root, execute the following statement so that its root users can use the relevant commands.

[gpadmin@mdw greenplum-db] # source / usr/local/greenplum-db/greenplum_path.sh

Prepare the server node information file

Under the GPDB installation directory (/ usr/local/greenplum-db)

Create a hostlist file and add all server domain names

[gpadmin@mdw greenplum-db] $vim hostlist

Mdw

Sdw1

Create a segment file and add the domain name of the segment node

[gpadmin@mdw greenplum-db] $vim seg_hosts

Sdw1

Create trust between nodes

Use gpssh-exkeys to establish trust between servers.

[gpadmin@mdw greenplum-db] $gpssh-exkeys-f hostlist

There will be an operation to enter the password.

For slave nodes, install greenplum in bulk. Just carry out this order. There will be some pause in the middle. It will be all right in a moment.

[gpadmin@mdw greenplum-db] $gpseginstall-f hostlist-u gpadmin-p changeme

Check the installation

The environment variable for Greenplum is already in greenplum_path.sh under the installation directory. Source for a moment.

[gpadmin@mdw ~] $source / usr/local/greenplum-db/greenplum_path.sh

See if the installation directory on the node is consistent

[gpadmin@mdw] $gpssh-f / usr/local/greenplum-db/hostlist-e ls-l $GPHOME

Switch to gpadmin user

Create a data storage area

Execute on Master:

[gpadmin@mdw] $mkdir-p / data/master

[gpadmin@mdw] $gpssh-f / usr/local/greenplum-db/hostlist-e "mkdir-p / data/primary"

[gpadmin@mdw] $gpssh-f / usr/local/greenplum-db/hostlist-e "mkdir-p / data/mirror"

Among them

Master saves Master data

Primary saves home directory (primary) data of Segment

Mirror saves Segment's mirror directory (mirror) data

The home directory where the data is stored can be changed. If you change it to something else, many of the later paths need to be changed.

Configure the Greenplum initialization file

Copy the initialization configuration file that comes with greenplum

[gpadmin@mdw ~] $cp / usr/local/greenplum-db/docs/cli_help/gpconfigs/gpinitsystem_config / home/gpadmin/

[gpadmin@mdw gpconfig] $chmod 775 / home/gpadmin/gpconfig/gpinitsystem_config

Edit initialization profile

[gpadmin@mdw gpconfig] $vim gpinitsystem_config

Lines that need to be changed:

Declare-a DATA_DIRECTORY= (/ data/primary)

MASTER_HOSTNAME=mdw

MASTER_DIRECTORY=/data/master

Declare-a MIRROR_DATA_DIRECTORY= (/ data/mirror)

ENCODING=UTF-8

MACHINE_LIST_FILE=/home/gpadmin/allseghosts

Run the initialization tool

[gpadmin@mdw] $gpinitsystem-c / home/gpadmin/gpinitsystem_config-h / usr/local/greenplum-db/seg_hosts

-c: specify the initialization file.

-h: specify the segment host file.

-s: specify the standby host and create the standby node. (no, so there is no configuration of this parameter)

Test:

[gpadmin@mdw ~] $psql-l

Add connection method:

In the / data/master/gpseg-1 directory, edit pg_hba.conf

At the bottom, add

Host all all 0.0.0.0/0 trust

Then restart the GP database.

At this point, you can connect using JDBC.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report