您的位置:首页 > 运维架构 > Linux

大数据平台Linux基础环境配置

2017-11-09 17:40 537 查看

大数据平台Linux基础环境配置

公司的大数据平台是在基于Apache开源版本自研发的,用的组件很多,包括但不限于Apache Hadoop,HBase,Hive,Spark,Kafka,Flume,Storm,Druid,ElasticSearch ,多种不同版本的组件组合在一起用于数据量庞大的生产环境,首先需要的就是在Linux基础环境上做一些必要的调整,下面就来说一说,做了哪些基础性的性能调整。我们Linux用的是CentOS6.5版本

大数据平台Linux基础环境配置
时间同步

字符设置

关闭防火墙abrtd服务

安装需要的软件包

Huge Page

关闭SELinux

关闭coredump

文件句柄限制

端口预留

网卡配置

时间同步

为了保证集群节点在时间上一致,在每个节点crontab中设置时间同步任务

如果节点时间不一致,会导致很多奇怪的问题,甚至导致数据不一致。

30 * * * * /usr/sbin/ntpdate 192.168.*.*


字符设置

将字符设置成UTF-8,避免对中文不兼容

sed -i 's/LANG=.*/LANG=en_US.UTF-8/g' /etc/sysconfig/i18n


关闭防火墙,abrtd服务

(系統)abrtd 服務可以提供使用者一些方式,讓使用者可以針對不同的應用軟體去設計錯誤登錄的機制, 當軟體產生問題時,使用者就可以根據 abrtd 的登錄檔來進行錯誤克服的行為。還有其他的 abrt-xxx.service 均是使用這個服務來加強應用程式 debug 任務的。 ——————-鸟哥

关闭iptables
chkconfig iptables off
service iptables stop
service iptables status

关闭abrtd
chkconfig abrtd off
service abrtd stop
service abrtd status


安装需要的软件包

yum -y install gcc python perl php make smartmontools iotop expect nc net-snmp ifstat


Huge Page

echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag
echo 'echo never > /sys/kernel/mm/redhat_transparent_hugepage/defrag' >> /etc/rc.local


关闭SELinux

sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config


关闭coredump

if grep 'ulimit -S -c 0 > /dev/null 2>&1' /etc/profile
then
echo "already exists in /etc/profile."
else
echo 'ulimit -S -c 0 > /dev/null 2>&1' >> /etc/profile
fi


文件句柄限制

cat > /etc/security/limits.d/90-nproc.conf << EOF
*       -    nproc    20480
*       -    nofile    32768
EOF


端口预留

if grep 'net.ipv4.ip_local_reserved_ports' /etc/sysctl.conf
then
echo "already exists in /etc/sysctl.conf."
else
cat >> /etc/sysctl.conf << EOF
net.ipv4.ip_local_reserved_ports=2181,2888,3772-3773,3888,6627,7000,8000,8021,8030-8033,8088-8089,8360,9000,9010-9011,9090,9160,9999,10009,10101-10104,11469,21469,24464,50010,50020,50030,50060,50070,50075,50090,60000,60010,60020,60030
net.ipv4.ip_local_port_range = 10000 65000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.core.somaxconn=32768
vm.swappiness=0
vm.overcommit_memory=1
EOF
sysctl -p
fi


网卡配置

增加 ring buffer ,减少overrun出现

ethtool -G eth0 rx 4096 tx 4096
ethtool -G eth2 rx 4096 tx 4096


以上的命令脚本稍微整理一下就可以当作一个配置脚本去使用,在需要机器扩容或者新搭建集群的时候,用该脚本跑一下,可以迅速配置好Linux的基础环境。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  大数据 linux hadoop