29
Practice http://weibo.com/viadea 2011.07.24 商商商商商商商商 商商商 ITPUB ChinaUnix IXPUB 商商

Greenplum管理实践

Embed Size (px)

DESCRIPTION

Greenplum管理实践

Citation preview

Page 1: Greenplum管理实践

Practice

http://weibo.com/viadea

2011.07.24

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 2: Greenplum管理实践

All of these are my own opinion, not for any

company.

Feel free to correct me if I am wrong.

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 3: Greenplum管理实践

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 4: Greenplum管理实践

Architecture – share nothing(MPP)

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 5: Greenplum管理实践

Query Worker Processes

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 6: Greenplum管理实践

Resource Queue

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 7: Greenplum管理实践

Data Mirror

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 8: Greenplum管理实践

Master Mirror

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 9: Greenplum管理实践

Parallel Backup

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 10: Greenplum管理实践

Non-Parallel Restore

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 11: Greenplum管理实践

Non-Parallel Restore

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 12: Greenplum管理实践

Q&A

• Before going further, here comes Q&A

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 13: Greenplum管理实践

1.Managing Roles and Privileges

• Role=User+Group

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 14: Greenplum管理实践

2. Configuring Client Authentication

• pg_hba.conf

local all gpadmin trust

host all gpadmin 127.0.0.1/32 password

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 15: Greenplum管理实践

3. Managing Workload and Resources

• Resource queue

CREATE RESOURCE QUEUE executive WITH (ACTIVE_STATEMENTS=3, PRIORITY=MAX);

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 16: Greenplum管理实践

4. Defining Database Objects

• Multi-level Partition DesignCheck constraint

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 17: Greenplum管理实践

5. Managing Data

• Vacuuming the Database

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 18: Greenplum管理实践

6. Loading and Unloading Data

• gploadYAML file

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 19: Greenplum管理实践

7. High Availability

• Segment failuregprecoverseg

• Master failuregpactivatestandby

• Standby master out of syncgpinitstandby

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 20: Greenplum管理实践

8. Backup and restore

• gp_dump and gp_restore• pg_dump

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 21: Greenplum管理实践

9. Expanding a Greenplum System

• gpexpand• To interactively create an expansion input file:• gpexpand -f hosts_file• To initialize segments and create expansion schema:• gpexpand -i input_file -D database_name• To redistribute tables:• gpexpand -d duration• To remove the expansion schema:• gpexpand -c

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 22: Greenplum管理实践

Q&A

• Before going further and further, here comes Q&A

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 23: Greenplum管理实践

Troubleshooting(1)

• SIGSEGVsgp_reraise_signal

If enabled, will attempt to dump core if a fatal server error occurs.

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 24: Greenplum管理实践

Troubleshooting(2)

• Out of memorygp_vmem_protect_limit

Sets the amount of memory (in number of MBs) that all postgres processes of a segment instance can consume.

Work_mem

Specifies the amount of memory to be used by internal sort operations and hash tables before switching to temporary disk files.

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 25: Greenplum管理实践

Troubleshooting(3)

• Hung querypg_locks

pg_stat_activity

pstack

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 26: Greenplum管理实践

Troubleshooting(4)

• Orphan processIn version 4.1:

pg_locks. gp_segment_id

The Greenplum segment id (dbid) where the lock is held.

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 27: Greenplum管理实践

Troubleshooting(5)

• Catalog problempg_stat_operations

The view pg_stat_operations shows details about the last operation performed on a database object (such as a table, index, view or database) or a global object (such as a role).

$GPHOME/bin/lib/gpcheckcat

Check the system catalog tables for inconsistencies.

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 28: Greenplum管理实践

Q&A

• Before going further and further and further, here comes Q&A

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办

Page 29: Greenplum管理实践

Let’s stop here for now

商业智能研讨沙龙-上海站 ITPUB ChinaUnix IXPUB 主办