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

LInux6 virtual machine installs GreenPlum

2025-01-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

I. Environmental preparation

1. Install the VMware software, and then install three Linux virtual machines in VMware (I am using redhat)

2. Set up the virtual machine

Hostnam

Ip

Memory

Hard disk

Mdw

192.168.10.20

500M

8G

Sdw1

192.168.10.21

500M

8G

Sdw2

192.168.10.22

500M

8G

3. Download the database installation file greenplum-db-4.2.2.4-build-1-CE-RHEL5-i386

II. Installation

Note: the label "three hosts" indicates that the operation should be done on all three computers, and the "master node" means that it can only be operated on mdw hosts.

1. Turn off the firewall (three hosts) (it can be turned off directly when learning, and the formal environment is through open ports)

# service iptables stop stops the firewall service. It will still be enabled after restarting the computer.

# chkconfig iptables off shuts down the firewall service and starts, which takes effect after restart

Two commands can be used in combination to avoid restarting

2. Modify the hosts file (three hosts)

Add or modify something in the hosts file (if the hostname cannot be changed, write several domain name examples: 192.168.10.200 mdw master)

192.168.10.20 mdw

192.168.10.21 sdw1

192.168.10.22 sdw2

After it is added, you can test whether it is correct through the ping command, such as: ping sdw1 test whether the sdw1 node can be accessed

3. Modify or add / etc/sysctl.conf (three hosts)

Xfs_mount_options = rw,noatime,inode64,allocsize=16m

Kernel.shmmax = 500000000

Kernel.shmmni = 4096

Kernel.shmall = 4000000000

Kernel.sem = 250 512000 2048

# if the performance of the machine is good: kernel.sem = 250 512000 20480

Kernel.sysrq = 1

Kernel.core_uses_pid = 1

Kernel.msgmnb = 65536

Kernel.msgmax = 65536

Kernel.msgmni = 2048

Net.ipv4.tcp_syncookies = 1

Net.ipv4.ip_forward = 0

Net.ipv4.conf.default.accept_source_route = 0

Net.ipv4.tcp_tw_recycle = 1

Net.ipv4.tcp_max_syn_backlog = 4096

Net.ipv4.conf.all.arp_filter = 1

Net.ipv4.ip_local_port_range = 1025 65535

Net.core.netdev_max_backlog = 10000

Vm.overcommit_memory = 2

4. Configure / etc/security/limits.conf file, add the following (three hosts)

* soft nofile 65536

* hard nofile 65536

* soft nproc 131072

* hard nproc 131072

5. Set the value of the read-ahead block to 16384 (three hosts)

# / sbin/blockdev-- getra / dev/sda view the read-ahead block. The default size is 256.

# / sbin/blockdev-- setra 16384 / dev/sda sets the read-ahead block

6. Set disk access Iram O scheduling policy (three hosts)

# echo deadline > / sys/block/sda/queue/scheduler (stored hard disk / sda)

7. Upload and extract the database installation file (master node)

# unzip greenplum-db-4.2.2.4-build-1-CE-RHEL5-i386.zip

8. Install the software (master node)

# / bin/bash greenplum-db-4.2.2.4-build-1-CE-RHEL5-i386.bin

The following will be displayed during installation, which can be directly used by default.

The directory files after installation are as follows:

9. Obtain environment parameters (master node)

# source / usr/local/greenplum-db/greenplum_path.sh

10. Create a file / home/gpadmin/all_hosts that contains all hostnames. The file content is: (three hosts)

Mdw

Sdw1

Sdw2

11. Run the gpseginstall tool (master node)

# gpseginstall-f / home/gpadmin/all_hosts-u gpadmin-p gpadmin

All_hosts is the file created in the previous step. During the installation process, you will be asked to enter the root passwords of three hosts. After completion, you will be prompted to succeed, as shown below:

12. Switch to gpadmin user authentication login without password (three hosts)

(1) switch users

$su-gpadmin

(2) obtain environment parameters (all nodes)

