搜索
首页数据库mysql教程 生产环境下Hadoop大集群安装与配置+DNS+NFS

《生产环境下Hadoop大集群安装与配置+DNS+NFS》一环境LinuxISO:CentOS-6.0-i386-bin-DVD.iso32位JDKversion:1.6.0_25-eaforlinuxHad..

《生产环境下Hadoop大集群安装与配置+DNS+NFS》

一 环境

Linux ISO:CentOS-6.0-i386-bin-DVD.iso     32位   

JDK version:"1.6.0_25-ea"   for  linux

Hadoop software version:hadoop-0.20.205.0.tar.gz   for  linux

VMware® Workstation   Version: 7.0.0 build-203739

我的linux虚拟机配置   master   slave1   slave2    信息如下

主机名


 

IP


 

节点名


 

备注


 

h1


 

192.168.2.102


 

master


 

namenode和jobtracker


 

h2


 

192.168.2.103


 

slave1


 

datanode和tasktracker


 

H4


 

192.168.2.105


 

slave2


 

datanode和tasktracker


 

DNS服务器安装与配置参考链接,感谢yanggw8071   mikeliu   chizeng

1.      

2.      

3.      

二 Bind安装DNS服务器并成功解析主机名

1.说明一下,我把DNS服务器安装到h1节点(master上)然后对h1 h2 h4 节点的主机名进行解析

2.需要h1节点可以上网,因为我们需要使用yum方式安装DNS的rpm包,美国空间,上网方式如下

CentOS需要能连入网络,这个比较简单,可以参考《NOSQL系列-memcached安装管理与repcached高可用性》,这篇文章在一开始就介绍了虚拟机如何连接上网

3.原来我们使用的hosts文件来解析主机名,现在可以不使用了直接删除即可,我呢直接改名吧,香港服务器,这样留着备用

[root@h1 etc]# mv /etc/hosts /etc/hosts_20130126

4.有的筒子使用了webmin软件GUI方式配置了DNS服务器,这种方式是挺方便的界面化人性化,但我用惯了命令行(码农的归宿)所以直接使用rpm方式来安装DNS了

5.检查一下bind包有没有,这也是采用chroot机制

[root@h1 ~]# rpm -q bind

package bind is not installed

[root@h1 ~]# rpm -q bind-chroot

package bind-chroot is not installed

这里显示还没有安装,那么我们就需要yum方式安装啦

6.现在使用yum安装bind 和 bind-chroot 软件包

[root@h1 ~]# yum -y install bind bind-chroot

省略。。。。。。

Dependencies Resolved

=======================================================================================

Package     Arch     Version                 Repository       Size

=======================================================================================

Installing:                安装这2个包

bind        i686     32:9.8.2-0.10.rc1.el6_3.6   updates         4.0 M

bind-chroot  i686     32:9.8.2-0.10.rc1.el6_3.6   updates         70 k

Updating for dependencies:  升级2个依赖包

bind-libs    i686      32:9.8.2-0.10.rc1.el6_3.6   updates         882 k

bind-utils  i686     32:9.8.2-0.10.rc1.el6_3.6     updates         180 k

Transaction Summary

=======================================================================================Install       2 Package(s)

Upgrade    2 Package(s)

Installed:

bind.i686 32:9.8.2-0.10.rc1.el6_3.6      bind-chroot.i686 32:9.8.2-0.10.rc1.el6_3.6                                          

Dependency Updated:

bind-libs.i686 32:9.8.2-0.10.rc1.el6_3.6   bind-utils.i686 32:9.8.2-0.10.rc1.el6_3.6                                         

Complete!

到此bind 和 bind-chroot包安装完成

[root@h1 ~]# rpm -q bind

bind-9.8.2-0.10.rc1.el6_3.6.i686

[root@h1 ~]# rpm -q bind-chroot

bind-chroot-9.8.2-0.10.rc1.el6_3.6.i686

哈哈 现在都已经安装好了

7. yum install bind*还有三个包需要安装

[root@h1 etc]# yum install bind*

Dependencies Resolved

=======================================================================================

Package     Arch     Version                 Repository       Size

=======================================================================================

Installing:                安装这3个包

bind-devel   i686    32:9.8.2-0.10.rc1.el6_3.6     updates         376 k

bind-dyndb-ldap i686  1.1.0-0.9.b1.el6_3.1        updates          63 k

bind-sdb   i686   32:9.8.2-0.10.rc1.el6_3.6       updates          305 k

Transaction Summary

=======================================================================================I

Install       3 Package(s)

Upgrade     0 Package(s)

Installed:

bind-devel.i686 32:9.8.2-0.10.rc1.el6_3.6              

bind-dyndb-ldap.i686 0:1.1.0-0.9.b1.el6_3.1              

bind-sdb.i686 32:9.8.2-0.10.rc1.el6_3.6            

Complete!

现在都安装完毕了

8.修改named.conf文件,目录/etc/named.conf

