HadoopDB集群配置方法

本文介绍在2个节点上安装配置HadoopDB方法。各节点的名称分别为Cluster01(192.168.0.1),Cluster02(192.168.0.2)。

以下若是用 hadoop@Cluster0X:~ 代表 Cluster01 ~ Cluster02 都要做的.


参考资料1:HadoopDB Quick Start Guide

参考资料2:HadoopDB安装使用




1  首先在各节点上安装Hadoop-0.20.2, 参考此文

 

各节点安裝设置 PostgreSQL:

  • 安裝并为数据库建立 hadoop 帐号,假定使用密碼为 1234
  • hadoop@Cluster0X:~$ sudo apt-get install postgresql
  • hadoop@Cluster0X:~$ sudo vim /etc/postgresql/8.4/main/pg_hba.conf
    • #local   all         all                               ident
      local   all         all                               trust
      # IPv4 local connections:
      #host    all         all         127.0.0.1/32          md5
      host    all         all         127.0.0.1/32          password
      host    all         all         192.168.0.1/24          password            # 加上Cluster 機器 IP 範圍
      # IPv6 local connections:
      #host    all         all         ::1/128               md5
      host    all         all         ::1/128               password
  • hadoop@Cluster0X:~$ sudo /etc/init.d/postgresql-8.4 restart
  • hadoop@Cluster0X:~$ sudo su - postgres
  • postgres@Cluster0X:~$ createuser hadoop
    • Shall the new role be a superuser? (y/n) y
      postgres@Cluster01:~$ psql
      psql (8.4.2)
      Type "help" for help.

      postgres=# alter user hadoop with password '1234';
      ALTER ROLE
      postgres=# /q
  • 測試其他機器可否連線
    • hadoop@Cluster01:~$ createdb testdb
    • hadoop@Cluster02:~$ psql -h Cluster01 testdb
      • 如果能够连接上,则出现以下提示:
        • 口令:
          psql (8.4.2)
          SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
          Type "help" for help.

          testdb=#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值