# source / usr/local/greenplum-db/greenplum_path.sh

(3) use the gpssh tool to test logging in to all hosts without a password, and the results are as follows:

$gpssh-f all_hosts-e ls-l $GPHOME

13. Configure environment variables (master node)

[gpadmin@bj-gp-node1 ~] $cd / home/gpadmin [gpadmin@bj-gp-node1 ~] $vi .bashrc

[gpadmin@bj-gp-node1 ~] $vi .bash _ profile

Both .bashrc and .bash _ profile end up adding the following two lines of source / usr/local/greenplum-db/greenplum_path.sh

Export MASTER_DATA_DIRECTORY=/data/master/gpseg-1

Then send the .bashrc file to sdw1 and sdw2 with the following command:

Scp .bashrc sdw1:~

Scp .bashrc sdw2:~

14. Create a storage area (master node)

First, mkfs formats the hard disk / dev/sda, then the mount to / data/ is finally configured to automatically mount vim / etc/fstab [this will not be detailed]

(1) create a Master data storage area

# mkdir-p / data/master

(2) change the ownership of the catalogue

# chown gpadmin:gpadmin / data/master

(3) create a file / home/gpadmin/segment_hosts containing all segment hostnames as follows:

Sdw1

Sdw2

(4) use the gpssh tool to create master data and mirror data directories on all segment hosts. If you do not set the image, you do not have to create a mirror directory (note that you should first install the hard disk in each segment format, then mount / data/ and then set up self-boot)

# gpssh-f seg_hosts-e 'mkdir-p / data/primary'

# gpssh-f seg_hosts-e 'mkdir-p / data/mirror'

# gpssh-f seg_hosts-e 'chown gpadmin / data/primary'

# gpssh-f seg_hosts-e 'chown gpadmin / data/mirror

15. Synchronize system time

(1) Edit / etc/ntp.conf on the Master host to set the following:

Server 127.127.1.0

(2) Edit / etc/ntp.conf on the Segment host

Server mdw

(3) on the Master host, synchronize the system clock through the NTP daemon

# gpssh-f all_hosts-v-e 'ntpd'

16. Verify operating system settings

# gpcheck-f all_hosts-m mdw

Pay attention to whether there is error information in the running result. If you dispose of the error message, re-execute the above command check until there is no error information. Error is shown below.

The message of success is as follows:

Create a Greenplum database configuration file

(1) Log in as gpadmin user

# su-gpadmin

(2) copy a gpinitsystem_config file from the template

$vi / home/gpadmin/gpinitsystem_config ($GPHOME/docs/cli_help/gpconfigs/gpinitsystem_config is a template)

$chmod 775 gpinitsystem_config

(3) set all necessary parameters

ARRAY_NAME= "EMC Greenplum DW"

SEG_PREFIX=gpseg

PORT_BASE=40000

Declare-a DATA_DIRECTORY= (/ data/primary)

MASTER_HOSTNAME=mdw

MASTER_DIRECTORY=/data/master

MASTER_PORT=5432

TRUSTED SHELL=ssh

CHECK_POINT_SEGMENT=8

ENCODING=UNICODE

(4) set optional parameters

MIRROR_PORT_BASE=50000

REPLICATION_PORT_BASE=41000

MIRROR_REPLICATION_PORT_BASE=51000

Declare-a MIRROR_DATA_DIRECTORY= (/ data/mirror)

Run the initialization tool to initialize the database

$gpinitsystem-c gpinitsystem_config-h seg_hosts

After success, the database starts with the following information:

19. Start and stop the database test whether it can be started and shut down normally, the command is as follows

$gpstart

$gpstop

20. Access the database

Psql-d postgres

Enter query statement

Select datname,datdba,encoding,datacl from pg_database

To create a dba user:

Postgres# create role source password 'source' createdb login

View user information:

Postgres# select rolename, oid from gp_roles

The display information is as follows

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: 259

*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

Internet Technology

Wechat

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

12
Report