[root@h1 etc]# vim /etc/named.conf        修改2处,标红显示

options {

        listen-on port 53 { any; };       //把127.0.0.1 修改成 any

        listen-on-v6 port 53 { ::1; };

        directory       "/var/named";

        dump-file       "/var/named/data/cache_dump.db";

        statistics-file "/var/named/data/named_stats.txt";

        memstatistics-file "/var/named/data/named_mem_stats.txt";

        allow-query     { any; };      //localhost 修改成 any

        recursion yes;

        dnssec-enable yes;

        dnssec-validation yes;

        dnssec-lookaside auto;

        /* Path to ISC DLV key */

        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

};

logging {

        channel default_debug {

                file "data/named.run";

                severity dynamic;

        };

};

zone "." IN {

        type hint;

        file "named.ca";

};

include "/etc/named.rfc1912.zones";

include "/etc/named.root.key";

9. 修改named.rfc1912.zones文件,目录/etc/named.rfc1912.zones

配置正向反向配置文件

[root@h1 etc]# vim /etc/named.rfc1912.zones     在这个文件末尾添加如下内容,红色是注意的地方

zone "leonarding.com" IN {

        type master;

        file "leonarding.com.zone";       注意这是你自己设置的域名,要牢牢记住

        allow-update { none; };

};

zone "2.168.192.in-addr.arpa" IN {

        type master;

        file "2.168.192.in-addr.zone";      这是反向配置文件

        allow-update { none; };

};

10.创建leonarding.com.zone和2.168.192.in-addr.zon 文件

[root@h1 etc]# cd /var/named          进入这个目录

[root@h1 named]# cp -p named.localhost leonarding.com.zone

[root@h1 named]# cp -p named.localhost 2.168.192.in-addr.zone

对这2个文件进行修改,修改成新的文件,这2个文件就是区域文件,一定要写对了,否则会报错

添加正向文件并且配置

[root@h1 named]# vim leonarding.com.zone

$TTL 86400

@    IN    SOA  h1.leonarding.com. chizk. (

     0 ; serial (d. adams)

     1D ; refresh

     1H ; retry

     1W ; expiry

     3H ) ; minimum

@    IN    NS  h1.leonarding.com.

h1.leonarding.com. IN A 192.168.2.102

h2.leonarding.com. IN A 192.168.2.103

h4.leonarding.com. IN A 192.168.2.105

添加反向文件并且配置

[root@h1 named]# vim 2.168.192.in-addr.zone

$TTL 86400

@    IN    SOA  h1.leonarding.com. chizk. (

     0 ; serial (d. adams)

     1D ; refresh

     1H ; retry

     1W ; expiry

     3H ) ; minimum

@    IN    NS  h1.leonarding.com.

102 IN PTR h1.leonarding.com.

103 IN PTR h2.leonarding.com.

105 IN PTR h4.leonarding.com.

修改正向文件和反向文件属组,使用chgrp即可

[root@h1 named]# chgrp named leonarding.com.zone

[root@h1 named]# chgrp named leonarding.com.rev

11.修改/etc/resolv.conf 添加DNS域名服务器ip

h1(master)

[root@h1 named]# vim /etc/resolv.conf

nameserver 192.168.2.102          在最后面追加此条即可,就是我的master机器ip

说明我们是把master机器作为DNS域名解析服务器,

h2(slave)

[root@h2 sysconfig]# vim /etc/resolv.conf

nameserver 192.168.2.102

h4(slave)

[root@h4 .ssh]# vim /etc/resolv.conf

nameserver 192.168.2.102

添加DNS域名服务器ip,当有域名或主机名解析的时候,就知道去哪台机器上进行映射了

12.启动DNS服务器

[root@h1 named]# service named start

启动  named:                            【确定】

13.使用nslookup命令测试域名解析

测试之前关闭防火墙

[root@h1 named]# service iptables status

Iptables:未运行防火墙

正向解析域名->IP

[root@h1 named]# nslookup h1.leonarding.com

Server:          192.168.2.102                    指域名服务器ip地址

Address:       192.168.2.102#53                     ip+端口号,DNS默认53端口

Name:   h1.leonarding.com                    域名解析

Address: 192.168.2.102                       映射ip

[root@h1 named]# nslookup h2.leonarding.com

Server:          192.168.2.102                    指域名服务器ip地址

Address:       192.168.2.102#53                     ip+端口号,DNS默认53端口

Name:   h2.leonarding.com                    域名解析

Address: 192.168.2.103                       映射ip

[root@h1 named]# nslookup h4.leonarding.com

Server:          192.168.2.102                    指域名服务器ip地址

Address:       192.168.2.102#53                    ip+端口号,DNS默认53端口

Name:   h4.leonarding.com                    域名解析

Address: 192.168.2.105                       映射ip

反向解析IP->域名

[root@h1 named]# nslookup 192.168.2.102

Server:          192.168.2.102

Address:       192.168.2.102#5

