【大数据之数据仓库】安装部署phpPgAdmin

经安装好GreenPlum集群,那么接下来就是使用GreenPlum了。一般情况下,后台开发人员会直接选用psql(GreenPlum包自带,可以理解成是mysql这个管理客户端)进行数据操作,而偏向于业务开发或者做数据分析的同事,则会倾向于更方便、更直观的图形化管理工具,比如gpAdmin、phpPgAdmin等。因为gpAdmin的安装很方便,二进制包直接装本机就能使用,而phpPgAdmin相对而言略麻烦,所以本篇就来介绍下phpPgAdmin的安装部署。

1.安装http服务:
任选1台主机
[root@hzadg-helf-xxx ~]# yum install httpd          安装apache服务
[root@hzadg-helf-xxx ~]# yum install php            安装php编译器
[root@hzadg-helf-xxx ~]# yum install php-pgsql      安装pgsql模块
2.安装phpphadmin:
[root@hzadg-helf-xxx ~]# yum install git            安装git软件
[root@hzadg-helf-xxx ~]# cd /var/www                切换目录
[root@hzadg-helf-xxx ~]# git clone https://github.com/xzilla/phppgadmin.git
[root@hzadg-helf-xxx ~]# cd phppgadmin/conf         切换目录
[root@hzadg-helf-xxx ~]# cp config.inc.php-dist config.inc.php
[root@hzadg-helf-xxx ~]# vi config.inc.php          修改配置项,填入greenplum master的ip地址
$conf['servers'][0]['host'] = 'greenplum master ip';
3.添加phppgadmin服务:
[root@hzadg-helf-xxx ~]# cd /etc/httpd/conf.d
[root@hzadg-helf-xxx ~]# vi phppgadmin.conf         新创建文件,以下是文件内容
Alias /phppgadmin "/var/www/phppgadmin"
<Directory "/var/www/phppgadmin">
    Options Indexes Multiviews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
4.GreenPlum授权:
[gpadmin@hzadg-helf-xxx ~]$ cd ~/gp/data/master/gpseg-1/
[gpadmin@hzadg-helf-xxx gpseg-1]$ vi pg_hba.conf    新增加以下一行
host    all             gpadmin             masterip/32               password
[gpadmin@hzadg-helf-xxx gpseg-1]$ gpstop -u         热加载配置,即时生效
5.启动http服务:
[root@hzadg-helf-xxx ~]# service httpd start
6.浏览器客户端:
本地浏览器输入: http://greenplum-master-ip/phppgadmin/
本文来自网易实践者社区,经作者 何李夫 授权发布。