//雪花飘落特效 //右上角github跳转   

cdh6.1.0集群扩容datanode节点

一、节点初始化

新增一下节点到集群

172.25.186.201 recbd14.hwwt2.com

172.25.186.202 recbd15.hwwt2.com

1.1检查系统版本

[root@recbd14 ~]# cat /etc/redhat-release

CentOS Linux release 7.8.2003 (Core)

1.2检查内核版本

[root@recbd14 ~]# uname -r

3.10.0-1127.el7.x86_64

1.3检查磁盘信息

 

 

 

 

磁盘划分步骤,以/dev/sdb为例:
parted /dev/sdb
mklabel gpt
mkpart primary 0% 100%
set 1 lvm on
p
quit
partprobe
mkfs –t xfs /dev/sdb1  #格式化
pvcreate /dev/sdb1
#pvs   #查看创建的物理卷
vgcreate vg_data /dev/sdb1
#vgs      #查看存在的卷组
#lvcreate -L 10T -n lv_app vg_data    #创建逻辑卷
#lvs   #可以查看有哪些逻辑卷组

 

 

1.4检查网络

[root@recbd14 ~]# ping 172.25.201.38  #测试到控制节点网络连通

 

 

1.5ssh免密:

登录:172.25.201.38
ssh-copy-id 172.25.186.201
ssh-copy-id 172.25.186.202
验证:ssh 节点名称

 

1.6各节点添加hosts

[root@recbd1 ~]# tee /etc/hosts <<-'EOF'
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
#172.25.138.35   KSSHHVI10025.yumc.it KSSHHVI10025
172.25.138.74 recbdms1.hwwt2.com
172.25.138.75 recbdms2.hwwt2.com
172.25.201.38 recbd1.hwwt2.com
172.25.201.39 recbd2.hwwt2.com
172.25.201.40 recbd3.hwwt2.com
172.25.201.41 recbd4.hwwt2.com
172.25.201.42 recbd5.hwwt2.com
172.25.201.43 recbd6.hwwt2.com
172.25.201.44 recbd7.hwwt2.com
172.25.201.45 recbd8.hwwt2.com
172.25.201.46 recbd9.hwwt2.com
172.25.186.195 recbd10.hwwt2.com
172.25.186.196 recbd11.hwwt2.com
172.25.186.197 recbd12.hwwt2.com
172.25.186.198 recbd13.hwwt2.com
172.25.186.201 recbd14.hwwt2.com
172.25.186.202 recbd15.hwwt2.com
EOF

 

1.7关闭防火墙

systemctl stop firewalld.service

systemctl disable firewalld

 

 

 

1.8关闭selinux             

setenforce 0                                   

sed -i "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

 

1.9配置ntp时间同步:

crontab -e

*/1 * * * * /usr/sbin/ntpdate ntp.yumc.it > /dev/null 2>&1

 

 

1.10DNS配置:

[root@recbd1 ~]# cat /etc/resolv.conf
nameserver 172.18.80.13
nameserver 172.18.80.14

 

 

 

 

1.11修改主机名称:

hostnamectl set-hostname  recbd14.hwwt2.com
hostnamectl set-hostname  recbd15.hwwt2.com

 

 

 

1.12大内存页禁用:

echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled

编辑/etc/rc.d/rc.local,添加
chmod +x /etc/rc.d/rc.local

 

1.13limits修改:

[root@recbd13 ~]# tee /etc/security/limits.conf <<-'EOF'

# /etc/security/limits.conf
#
#This file sets the resource limits for the users logged in via PAM.
#It does not affect resource limits of the system services.
#
#Also note that configuration files in /etc/security/limits.d directory,
#which are read in alphabetical order, override the settings in this
#file in case the domain is the same or more specific.
#That means for example that setting a limit for wildcard domain here
#can be overriden with a wildcard setting in a config file in the
#subdirectory, but a user specific setting here can be overriden only
#with a user specific setting in the subdirectory.
#
#Each line describes a limit for a user in the form:
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - a user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open file descriptors
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#
#<domain>      <type>  <item>         <value>

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20

#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4

* soft nproc 65536
* hard nproc 65536
* soft nofile 65536
* hard nofile 65536
# End of file
EOF

 

[root@recbd13 ~]# tee /etc/security/limits.d/20-nproc.conf <<-'EOF'
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.
 
*          soft    nproc     4096
root       soft    nproc     unlimited
EOF

 

[root@recbd13 limits.d]# cat cloudera-scm.conf    #部署自动生成配置,后期需要修改
#
# (c) Copyright 2014 Cloudera, Inc.
#
cloudera-scm    soft  nofile  655350
cloudera-scm    soft  nproc   65536
cloudera-scm    hard  nofile  1048576
cloudera-scm    hard  nproc   unlimited
cloudera-scm    hard  memlock unlimited

 

 

 

1.14内核参数修改:

 编辑/etc/sysctl.conf文件:

[root@recbd13 ~]# tee /etc/sysctl.conf  <<-'EOF'
# sysctl settings are defined through files in
# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.
#
# Vendors settings live in /usr/lib/sysctl.d/.
# To override a whole file, create a new file with the same in
# /etc/sysctl.d/ and put new settings there. To override
# only specific settings, add a file with a lexically later
# name in /etc/sysctl.d/ and put new settings there.
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
#
fs.nr_open = 5242880
fs.file-max = 4194304
kernel.core_uses_pid = 1
kernel.msgmax = 1048560
kernel.msgmnb = 1073741824
kernel.shmall = 4294967296
kernel.shmmax = 68719476736
kernel.sysrq = 0
net.core.netdev_max_backlog = 1048576
net.core.rmem_default = 2097152
net.core.rmem_max = 16777216
net.core.somaxconn = 1048576
net.core.wmem_default = 2097152
net.core.wmem_max = 16777216
net.ipv4.conf.default.accept_source_route = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.ip_forward = 1
net.ipv4.ip_local_port_range = 1024 65533
net.ipv4.neigh.default.gc_thresh1 = 10240
net.ipv4.neigh.default.gc_thresh2 = 40960
net.ipv4.neigh.default.gc_thresh3 = 81920
net.nf_conntrack_max = 819200
net.netfilter.nf_conntrack_max = 819200
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 120
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 120
net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_intvl = 15
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_max_syn_backlog = 1048576
net.ipv4.tcp_max_tw_buckets = 60000
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_orphan_retries = 3
net.ipv4.tcp_reordering = 5
net.ipv4.tcp_retrans_collapse = 0
net.ipv4.tcp_retries2 = 5
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_sack = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_wmem = 4096 16384 4194304
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
vm.swappiness = 0
net.ipv4.tcp_low_latency = 1
vm.max_map_count = 655360
EOF

 

修改后执行sysctl -p命令

 

1.15yum源配置:

 

cd /etc/yum.repos.d && scp CentOS-Base.repo  172.25.186.201:/etc/yum.repos.d/

 

 

1.16java安装:

登录:172.25.201.38

cd /opt
scp jdk-8u191-linux-x64.tar.gz  172.25.186.201:/opt/
ln -s /opt/jdk1.8.0_191 /usr/java/jdk1.8.0_191

/etc/profile 末尾新增
export JAVA_HOME=/usr/java/jdk1.8.0_191
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=/usr/local/bin:$PATH

 

1.17安装依赖包

yum -y install python-psycopg2 iproute

 

 

二、添加主机及部署datanode

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

观察一天没有任何异常,做数据均衡:

 

 

posted @ 2020-12-08 15:24  农夫运维  阅读(770)  评论(0)    收藏  举报