102.2.168.192.in-addr.arpa     name = h1.leonarding.com.

[root@h1 named]# nslookup 192.168.2.103

Server:          192.168.2.102

Address:       192.168.2.102#53

103.2.168.192.in-addr.arpa     name = h2.leonarding.com.

[root@h1 named]# nslookup 192.168.2.105

Server:          192.168.2.102

Address:       192.168.2.102#53

105.2.168.192.in-addr.arpa     name = h4.leonarding.com.

我们还可以使用host命令做解析测试

[root@h1 named]# host h2.leonarding.com

h2.leonarding.com has address 192.168.2.103

[root@h1 named]# host 192.168.2.103

103.2.168.192.in-addr.arpa domain name pointer h2.leonarding.com.

声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
在MySQL中使用视图的局限性是什么?在MySQL中使用视图的局限性是什么?May 14, 2025 am 12:10 AM

mysqlviewshavelimitations:1)他们不使用Supportallsqloperations,限制DatamanipulationThroughViewSwithJoinSorsubqueries.2)他们canimpactperformance,尤其是withcomplexcomplexclexeriesorlargedatasets.3)

确保您的MySQL数据库:添加用户并授予特权确保您的MySQL数据库:添加用户并授予特权May 14, 2025 am 12:09 AM

porthusermanagementInmysqliscialforenhancingsEcurityAndsingsmenting效率databaseoperation.1)usecReateusertoAddusers,指定connectionsourcewith@'localhost'or@'%'。

哪些因素会影响我可以在MySQL中使用的触发器数量?哪些因素会影响我可以在MySQL中使用的触发器数量?May 14, 2025 am 12:08 AM

mysqldoes notimposeahardlimitontriggers,butacticalfactorsdeterminetheireffactective:1)serverConfiguration impactactStriggerGermanagement; 2)复杂的TriggerSincreaseSySystemsystem load; 3)largertablesslowtriggerperfermance; 4)highConconcConcrencerCancancancancanceTigrignecentign; 5); 5)

mysql:存储斑点安全吗?mysql:存储斑点安全吗?May 14, 2025 am 12:07 AM

Yes,it'ssafetostoreBLOBdatainMySQL,butconsiderthesefactors:1)StorageSpace:BLOBscanconsumesignificantspace,potentiallyincreasingcostsandslowingperformance.2)Performance:LargerrowsizesduetoBLOBsmayslowdownqueries.3)BackupandRecovery:Theseprocessescanbe

mySQL:通过PHP Web界面添加用户mySQL:通过PHP Web界面添加用户May 14, 2025 am 12:04 AM

通过PHP网页界面添加MySQL用户可以使用MySQLi扩展。步骤如下:1.连接MySQL数据库,使用MySQLi扩展。2.创建用户,使用CREATEUSER语句,并使用PASSWORD()函数加密密码。3.防止SQL注入,使用mysqli_real_escape_string()函数处理用户输入。4.为新用户分配权限,使用GRANT语句。

mysql:blob和其他无-SQL存储,有什么区别?mysql:blob和其他无-SQL存储,有什么区别?May 13, 2025 am 12:14 AM

mysql'sblobissuitableForStoringBinaryDataWithInareLationalDatabase,而alenosqloptionslikemongodb,redis和calablesolutionsoluntionsoluntionsoluntionsolundortionsolunsolunsstructureddata.blobobobsimplobissimplobisslowderperformandperformanceperformancewithlararengelitiate;

mySQL添加用户:语法,选项和安全性最佳实践mySQL添加用户:语法,选项和安全性最佳实践May 13, 2025 am 12:12 AM

toaddauserinmysql,使用:createUser'username'@'host'Indessify'password'; there'showtodoitsecurely:1)choosethehostcarecarefullytocon trolaccess.2)setResourcelimitswithoptionslikemax_queries_per_hour.3)usestrong,iniquepasswords.4)Enforcessl/tlsconnectionswith

MySQL:如何避免字符串数据类型常见错误?MySQL:如何避免字符串数据类型常见错误?May 13, 2025 am 12:09 AM

toAvoidCommonMistakeswithStringDatatatPesInMysQl,CloseStringTypenuances,chosethirtightType,andManageEngencodingAndCollat​​ionsEttingsefectery.1)usecharforfixed lengengters lengengtings,varchar forbariaible lengength,varchariable length,andtext/blobforlabforlargerdata.2 seterters seterters seterters seterters

See all articles

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

Video Face Swap

Video Face Swap

使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章

热工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

安全考试浏览器

安全考试浏览器

Safe Exam Browser是一个安全的浏览器环境,用于安全地进行在线考试。该软件将任何计算机变成一个安全的工作站。它控制对任何实用工具的访问,并防止学生使用未经授权的资源。

SublimeText3 英文版

SublimeText3 英文版

推荐:为Win版本,支持代码提示!

PhpStorm Mac 版本

PhpStorm Mac 版本

最新(2018.2.1 )专业的PHP集成开发工具