{"id":12746,"date":"2022-09-23T17:23:21","date_gmt":"2022-09-23T09:23:21","guid":{"rendered":"http:\/\/gulass.cn\/?p=12746"},"modified":"2022-09-23T17:23:38","modified_gmt":"2022-09-23T09:23:38","slug":"centos-reduce-hadoop","status":"publish","type":"post","link":"https:\/\/gulass.cn\/centos-reduce-hadoop.html","title":{"rendered":"Centos\u4f18\u5316Hadoop"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nHadoop\u662f\u4e00\u4e2a\u80fd\u591f\u8ba9\u7528\u6237\u8f7b\u677e\u67b6\u6784\u548c\u4f7f\u7528\u7684\u5206\u5e03\u5f0f\u8ba1\u7b97\u5e73\u53f0\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5730\u5728Hadoop\u4e0a\u5f00\u53d1\u548c\u8fd0\u884c\u5904\u7406\u6d77\u91cf\u6570\u636e\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u672c\u8282\u8bb2\u5b89\u88c5\u5e76\u4e14\u4f18\u5316centos 6.7 \u7cfb\u7edf\u4e0b\u7684Supper Hadoop\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"cetos-hadoop\"<\/p>\n

1\u3001\u7cfb\u7edf\u5b89\u88c5\u7c7b\u578b\u9009\u62e9\u53ca\u81ea\u5b9a\u4e49\u989d\u5916\u5305\u7ec4<\/strong><\/div>\n

\u8fdb\u5165\u5982\u56fe 1-1 \u6240\u793a\u754c\u9762\u3002 \u4e0a\u534a\u90e8\u5206\u662f\u7cfb\u7edf\u5b9a\u5236\u7684\u4e0d\u540c\u7684\u7cfb\u7edf\u5b89\u88c5\u7c7b\u578b\u9009\u62e9\u9879\uff0c\u9ed8\u8ba4\u662f\u201c Desktop\u201d\uff0c\u8fd9\u91cc\u6211\u4eec\u9009\u62e9\u201c Minimal\u201d\uff0c\u5373\u6700\u5c0f\u5316\u5b89\u88c5\uff0c\u4e0b\u534a\u90e8\u5206\u662f\u5728\u4e0a\u9762\u7cfb\u7edf\u5b89\u88c5\u7c7b\u578b\u786e\u5b9a\u540e\uff0c \u989d\u5916\u60f3\u6dfb\u52a0\u7684\u8f6f\u4ef6\u5305\u7ec4\u9009\u62e9\u9879\uff0c\u6211\u4eec\u9009\u62e9\u201c Customize now\u201d\u5373\u7acb\u5373\u81ea\u5b9a\u4e49\u3002<\/p>\n

\"\"<\/p>\n

\u56fe 1-1 \u7cfb\u7edf\u5b89\u88c5\u5305\u7c7b\u578b\u9009\u62e9\u53ca\u81ea\u5b9a\u4e49\u989d\u5916\u5305\u7ec4\u3002
\n\u5728\u4e0b\u56fe 1-2 \u7684\u81ea\u5b9a\u4e49\u989d\u5916\u7684\u5305\u7ec4\u754c\u9762\uff0c\u6211\u4eec\u9996\u5148\u9700\u8981\u9009\u62e9\u5de6\u8fb9\u7684\u5927\u7684\u5206\u7c7b\uff0c\u7136\u540e\u5728\u52fe\u9009\u53f3\u8fb9\u5bf9\u5e94\u7684\u5c0f\u7684\u5305\u7ec4\u3002\u6ce8\u610f\uff1a\u53f3\u8fb9\u5c0f\u5305\u7ec4\u91cc\u7684\u5185\u5bb9\u9ed8\u8ba4\u5373\u53ef\uff0c\u9009\u62e9\u7ed3\u679c\u5982\u56fe\uff081\uff09\u3001\u56fe\uff082\uff09\u6240\u793a\u3002
\n\"\"<\/p>\n

\u56fe 1-2 \u81ea\u5b9a\u4e49\u5b89\u88c5\u5305\u7ec4\u9009\u62e9\u754c\u9762I<\/p>\n

\"\"<\/p>\n

1.1 \u6839\u636e\u7ecf\u9a8c\uff0c\u9009\u62e9\u5b89\u88c5\u5305\u65f6\u5e94\u8be5\u6309\u6700\u5c0f\u5316\u539f\u5219\uff0c\u5373\u4e0d\u9700\u8981\u7684\u6216\u8005\u4e0d\u786e\u5b9a\u662f\u5426\u9700\u8981\u7684\u5c31\u4e0d\u5b89\u88c5\uff0c\u8fd9\u6837\u53ef\u4ee5\u6700\u5927\u7a0b\u5ea6\u4e0a\u786e\u4fdd\u7cfb\u7edf\u5b89\u5168\u3002<\/strong><\/span><\/div>\n
1.2 \u5982\u679c\u5b89\u88c5\u8fc7\u7a0b\u843d\u4e86\u90e8\u5206\u5305\u7ec4\u6216\u8005\u5176\u4ed6\u4f19\u4f34\u5b89\u88c5\u65f6\u6ca1\u9009<\/strong><\/span><\/div>\n

\u5b89\u88c5\u540e\u53ef\u4ee5\u6309\u5982\u4e0b\u65b9\u5f0f\u8865\u4e0a\u5b89\u88c5\u65f6\u672a\u5b89\u88c5\u7684\u5305\u7ec4\uff1a<\/p>\n

yum groupinstall \"Compatibility libraries\" \"Base\" \"Development tools\"\r\nyum groupinstall \"debugging Tools\" \"Dial-up Networking Support\"\r\n<\/pre>\n

\u53ef\u4ee5\u901a\u8fc7 yum groupinfo \u5305\u7ec4\u67e5\u770b\u5177\u4f53\u5b89\u88c5\u7684\u7ec4\u4ef6\u3002<\/p>\n

1.3 \u4e0b\u9762\u5b89\u88c5 6.7 \u540e\u767b\u9646\u7cfb\u7edf\u7684\u65f6\u5019\u67e5\u770b\u9009\u5305\u7684\u60c5\u51b5<\/strong><\/span><\/div>\n
yum grouplist:\r\nInstalled Groups:\r\nBase\r\nCompatibility libraries\r\nDebugging Tools\r\nDevelopment tools\r\nE-mail server\r\nGraphical Administration Tools\r\nHardware monitoring utilities\r\nLegacy UNIX compatibility\r\nNetworking Tools\r\nPerformance Tools\r\nPerl Support\r\nScientific support\r\nSecurity Tools\r\n<\/pre>\n

\u53ef\u4ee5\u770b\u5230\u9664\u4e86\u6211\u4eec\u9009\u62e9\u7684\u5916\uff0c\u7cfb\u7edf\u8fd8\u662f\u9ed8\u8ba4\u5b89\u88c5\u4e86\u4e00\u4e9b\u5fc5\u987b\u7684\u8f6f\u4ef6\u5305\u7ec4\u3002<\/p>\n

2\u3001\u7f51\u7edc\u8bbe\u7f6e<\/strong><\/div>\n
[root@centos ~]# cat \/etc\/sysconfig\/network-scripts\/ifcfg-eth0 \r\nDEVICE=eth0\r\nHWADDR=00:0C:29:6D:58:E4\r\nTYPE=Ethernet\r\nUUID=5236fdbb-76ee-4f98-90cf-6bed4fb62661\r\nONBOOT=yes\r\nNM_CONTROLLED=yes\r\nBOOTPROTO=static\r\nIPADDR=192.168.2.200\r\nGATEWAY=192.168.2.1\r\nNETMASK=255.255.255.0<\/pre>\n
3\u3001Linux\u7cfb\u7edf\u4f18\u5316 Supper Hadoop
\n<\/strong><\/div>\n
3.1 \u73af\u5883\u68c0\u67e5<\/strong><\/span><\/div>\n

3.1.1 \u64cd\u4f5c\u7cfb\u7edf<\/p>\n

\t\r\n# cat \/etc\/redhat-release \r\nCentOS release 6.6 (Final)\r\n<\/pre>\n

3.1.2 \u6240\u6709\u4e3b\u673a\u80fd\u591f\u76f8\u4e92ping\u901a<\/p>\n

3.1.3 linux\u5185\u6838\u7248\u672c<\/p>\n

# uname -r\r\n2.6.32-504.el6.x86_64<\/pre>\n
3.2 \u6dfb\u52a0\u5b89\u88c5\u96c6\u7fa4\u7528\u6237&&\u5173\u95edselinux&&\u4fee\u6539Linux\u542f\u52a8\u7ea7\u522b\u4e3a3<\/strong><\/span><\/div>\n
useradd hadoop\r\necho \"hadoop123\"|passwd --stdin hadoop\r\nyum grouplist\r\nsed -i 's#SELINUX=enforcing#SELINUX=disabled#g' \/etc\/selinux\/config\r\nsetenforce 0\r\ngrep SELINUX=disabled \/etc\/selinux\/config\r\ngrep id:3:initdefault: \/etc\/inittab<\/pre>\n

\"\"<\/p>\n

3.3 \u4f18\u5316\u5f00\u673a\u81ea\u52a8\u542f\u52a8\u670d\u52a1&&\u589e\u5927\u6587\u4ef6\u63cf\u8ff0\u7b26(Hadoop\u5e76\u884c\u8bfb\u53d6\u6570\u636e\u6587\u4ef6)&&sudo\u6743\u9650\u7ba1\u7406
\n<\/strong><\/span><\/div>\n
chkconfig --list|grep 3:on |wc \u2013l\r\nchkconfig --list|grep 3:on | cut -d \" \" -f1  \r\nfor name in `chkconfig --list|grep 3:on | cut -d \" \" -f1` ;do chkconfig $name off;done\r\nchkconfig --list|grep 3:on\r\n\r\n#\u5982\u679c\u7cfb\u7edf\u57fa\u4e8elvm\u903b\u8f91\u5377\u7ba1\u7406\u9700\u8981\u5f00\u542flvm2-monitor blk-availability\u4e24\u4e2a\u670d\u52a1\r\nfor name in crond ntpd lvm2-monitor blk-availability network rsyslog sshd;do chkconfig $name on;done\r\n\r\niptables -L -n\r\n\/etc\/init.d\/iptables stop\r\niptables -L -n\r\nchkconfig --list|grep iptables\r\necho 'hadoop  ALL=(ALL)       NOPASSWD: ALL' >> \/etc\/sudoers\r\n\r\necho '* - nofile 65535' >>  \/etc\/security\/limits.conf\r\ntail -1  \/etc\/security\/limits.conf<\/pre>\n

\"\" <\/p>\n

3.4 \u914d\u7f6entp\u670d\u52a1\u5668\uff0c\u8ba9\u6240\u6709\u670d\u52a1\u5668\u65f6\u95f4\u4fdd\u6301\u4e00\u81f4\uff0c\u5982\u679c\u662f\u975e\u5185\u7f51\u670d\u52a1\u5668\u53ef\u4ee5\u76f4\u63a5\u5b89\u88c5\u542f\u52a8ntp<\/strong><\/span><\/div>\n
yum install htpd -y\r\n\/etc\/init.d\/ntpd start\r\nchkconfig ntpd on\r\n\r\n$ ntpq \u2013p  #\u516c\u7f51\u81ea\u52a8\u65f6\u95f4\u540c\u6b65<\/pre>\n

\u5982\u679c\u662f\u5185\u7f51\u670d\u52a1\u5668\uff0c\u9700\u8981\u914d\u7f6e\u4e00\u53f0ntp\u670d\u52a1\u5668\uff0c\u6240\u6709\u670d\u52a1\u5668\u5230ntp\u670d\u52a1\u5668\u5b9a\u671f\u540c\u6b65\u65f6\u95f4\uff0c\u5185\u7f51ntp\u670d\u52a1\u5668\u914d\u7f6e\uff1a<\/p>\n

vim \/etc\/ntp.conf\r\nrestrict default ignore   \/\/\u9ed8\u8ba4\u4e0d\u5141\u8bb8\u4fee\u6539\u6216\u8005\u67e5\u8be2ntp,\u5e76\u4e14\u4e0d\u63a5\u6536\u7279\u6b8a\u5c01\u5305\r\nrestrict 127.0.0.1        \/\/\u7ed9\u4e8e\u672c\u673a\u6240\u6709\u6743\u9650\r\nrestrict 192.168.2.0 mask 255.255.255.0 notrap nomodify  \/\/\u7ed9\u4e8e\u5c40\u57df\u7f51\u673a\u7684\u673a\u5668\u6709\u540c\u6b65\u65f6\u95f4\u7684\u6743\u9650\r\nserver  192.168.2.124   # local clock\r\ndriftfile \/var\/lib\/ntp\/drift\r\nfudge   127.127.1.0 stratum 10\r\n<\/pre>\n

ntpq -p \u67e5\u8be2\u7f51\u7edc\u4e2d\u7684NTP\u670d\u52a1\u5668\uff1a<\/p>\n

$ ntpq \u2013p<\/pre>\n

\u6240\u6709\u673a\u5668\u670d\u52a1\u5668\u9700\u8981\u548cntp\u670d\u52a1\u65f6\u95f4\u4fdd\u6301\u4e00\u81f4\uff1a<\/p>\n

$ ntpdate 192.168.1.124 #\u521a\u521a\u914d\u7f6e\u597dntp\u670d\u52a1\u5668,\u5927\u6982\u9700\u89815min\u540e\u624d\u80fd\u6b63\u5e38\u63d0\u4f9b\u670d\u52a1;\u62a5\u9519\"no server suitable for synchronization found\"<\/pre>\n

\u6240\u6709\u5927\u6570\u636e\u670d\u52a1\u5668\u8bbe\u7f6ecron\u540c\u6b65ntp\u670d\u52a1\u5668\u65f6\u95f4\uff1a<\/p>\n

\r\n$ crontab -l\r\n00 1 * * * root \/usr\/sbin\/ntpdate 192.168.1.124 >> \/root\/ntpdate.log 2>&1<\/pre>\n
3.5 \u5173\u95ed\u9632\u706b\u5899<\/strong><\/span><\/div>\n
\/etc\/init.d\/iptables status\r\n\/etc\/init.d\/iptables stop\r\nchkconfig iptables off<\/pre>\n
3.6 \u5173\u95edSwap<\/strong><\/span><\/div>\n
swapoff -a\r\n<\/pre>\n
3.7 Linux overcommit-memory<\/strong><\/span><\/div>\n
echo 0 > \/proc\/sys\/vm\/overcommit_memory<\/pre>\n
3.8 \u6240\u6709\u4e3b\u673a\u505a\u597dhosts ip\u6620\u5c04&&repo\u6587\u4ef6<\/strong><\/span><\/div>\n
# tail -6 \/etc\/hosts\r\n192.168.1.124 apache-server archive.cloudera.com archive-primary.cloudera.com\r\n\r\n192.168.1.201   server1\r\n192.168.1.202   server2\r\n192.168.1.203   server3\r\n192.168.1.204   server4<\/pre>\n

\u6240\u6709\u4e3b\u673a\u540c\u6b65hosts\u6587\u4ef6\u4e00\u81f4<\/p>\n

# scp -r \/etc\/hosts hostname:\/etc\/<\/pre>\n

\u6240\u6709\u4e3b\u673arepo\u6587\u4ef6\u540c\u6b65<\/p>\n

# scp -r CentOS-httpd.repo cloudera-cdh5.repo hostname:\/etc\/yum.repos.d\/<\/pre>\n
3.9 swappiness && transparent_hugepage<\/strong><\/span><\/div>\n
#sudo echo '0' > \/proc\/sys\/vm\/swappiness\r\n#sudo sysctl vm.swappiness=0\r\n\r\n#sudo echo '#by whoami 2015-10-30'>> \/etc\/sysctl.conf\r\n#sudo echo 'vm.swappiness=0'>> \/etc\/sysctl.conf\r\n\r\n# cat \/sys\/kernel\/mm\/redhat_transparent_hugepage\/defrag \r\n[always] never\r\n# echo never > \/sys\/kernel\/mm\/redhat_transparent_hugepage\/defrag\r\n# cat \/sys\/kernel\/mm\/redhat_transparent_hugepage\/defrag\r\nalways [never]\r\n\r\n# echo '#by whoami 2015-10-30'>> \/etc\/rc.local\r\n# echo 'echo never > \/sys\/kernel\/mm\/redhat_transparent_hugepage\/defrag ' >> \/etc\/rc.local<\/pre>\n
4\u3001\u514b\u9686\u865a\u62df\u673a<\/strong><\/div>\n

\u865a\u62df\u673aeth0\u65e0\u6cd5\u542f\u52a8\u89e3\u51b3\uff0c\u5176\u5b9e\u662f\u56e0\u4e3a\u514b\u9686\u540eMac\u5730\u5740\u4e00\u81f4\uff0c\u5bfc\u81f4\u51b2\u7a81\uff0c\u800c\u65e0\u6cd5\u542f\u52a8\uff0c\u62a5\u9519\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n

Bring up interface eth0: Device eth0 does not seem to be present,delaying initialization.\r\n<\/pre>\n

\u5220\u9664\u4e24\u9879ifcfg-eth0\u7684\u914d\u7f6e\uff0c\u91cd\u542f\u7cfb\u7edf\u5373\u53ef\uff1a<\/p>\n

rm -f \/etc\/udev\/rules.d\/70-persistent-net.rules<\/pre>\n

\u5220\u9664\uff0fetc\/sysconfig\/network-scripts\/ifcfg-eth0\u4e2d\uff0cHWADDR\u3001UUID\u4e24\u9879\u5185\u5bb9\uff0c\u91cd\u542f\u7f51\u5361\u5373\u53ef\u89e3\u51b3\u3002<\/p>\n

\uff0fetc\/init.d\/network restart<\/pre>\n
\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.itweet.cn\/2016\/05\/14\/Install-and-optimization-linux-system\/<\/a><\/p>\n

\u8f6c\u8f7d\u5730\u5740\uff1ahttp:\/\/toutiao.com\/a6284998343866761473\/?tt_from=mobile_qq&utm_campaign=client_share&app=news_article&utm_source=mobile_qq&iid=4261787993&utm_medium=toutiao_android<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/gulass.cn\/centos-reduce-hadoop.html<\/a>\u7f16\u8f91\uff1a\u9b4f\u4f1f\uff0c\u5ba1\u6838\u5458\uff1a\u51af\u632f\u534e<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb Hadoop\u662f\u4e00\u4e2a\u80fd\u591f\u8ba9\u7528\u6237\u8f7b\u677e\u67b6\u6784\u548c\u4f7f\u7528\u7684\u5206\u5e03\u5f0f\u8ba1\u7b97\u5e73\u53f0\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5730\u5728Hadoop\u4e0a\u5f00\u53d1\u548c\u8fd0\u884c\u5904\u7406 […]<\/p>\n","protected":false},"author":63,"featured_media":12785,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-12746","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/12746","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=12746"}],"version-history":[{"count":27,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/12746\/revisions"}],"predecessor-version":[{"id":253517,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/12746\/revisions\/253517"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/12785"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=12746"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=12746"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=12746"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}