1、安装postgresql

在离线安装CM时,有时会报如下的错误:

Resolving Dependencies
--> Running transaction check
---> Package cloudera-manager-server-db-2.x86_64 0:5.0.2-1.cm502.p0.297.el6 will be installed
--> Processing Dependency: postgresql-server >= 8.4 for package: cloudera-manager-server-db-2-5.0.2-1.cm502.p0.297.el6.x86_64
--> Finished Dependency Resolution
Error: Package: cloudera-manager-server-db-2-5.0.2-1.cm502.p0.297.el6.x86_64 (cloudera-manager)
           Requires: postgresql-server >= 8.4
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

这是由于CM依赖postgresql,需要在本机上安装postgresql,如果是在线安装,自动以Yum方式安装,由于是离线,无法自动安装postgresql。


检查是否安装了postgresql:

[root@localhost postgresql84]# rpm -qa|grep postgres

如果已经安装,但版本小于8.4,则使用rpm -e卸载。

下面以rpm方式安装postgresql,先到 http://yum.postgresql.org/8.4/redhat/rhel-6-x86_64/repoview/ 上下载postgresql8.4的包,需要下载三个包:

[root@localhost postgresql84]# ll
total 4532
-rw-r--r-- 1 root root  898392 Jun 15 01:10 postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm
-rw-r--r-- 1 root root  180396 Jun 15 01:10 postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm
-rw-r--r-- 1 root root 3552400 Jun 15 01:10 postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm
[root@localhost postgresql84]#

安装PostgreSQL,注意安装顺序:

[root@localhost postgresql84]# rpm -ivh postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm
warning: postgresql84-libs-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing...                ########################################### [100%]
   1:postgresql84-libs      ########################################### [100%]
[root@localhost postgresql84]# rpm -ivh postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm 
warning: postgresql84-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing...                ########################################### [100%]
   1:postgresql84           ########################################### [100%]
[root@localhost postgresql84]# rpm -ivh postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm 
warning: postgresql84-server-8.4.21-1PGDG.rhel6.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Preparing...                ########################################### [100%]
   1:postgresql84-server    ########################################### [100%]
[root@localhost postgresql84]#