Greenplum的软件包可以通过github下载。 Greenplum 安装目录分别都有什么内容,具体作用是什么?今天,我们将通过这篇文章来为大家注意解析。请大家注意,本文章中介绍的仅仅是软件安装目录的内容,并没有涉及到数据存储目录的内容,二者不能混为一谈。
软件包安装位置
Greenplum 6 在安装完成后,与大部分其他应用软件的位置一致,默认的安装位置为 /usr/local 下。
[gpadmin@gp1 local]$ ls -al
总用量 4
drwxr-xr-x. 14 root root 187 12月 17 11:24 .
drwxr-xr-x. 13 root root 155 9月 1 21:55 ..
drwxr-xr-x. 2 root root 160 12月 27 17:58 bin
drwxr-xr-x. 2 root root 6 4月 11 2018 etc
drwxr-xr-x. 2 root root 6 4月 11 2018 games
drwxr-xr-x 10 root root 272 9月 26 02:53 go
lrwxrwxrwx 1 root root 29 12月 17 11:24 greenplum-db -> /usr/local/greenplum-db-6.2.1
drwxr-xr-x 11 root root 187 12月 17 11:24 greenplum-db-6.2.1
drwxr-xr-x. 3 root root 20 12月 27 17:58 include
drwxr-xr-x. 3 root root 4096 12月 27 17:58 lib
drwxr-xr-x. 3 root root 19 9月 8 04:18 lib64
drwxr-xr-x. 2 root root 6 4月 11 2018 libexec
drwxr-xr-x. 2 root root 6 4月 11 2018 sbin
drwxr-xr-x. 9 root root 107 12月 27 17:58 share
drwxr-xr-x. 2 root root 6 4月 11 2018 src
[gpadmin@gp1 local]$ pwd
/usr/local
从上面的 shell 查询结果可以看到,有两个叫 Greenplum 的东西。[ greenplum-db-6.2.1 ] 是真正的代码目录,软件安装完后,所有与 Greenplum 相关的内容均存储在这个目录下,[ greenplum-db ] 这个则是一个软连接,指向上面目录。这里采用软连接的方式对于系统管理和升级都非常方便,同一大版本,基本可以通过更新软连接指向的方式升级;而采用统一软连接的名称也能避免一些维护程序的修改工作。
软件目录畅游
首先我们来看一下 Greenplum 软件安装目录下的内容都有哪些。
[gpadmin@gp1 greenplum-db]$ ls -al
总用量 160
drwxr-xr-x 11 root root 187 12月 17 11:24 .
drwxr-xr-x. 14 root root 187 12月 17 11:24 ..
drwxr-xr-x 7 root root 4096 12月 17 11:24 bin
drwxr-xr-x 3 root root 22 12月 17 11:24 docs
drwxr-xr-x 2 root root 60 12月 17 11:24 etc
drwxr-xr-x 3 root root 20 12月 17 11:24 ext
-rwxr-xr-x 1 root root 783 12月 17 11:24 greenplum_path.sh
drwxr-xr-x 4 root root 4096 12月 17 11:24 include
drwxr-xr-x 6 root root 4096 12月 17 11:24 lib
-rw-r--r-- 1 root root 135617 12月 13 02:57 open_source_license_pivotal_greenplum.txt
drwxr-xr-x 7 root root 93 12月 17 11:24 pxf
drwxr-xr-x 2 root root 4096 12月 17 11:24 sbin
drwxr-xr-x 5 root root 52 12月 17 11:24 share
bin目录
故名思义,这个目录下的文件基本都是 Greenplum 的可执行命令,与其他 Linux 软件的套路一样,如果想要使用 bin 下面的命令,bin 目录必须被添加到操作系统 PATH 变量,所不同的是,我们不需要手工处理该操作,当你在 source greenplum_path.sh 的时候,这些工作他已经帮你完成了。
gpadmin@gp1 greenplum-db]$ ls -al bin
总用量 122048
drwxr-xr-x 7 root root 4096 12月 17 11:24 .
drwxr-xr-x 11 root root 187 12月 17 11:24 ..
-rwxr-xr-x 1 root root 65125 12月 13 02:57 analyzedb
-rwxr-xr-x 1 root root 251160 12月 13 02:57 clusterdb
-rwxr-xr-x 1 root root 246904 12月 13 02:57 createdb
-rwxr-xr-x 1 root root 383616 12月 13 02:57 createlang
-rwxr-xr-x 1 root root 249536 12月 13 02:57 createuser
-rwxr-xr-x 1 root root 230096 12月 13 02:57 dropdb
-rwxr-xr-x 1 root root 383512 12月 13 02:57 droplang
-rwxr-xr-x 1 root root 229880 12月 13 02:57 dropuser
-rwxr-xr-x 1 root root 2188616 12月 13 02:57 ecpg
-rwxr-xr-x 1 root root 16204 12月 13 02:57 gpactivatestandby
-rwxr-xr-x 1 root root 493 12月 13 02:57 gpaddmirrors
-rwxr-xr-x 1 root root 166749 12月 13 02:57 gpcheckcat
drwxr-xr-x 2 root root 4096 12月 17 11:24 gpcheckcat_modules
-rwxr-xr-x 1 root root 2514288 12月 13 02:57 gpcheckcloud
-rwxr-xr-x 1 root root 27480 12月 13 02:57 gpcheckperf
-rwxr-xr-x 1 root root 6052 12月 13 02:57 gpcheckresgroupimpl
-rwxr-xr-x 1 root root 22604 12月 13 02:57 gpconfig
drwxr-xr-x 2 root root 4096 12月 17 11:24 gpconfig_modules
-rwxr-xr-x 1 root root 14497 12月 13 02:57 gpdeletesystem
-rwxr-xr-x 1 root root 109833 12月 13 02:57 gpexpand
-rwxr-xr-x 1 root root 435688 12月 13 02:57 gpfdist
-rwxr-xr-x 1 root root 32095 12月 13 02:57 gpinitstandby
-rwxr-xr-x 1 root root 81788 12月 13 02:57 gpinitsystem
-rwxr-xr-x 1 root root 6475584 12月 13 02:57 gpkafka
-rwxr-xr-x 1 root root 320 12月 13 02:57 gpload
-rwxr-xr-x 1 root root 202 12月 13 02:57 gpload.bat
-rwxr-xr-x 1 root root 107558 12月 13 02:57 gpload.py
-rwxr-xr-x 1 root root 82833 12月 13 02:57 gpload.pyc
-rwxr-xr-x 1 root root 20933 12月 13 02:57 gplogfilter
-rwxr-xr-x 1 root root 456216 12月 13 02:57 gpmapreduce
-rwxr-xr-x 1 root root 373232 12月 13 02:57 gpmmon
-rwxr-xr-x 1 root root 20400 12月 13 02:57 gpmovemirrors
-rwxr-xr-x 1 root root 1224 12月 13 02:57 gpperfmoncat.sh
-rwxr-xr-x 1 root root 7675 12月 13 02:57 gpperfmon_install
-rwxr-xr-x 1 root root 339 12月 13 02:57 gppkg
-rwxr-xr-x 1 root root 547 12月 13 02:57 gprecoverseg
-rwxr-xr-x 1 root root 1149 12月 13 02:57 gpreload
-rwxr-xr-x 1 root root 4144 12月 13 02:57 gpscp
-rwxr-xr-x 1 root root 9503 12月 13 02:57 gpsd
-rwxr-xr-x 1 root root 233960 12月 13 02:57 gpsmon
-rwxr-xr-x 1 root root 19323328 12月 13 02:57 gpss
-rwxr-xr-x 1 root root 16547104 12月 13 02:57 gpsscli
-rwxr-xr-x 1 root root 9173 12月 13 02:57 gpssh
-rwxr-xr-x 1 root root 32583 12月 13 02:57 gpssh-exkeys
drwxr-xr-x 2 root root 98 12月 17 11:24 gpssh_modules
-rwxr-xr-x 1 root root 35203 12月 13 02:57 gpstart
-rwxr-xr-x 1 root root 421 12月 13 02:57 gpstate
-rwxr-xr-x 1 root root 46654 12月 13 02:57 gpstop
-rwxr-xr-x 1 root root 2731 12月 13 02:57 gpsys1
-rwxr-xr-x 1 root root 490216 12月 13 02:57 initdb
drwxr-xr-x 3 root root 4096 12月 17 11:24 lib
-rwxr-xr-x 1 root root 15198 12月 13 02:57 minirepro
-rwxr-xr-x 1 root root 295288 12月 13 02:57 pg_basebackup
-rwxr-xr-x 1 root root 1658352 12月 13 02:57 pgbouncer
-rwxr-xr-x 1 root root 102544 12月 13 02:57 pg_config
-rwxr-xr-x 1 root root 122920 12月 13 02:57 pg_controldata
-rwxr-xr-x 1 root root 156128 12月 13 02:57 pg_ctl
-rwxr-xr-x 1 root root 1564928 12月 13 02:57 pg_dump
-rwxr-xr-x 1 root root 314808 12月 13 02:57 pg_dumpall
-rwxr-xr-x 1 root root 232336 12月 13 02:57 pg_isready
-rwxr-xr-x 1 root root 182928 12月 13 02:57 pg_receivexlog
-rwxr-xr-x 1 root root 193880 12月 13 02:57 pg_recvlogical
-rwxr-xr-x 1 root root 165248 12月 13 02:57 pg_resetxlog
-rwxr-xr-x 1 root root 723712 12月 13 02:57 pg_restore
-rwxr-xr-x 1 root root 454736 12月 13 02:57 pg_rewind
-rwxr-xr-x 1 root root 753768 12月 13 02:57 pg_upgrade
-rwxr-xr-x 1 root root 513592 12月 13 02:57 pg_xlogdump
-rwxr-xr-x 1 root root 63414200 12月 13 02:57 postgres
lrwxrwxrwx 1 root root 8 12月 17 11:24 postmaster -> postgres
-rwxr-xr-x 1 root root 1491912 12月 13 02:57 psql
-rwxr-xr-x 1 root root 250648 12月 13 02:57 reindexdb
drwxr-xr-x 2 root root 20 12月 17 11:24 stream
-rwxr-xr-x 1 root root 259960 12月 13 02:57 vacuumdb
[gpadmin@gp1 greenplum-db]$
以上列表具体软件的用途不详细展开了,可以移步官方文档或者部分参考 Greenplum 中文社区的开源GPDB 6中文文档(不包含企业级组件的使用,如gpkafka、gpss等,企业级组件建议购买官方服务或参考官方英文文档),这里简单提一下,从GPDB 5.x开始,已经陆续增加和删除了几个常用的组件,分别如下:
- 新增 gpkafka,用于对接 kafka 数据;
- 新增 gpbackup 工具用于数据备份,属于单独组件,不在默认安装包中;
- 新增 gpcopy 工具,用于集群数据复制和迁移;
- 删除 gpcheck 工具,该工具原来用于验证操作系统参数配置;
- 删除 gpfilespace 工具,该工具原来用于创建文件空间;
- 删除 gp_dump 和 gpcrondump,该工具原来用于备份GP集群,目前已经被 gpbackup 替代;
介绍完rpm 安装完后的目录及目录下的 bin 子目录。我们再来介绍剩下的其他目录的作用。
首先还是来看一下软件包下面的所有目录情况。
[gpadmin@gp1 greenplum-db]$ ls -al
总用量 160
drwxr-xr-x 11 root root 187 12月 17 11:24 .
drwxr-xr-x. 14 root root 187 12月 17 11:24 ..
drwxr-xr-x 7 root root 4096 12月 17 11:24 bin
drwxr-xr-x 3 root root 22 12月 17 11:24 docs
drwxr-xr-x 2 root root 60 12月 17 11:24 etc
drwxr-xr-x 3 root root 20 12月 17 11:24 ext
-rwxr-xr-x 1 root root 783 12月 17 11:24 greenplum_path.sh
drwxr-xr-x 4 root root 4096 12月 17 11:24 include
drwxr-xr-x 6 root root 4096 12月 17 11:24 lib
-rw-r--r-- 1 root root 135617 12月 13 02:57 open_source_license_pivotal_greenplum.txt
drwxr-xr-x 7 root root 93 12月 17 11:24 pxf
drwxr-xr-x 2 root root 4096 12月 17 11:24 sbin
drwxr-xr-x 5 root root 52 12月 17 11:24 share
docs 目录
该目录下主要存储的是 bin 目录下管理命令的帮助信息,普通使用用户毋需关心该目录下的内容。大体浏览一下:
[gpadmin@gp1 greenplum-db]$ ls -al
总用量 160
drwxr-xr-x 11 root root 187 12月 17 11:24 .
drwxr-xr-x. 14 root root 187 12月 17 11:24 ..
drwxr-xr-x 7 root root 4096 12月 17 11:24 bin
drwxr-xr-x 3 root root 22 12月 17 11:24 docs
drwxr-xr-x 2 root root 60 12月 17 11:24 etc
drwxr-xr-x 3 root root 20 12月 17 11:24 ext
-rwxr-xr-x 1 root root 783 12月 17 11:24 greenplum_path.sh
drwxr-xr-x 4 root root 4096 12月 17 11:24 include
drwxr-xr-x 6 root root 4096 12月 17 11:24 lib
-rw-r--r-- 1 root root 135617 12月 13 02:57 open_source_license_pivotal_greenplum.txt
drwxr-xr-x 7 root root 93 12月 17 11:24 pxf
drwxr-xr-x 2 root root 4096 12月 17 11:24 sbin
drwxr-xr-x 5 root root 52 12月 17 11:24 share
[gpadmin@gp1 greenplum-db]$ ls -al docs
总用量 4
drwxr-xr-x 3 root root 22 12月 17 11:24 .
drwxr-xr-x 11 root root 187 12月 17 11:24 ..
drwxr-xr-x 3 root root 4096 12月 17 11:24 cli_help
[gpadmin@gp1 greenplum-db]$ ls -al docs/cli_help/
总用量 212
drwxr-xr-x 3 root root 4096 12月 17 11:24 .
drwxr-xr-x 3 root root 22 12月 17 11:24 ..
-rwxr-xr-x 1 root root 4752 12月 13 02:57 gpactivatestandby_help
-rwxr-xr-x 1 root root 7678 12月 13 02:57 gpaddmirrors_help
-rwxr-xr-x 1 root root 9221 12月 13 02:57 gpcheckperf_help
-rwxr-xr-x 1 root root 6970 12月 13 02:57 gpconfig_help
drwxr-xr-x 2 root root 4096 12月 17 11:24 .....
..........
..........
..........
docs/gpconfigs 目录
docs 目录下的 gpconfigs 子目录还蛮重要的,认真看过官方文档的人肯定会有印象,里面不止一次的涉及到过从这个目录下复制参考示例,作为数据库初始化配置等操作的模版文件。
[gpadmin@gp1 docs]$ ls -al cli_help/gpconfigs/
总用量 60
drwxr-xr-x 2 root root 4096 12月 17 11:24 .
drwxr-xr-x 3 root root 4096 12月 17 11:24 ..
-rwxr-xr-x 1 root root 2426 12月 13 02:57 gpinitsystem_config
-rwxr-xr-x 1 root root 4511 12月 13 02:57 gpinitsystem_singlenode
-rwxr-xr-x 1 root root 2325 12月 13 02:57 gpinitsystem_test
-rwxr-xr-x 1 root root 359 12月 13 02:57 hostfile_exkeys
-rwxr-xr-x 1 root root 119 12月 13 02:57 hostfile_gpchecknet_ic1
-rwxr-xr-x 1 root root 119 12月 13 02:57 hostfile_gpchecknet_ic2
-rwxr-xr-x 1 root root 87 12月 13 02:57 hostfile_gpcheckperf
-rwxr-xr-x 1 root root 255 12月 13 02:57 hostfile_gpexpand
-rwxr-xr-x 1 root root 237 12月 13 02:57 hostfile_gpinitsystem
-rwxr-xr-x 1 root root 96 12月 13 02:57 hostfile_gpssh_allhosts
-rwxr-xr-x 1 root root 87 12月 13 02:57 hostfile_gpssh_segonly
-rwxr-xr-x 1 root root 44 12月 13 02:57 hostlist_singlenode
ext 目录
该目录用来存放 python 基础环境及一些扩展包。Greenplum 为了与操作系统自身的 python 环境区别开,特意在安装包中集成了 python 2.7(目前还是采用的python 2.7作为执行器),这样就可以直接使用自带的 python 来运行一些管理维护工具(基于python写的工具,例如:gpload、gpstart等)。
[gpadmin@gp1 greenplum-db]$ ls -al ext/python/
总用量 0
drwxr-xr-x 6 root root 56 12月 17 11:24 .
drwxr-xr-x 3 root root 20 12月 17 11:24 ..
drwxr-xr-x 2 root root 189 12月 17 11:24 bin
drwxr-xr-x 3 root root 23 12月 17 11:24 include
drwxr-xr-x 4 root root 90 12月 17 11:24 lib
drwxr-xr-x 3 root root 17 12月 17 11:24 share
这里需要特别注意,不要采用 root 用户来运行 Greenplum,也不要将 source greenplum_path.sh 放到整个Linux系统的 /etc/profile 中去,如果你已经这么做了,请尽快修改,因为这会导致系统其他用户(尤其是root),也采用 Greenplum 自带的 python,最简单的后果就是可能会影响到 root 用户的 yum 不能正常使用。
上面提到了“不要将 source greenplum_path.sh 放到整个 Linux 系统的 /etc/profile 中去”,因为这个配置文件中有一步是重置 pythonhome,你可以自己打开去确认,这里截取部分代码,如下:
#setup PYTHONHOME
if [ -x $GPHOME/ext/python/bin/python ]; then
PYTHONHOME="$GPHOME/ext/python"
export PYTHONHOME
fi
greenplum_path.sh 文件
该文件主要用来设置环境变量,代码如下,设置的环境变量分别为:
GPHOME – Greenplum 安装的绝对路径
GPHOME – 更新 GPHOME 为软连接路径
PYTHONHOME – 设置 Greenplum 操作系统用户使用的 Python 执行器为 Greenplum 自带(上面提到了)
OPENSSL_CONF – 设置 openssl 配置文件路径
LD_LIBRARY_PATH – 更新该变量,添加 Python 库
PATH – 更新该变量,增加 Greenplum 和 Python 命令
GPHOME=/usr/local/greenplum-db-6.2.1
# Replace with symlink path if it is present and correct
if [ -h ${GPHOME}/../greenplum-db ]; then
GPHOME_BY_SYMLINK=`(cd ${GPHOME}/../greenplum-db/ && pwd -P)`
if [ x"${GPHOME_BY_SYMLINK}" = x"${GPHOME}" ]; then
GPHOME=`(cd ${GPHOME}/../greenplum-db/ && pwd -L)`/.
fi
unset GPHOME_BY_SYMLINK
fi
#setup PYTHONHOME
if [ -x $GPHOME/ext/python/bin/python ]; then
PYTHONHOME="$GPHOME/ext/python"
export PYTHONHOME
fi
PYTHONPATH=$GPHOME/lib/python
PATH=$GPHOME/bin:$PYTHONHOME/bin:$PATH
LD_LIBRARY_PATH=$GPHOME/lib:$PYTHONHOME/lib:${LD_LIBRARY_PATH-}
export LD_LIBRARY_PATH
if [ -e $GPHOME/etc/openssl.cnf ]; then
OPENSSL_CONF=$GPHOME/etc/openssl.cnf
export OPENSSL_CONF
fi
export GPHOME
export PATH
export PYTHONPATH
include 目录
头文件,这个目录下的头文件基本都是一些公共函数文件,例如 libpq、zstd 都有是现成的。不多解释,非开发人员也不会用到,开发人员自然懂。
[gpadmin@gp1 greenplum-db]$ ls -al include
总用量 328
drwxr-xr-x 4 root root 4096 12月 17 11:24 .
drwxr-xr-x 11 root root 187 12月 17 11:24 ..
-rwxr-xr-x 1 root root 714 12月 13 02:57 ecpg_config.h
-rwxr-xr-x 1 root root 2540 12月 13 02:57 ecpgerrno.h
-rwxr-xr-x 1 root root 2758 12月 13 02:57 ecpg_informix.h
-rwxr-xr-x 1 root root 2607 12月 13 02:57 ecpglib.h
-rwxr-xr-x 1 root root 2621 12月 13 02:57 ecpgtype.h
-rwxr-xr-x 1 root root 778 12月 13 02:57 gppc_config.h
-rwxr-xr-x 1 root root 65607 12月 13 02:57 gppc.h
drwxr-xr-x 2 root root 24 12月 17 11:24 libpq
-rwxr-xr-x 1 root root 2208 12月 13 02:57 libpq-events.h
-rwxr-xr-x 1 root root 22057 12月 13 02:57 libpq-fe.h
-rwxr-xr-x 1 root root 323 12月 13 02:57 pg_config_ext.h
-rwxr-xr-x 1 root root 33050 12月 13 02:57 pg_config.h
-rwxr-xr-x 1 root root 10616 12月 13 02:57 pg_config_manual.h
-rwxr-xr-x 1 root root 1052 12月 13 02:57 pg_config_os.h
-rwxr-xr-x 1 root root 787 12月 13 02:57 pgtypes_date.h
-rwxr-xr-x 1 root root 530 12月 13 02:57 pgtypes_error.h
-rwxr-xr-x 1 root root 222 12月 13 02:57 pgtypes.h
-rwxr-xr-x 1 root root 1164 12月 13 02:57 pgtypes_interval.h
-rwxr-xr-x 1 root root 2249 12月 13 02:57 pgtypes_numeric.h
-rwxr-xr-x 1 root root 1031 12月 13 02:57 pgtypes_timestamp.h
-rwxr-xr-x 1 root root 2144 12月 13 02:57 postgres_ext.h
drwxr-xr-x 5 root root 52 12月 17 11:24 postgresql
-rwxr-xr-x 1 root root 834 12月 13 02:57 sql3types.h
-rwxr-xr-x 1 root root 1276 12月 13 02:57 sqlca.h
-rwxr-xr-x 1 root root 1583 12月 13 02:57 sqlda-compat.h
-rwxr-xr-x 1 root root 317 12月 13 02:57 sqlda.h
-rwxr-xr-x 1 root root 820 12月 13 02:57 sqlda-native.h
-rwxr-xr-x 1 root root 3715 12月 13 02:57 zstd_errors.h
-rwxr-xr-x 1 root root 94270 12月 13 02:57 zstd.h
看完了 include 目录,剩余的目录还有 lib 目录、pxf 目录、sbin 目录和 share 目录。。首先还是先来看一下软件包下面的所有目录情况。
[gpadmin@gp1 greenplum-db]$ ls -al
总用量 160
drwxr-xr-x 11 root root 187 12月 17 11:24 .
drwxr-xr-x. 14 root root 187 12月 17 11:24 ..
drwxr-xr-x 7 root root 4096 12月 17 11:24 bin
drwxr-xr-x 3 root root 22 12月 17 11:24 docs
drwxr-xr-x 2 root root 60 12月 17 11:24 etc
drwxr-xr-x 3 root root 20 12月 17 11:24 ext
-rwxr-xr-x 1 root root 783 12月 17 11:24 greenplum_path.sh
drwxr-xr-x 4 root root 4096 12月 17 11:24 include
drwxr-xr-x 6 root root 4096 12月 17 11:24 lib
-rw-r--r-- 1 root root 135617 12月 13 02:57 open_source_license_pivotal_greenplum.txt
drwxr-xr-x 7 root root 93 12月 17 11:24 pxf
drwxr-xr-x 2 root root 4096 12月 17 11:24 sbin
drwxr-xr-x 5 root root 52 12月 17 11:24 share
lib 目录
该目录下主要存的是动态链接库,程序运行过程中会动态将这些库文件加载。另外有一些别的内容,可以到目录下简单看一下。
-rwxr-xr-x 1 root root 662274 12月 13 02:57 libecpg.a
-rwxr-xr-x 1 root root 75844 12月 13 02:57 libecpg_compat.a
lrwxrwxrwx 1 root root 21 12月 17 11:24 libecpg_compat.so -> libecpg_compat.so.3.6
lrwxrwxrwx 1 root root 21 12月 17 11:24 libecpg_compat.so.3 -> libecpg_compat.so.3.6
-rwxr-xr-x 1 root root 64464 12月 13 02:57 libecpg_compat.so.3.6
lrwxrwxrwx 1 root root 14 12月 17 11:24 libecpg.so -> libecpg.so.6.6
lrwxrwxrwx 1 root root 14 12月 17 11:24 libecpg.so.6 -> libecpg.so.6.6
-rwxr-xr-x 1 root root 361496 12月 13 02:57 libecpg.so.6.6
lrwxrwxrwx 1 root root 16 12月 17 11:24 libgpdbcost.so -> libgpdbcost.so.3
lrwxrwxrwx 1 root root 21 12月 17 11:24 libgpdbcost.so.3 -> libgpdbcost.so.3.85.0
-rwxr-xr-x 1 root root 1122528 12月 13 02:57 libgpdbcost.so.3.85.0
lrwxrwxrwx 1 root root 13 12月 17 11:24 libgpopt.so -> libgpopt.so.3
lrwxrwxrwx 1 root root 18 12月 17 11:24 libgpopt.so.3 -> libgpopt.so.3.85.0
-rwxr-xr-x 1 root root 50101096 12月 13 02:57 libgpopt.so.3.85.0
lrwxrwxrwx 1 root root 12 12月 17 11:24 libgpos.so -> libgpos.so.3
lrwxrwxrwx 1 root root 17 12月 17 11:24 libgpos.so.3 -> libgpos.so.3.85.0
-rwxr-xr-x 1 root root 1988592 12月 13 02:57 libgpos.so.3.85.0
-rwxr-xr-x 1 root root 259280 12月 13 02:57 libgppc.a
lrwxrwxrwx 1 root root 14 12月 17 11:24 libgppc.so -> libgppc.so.1.2
lrwxrwxrwx 1 root root 14 12月 17 11:24 libgppc.so.1 -> libgppc.so.1.2
-rwxr-xr-x 1 root root 149680 12月 13 02:57 libgppc.so.1.2
...............
...............
...............
lib/gpperfmon 目录
该目录下有 gpperfmon(gpcc用的监控库)模式初始化文件 gpperfmon.sql,该 sql 文件可以用来在 gpperfmon 中创建对应的内外表。具体内容自己可以打开看看,可以根据模式的内容构造一个自己的 gpcc。
lib/pkgconfig 目录
源码编译用的一些文件,在编译和链接库文件时,通过这些 .pc 文件来指定文件的位置、版本号、编译选项等信息。
[gpadmin@gp1 pkgconfig]$ cat libzstd.pc
# ZSTD - standard compression algorithm
# Copyright (C) 2014-2016, Yann Collet, Facebook
# BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
prefix=/usr
libdir=/usr/lib64
includedir=/usr/include
Name: zstd
Description: fast lossless compression algorithm library
URL: http://www.zstd.net/
Version: 1.3.7
Libs: -L${libdir} -lzstd
Cflags: -I${includedir}
lib/postgresql 目录
由于 Greenplum 是基于 PostgreSQL 内核开发的,所以一些 Postgresql 的动态链接库放在该目录下。
[gpadmin@gp1 postgresql]$ ls -al
总用量 41768
drwxr-xr-x 3 root root 4096 12月 17 11:24 .
drwxr-xr-x 6 root root 4096 12月 17 11:24 ..
-rwxr-xr-x 1 root root 19920 12月 13 02:57 ascii_and_mic.so
-rwxr-xr-x 1 root root 97376 12月 13 02:57 auto_explain.so
-rwxr-xr-x 1 root root 54600 12月 13 02:57 citext.so
-rwxr-xr-x 1 root root 49528 12月 13 02:57 cyrillic_and_mic.so
-rwxr-xr-x 1 root root 245704 12月 13 02:57 dblink.so
-rwxr-xr-x 1 root root 1267072 12月 13 02:57 dict_snowball.so
-rwxr-xr-x 1 root root 404864 12月 13 02:57 diskquota.so
-rwxr-xr-x 1 root root 29880 12月 13 02:57 euc2004_sjis2004.so
-rwxr-xr-x 1 root root 21728 12月 13 02:57 euc_cn_and_mic.so
-rwxr-xr-x 1 root root 40496 12月 13 02:57 euc_jp_and_sjis.so
-rwxr-xr-x 1 root root 21720 12月 13 02:57 euc_kr_and_mic.so
-rwxr-xr-x 1 root root 40536 12月 13 02:57 euc_tw_and_big5.so
-rwxr-xr-x 1 root root 109176 12月 13 02:57 fixedwidth.so
-rwxr-xr-x 1 root root 185416 12月 13 02:57 fuzzystrmatch.so
-rwxr-xr-x 1 root root 82288 12月 13 02:57 gp_ao_co_diagnostics.so
-rwxr-xr-x 1 root root 7464944 12月 13 02:57 gpcloud.so
-rwxr-xr-x 1 root root 85288 12月 13 02:57 gp_distribution_policy.so
-rwxr-xr-x 1 root root 77768 12月 13 02:57 gpextprotocol.so
-rwxr-xr-x 1 root root 611544 12月 13 02:57 gpfmt_avro.so
-rwxr-xr-x 1 root root 113624 12月 13 02:57 gpfmt_binary.so
-rwxr-xr-x 1 root root 474792 12月 13 02:57 gpfmt_confluent_avro.so
-rwxr-xr-x 1 root root 110680 12月 13 02:57 gpfmt_delimiter.so
-rwxr-xr-x 1 root root 108192 12月 13 02:57 gpfmt_json.so
-rwxr-xr-x 1 root root 749016 12月 13 02:57 gpfmt_kafka.so
-rwxr-xr-x 1 root root 17311712 12月 13 02:57 gpfmt_protobuf.so
-rwxr-xr-x 1 root root 82088 12月 13 02:57 gpformatter.so
............
............
............
从上面的具体库文件命名也可以看出,有一部分 greenplum 的动态链接库也是放在这里面的。
lib/python 目录
该目录下放的是 python 用到的库文件,例如:yaml、pygresql,这里面比较重要的一个就是 pygresql,这是 python 语言访问 postgresql 系数据库的三方接口库,现在用的比较多的具有相同作用的库还有 psycopg2,当然这里选用的是 pygresql。
gpadmin@gp1 python]$ ls -al
总用量 220
drwxr-xr-x 7 root root 222 12月 17 11:24 .
drwxr-xr-x 6 root root 4096 12月 17 11:24 ..
drwxr-xr-x 10 root root 4096 12月 17 11:24 gppylib
-rwxr-xr-x 1 root root 0 12月 13 02:57 __init__.py
-rwxr-xr-x 1 root root 111 12月 13 02:57 __init__.pyc
drwxr-xr-x 2 root root 90 12月 17 11:24 lockfile
-rwxr-xr-x 1 root root 69992 12月 13 02:57 _posixsubprocess.so
drwxr-xr-x 3 root root 4096 12月 17 11:24 psutil
drwxr-xr-x 2 root root 117 12月 17 11:24 pygresql
-rwxr-xr-x 1 root root 3758 12月 13 02:57 subprocess32-ChangeLog
-rwxr-xr-x 1 root root 74362 12月 13 02:57 subprocess32.py
-rwxr-xr-x 1 root root 48477 12月 13 02:57 subprocess32.pyc
drwxr-xr-x 2 root root 4096 12月 17 11:24 yaml
sbin 目录
该目录下存储的文件主要为 bin 目录下的一些集群管理工具的内部命令,这些 python 脚本不能直接调用,而只能通过 bin 目录下对应的脚本自行调用。该目录在使用过程中对用户是不可见的,程序会自动去调用,可以忽略。但是如果有源码修改需求,这部分下的脚本文件也不要忘掉哦。
[gpadmin@gp1 greenplum-db]$ ls -al sbin
总用量 128
drwxr-xr-x 2 root root 4096 12月 17 11:24 .
drwxr-xr-x 11 root root 187 12月 17 11:24 ..
-rwxr-xr-x 1 root root 2808 12月 13 02:57 gpcleansegmentdir.py
-rwxr-xr-x 1 root root 3303 12月 13 02:57 gpcleansegmentdir.pyc
-rwxr-xr-x 1 root root 6541 12月 13 02:57 gpconfig_helper.py
-rwxr-xr-x 1 root root 5648 12月 13 02:57 gpconfig_helper.pyc
-rwxr-xr-x 1 root root 9089 12月 13 02:57 gpgetstatususingtransition.py
-rwxr-xr-x 1 root root 8302 12月 13 02:57 gpgetstatususingtransition.pyc
-rwxr-xr-x 1 root root 1338 12月 13 02:57 gpmon_catqrynow.py
-rwxr-xr-x 1 root root 1186 12月 13 02:57 gpmon_catqrynow.pyc
-rwxr-xr-x 1 root root 1937 12月 13 02:57 gpoperation.py
-rwxr-xr-x 1 root root 1565 12月 13 02:57 gpoperation.pyc
-rwxr-xr-x 1 root root 14843 12月 13 02:57 gpsegstart.py
-rwxr-xr-x 1 root root 12309 12月 13 02:57 gpsegstart.pyc
-rwxr-xr-x 1 root root 8247 12月 13 02:57 gpsegstop.py
-rwxr-xr-x 1 root root 7641 12月 13 02:57 gpsegstop.pyc
-rwxr-xr-x 1 root root 7797 12月 13 02:57 packcore
share 目录
这是最后一个目录,也是一个比较重要的目录,该目录中最重要的一个要数 postgresql 这个子目录。
[gpadmin@gp1 greenplum-db]$ ls -al share
drwxr-xr-x 3 root root 24 12月 17 11:24 doc
drwxr-xr-x 2 root root 41 12月 17 11:24 greenplum
drwxr-xr-x 8 root root 4096 12月 17 11:24 postgresql
share/doc目录
目前该目录下只存了 orafce 扩展的一些文档性信息。可以自行 cat 打开来看。
[gpadmin@gp1 greenplum-db]$ ls -al share/doc/postgresql/extension/
总用量 40
drwxr-xr-x 2 root root 75 12月 17 11:24 .
drwxr-xr-x 3 root root 23 12月 17 11:24 ..
-rwxr-xr-x 1 root root 987 12月 13 02:57 COPYRIGHT.orafce
-rwxr-xr-x 1 root root 874 12月 13 02:57 INSTALL.orafce
-rwxr-xr-x 1 root root 31364 12月 13 02:57 README.asciidoc
share/postgresql/extension 目录
该目录下放了很多创建扩展用到的 control 文件和 sql 文件,比较著名的有:citext、dblink、hstore、orafce、存储过程语言扩展、pxf 等等,可以说我们在 Greenplum 数据库中执行创建扩展语句 CREATE Extention xxxx 时,它会从这个目录下寻找对应的 control 文件并执行对应的 SQL,在数据库中创建对应的函数、类型等内容。
[gpadmin@gp1 greenplum-db]$ ls -al share/postgresql/extension/
总用量 432
drwxr-xr-x 2 root root 4096 12月 17 11:24 .
drwxr-xr-x 8 root root 4096 12月 17 11:24 ..
-rwxr-xr-x 1 root root 1028 12月 13 02:57 citext--1.0--1.1.sql
-rwxr-xr-x 1 root root 12337 12月 13 02:57 citext--1.0.sql
-rwxr-xr-x 1 root root 1001 12月 13 02:57 citext--1.1--1.0.sql
-rwxr-xr-x 1 root root 12364 12月 13 02:57 citext--1.1.sql
-rwxr-xr-x 1 root root 158 12月 13 02:57 citext.control
-rwxr-xr-x 1 root root 9839 12月 13 02:57 citext--unpackaged--1.0.sql
-rwxr-xr-x 1 root root 419 12月 13 02:57 dblink--1.0--1.1.sql
-rwxr-xr-x 1 root root 5936 12月 13 02:57 dblink--1.1.sql
-rwxr-xr-x 1 root root 170 12月 13 02:57 dblink.control
-rwxr-xr-x 1 root root 2863 12月 13 02:57 dblink--unpackaged--1.0.sql
-rw-r--r-- 1 root root 2674 12月 13 02:57 diskquota--1.0.sql
-rw-r--r-- 1 root root 139 12月 13 02:57 diskquota.control
-rwxr-xr-x 1 root root 1436 12月 13 02:57 fuzzystrmatch--1.0.sql
-rwxr-xr-x 1 root root 175 12月 13 02:57 fuzzystrmatch.control
-rwxr-xr-x 1 root root 1108 12月 13 02:57 fuzzystrmatch--unpackaged--1.0
................
................
................
pxf 目录
在 GPDB 4.x 的时代,我们连接 Hadoop 系是通过 gphdfs 来实现的,但是这种方式的可用性和可扩展性并不强。所以从 GPDB 5.x 开始,GPDB 从 HAWQ( HAWQ 是 Pivotal 开源的另一款软件,一款底层存储基于 HDFS,前端引擎基于 GPDB,支持大规模并行处理的软件 )中吸收了 pxf 框架。该框架通过扩展的形式在 GPDB 中创建,它能够使 GPDB 以并行的方式从 HDFS、Hbase、Hive 或其他存储中查询数据,pxf 在目标侧通过 Java 语言与 Hadoop 系进行交互,而在 GPDB 侧则通过 C 做底层交互,打通 GPDB 与 Hadoop 数据的任督二脉。使用方面只需要在创建外部表时指定协议为 pxf 即可。
[gpadmin@gp1 pxf]$ ls -al
总用量 4
drwxr-xr-x 7 root root 93 12月 17 11:24 .
drwxr-xr-x 11 root root 187 12月 17 11:24 ..
drwxr-xr-x 9 root root 220 12月 17 11:24 apache-tomcat
drwxr-xr-x 2 root root 32 12月 17 11:24 bin
drwxr-xr-x 2 root root 64 12月 17 11:24 conf
drwxr-xr-x 3 root root 252 12月 17 11:24 lib
drwxr-xr-x 5 root root 43 12月 17 11:24 templates
-rw-r--r-- 1 root root 7 12月 13 02:57 version
这里不展开给大家详细介绍 pxf 的每个子目录的作用了,后面在 pxf 的详细使用介绍文章中再具体说明。
