Ambari 3.0+BigTop 3.3集群部署实战
一、Ambari+BigTop1.1 Ambari+BigTop概述1.2架构概览1.3设计思想二、集成组件三、环境准备3.1 、服务器3.2 、主机名映射配置hostscat/etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.100.37test-car-hadoop01 192.168.100.38test-car-hadoop02 192.168.100.39test-car-hadoop03 192.168.100.30test-car-hadoop04 192.168.100.31test-car-hadoop05 192.168.100.32test-car-hadoop06配置/etc/ansible/ansible.cfg[defaults]inventory =/etc/ansible/hosts remote_user = root host_key_checking = False log_path =/var/log/ansible.log deprecation_warnings = False forks = 50 timeout = 10[privilege_escalation]become = True become_method = sudo become_user = root become_ask_pass = False配置/etc/ansible/hosts[cluster]test-car-hadoop01test-car-hadoop02test-car-hadoop03test-car-hadoop04test-car-hadoop05test-car-hadoop06验证ansible cluster-m ping ansible cluster-mcopy-a"src=/etc/hosts dest=/etc/"3.3 、关闭防火墙systemctl stop firewalld systemctl disable firewalld systemctl status firewalld3.4 、集群免密配置免密ssh-keygen-t rsa-P''-f ~/.ssh/id_rsacat~/.ssh/id_rsa.pub ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys密钥分发ssh-copy-id-o StrictHostKeyChecking=no root@test-car-hadoop01 ssh-copy-id-o StrictHostKeyChecking=no root@test-car-hadoop02 ssh-copy-id-o StrictHostKeyChecking=no root@test-car-hadoop03 ssh-copy-id-o StrictHostKeyChecking=no root@test-car-hadoop04 ssh-copy-id-o StrictHostKeyChecking=no root@test-car-hadoop05 ssh-copy-id-o StrictHostKeyChecking=no root@test-car-hadoop06# 验证ssh root@test-car-hadoop02echo"Connection successful"3.5 、ulimits设置cat'LIMIT'|sudotee/etc/security/limits.d/90-nproc.conf /dev/null*soft nproc 655350*hard nproc 655350 LIMITcat'DEF'|sudotee/etc/security/limits.d/def.conf /dev/null*soft nproc 655350*hard nproc 655350 DEFcat'EOF'|sudotee/etc/security/limits.conf /dev/null# End of file*soft nofile 65536*hard nofile 65536*soft nproc 131072*hard nproc 131072 EOF3.6 、ssh服务安装opensshdnf install openssh-server-y systemctlstartsshd systemctl enable sshd systemctl status sshd修改配置/etc/ssh/sshd_configListenAddress 0.0.0.0# 确保非 127.0.0.1Port 22# 默认端口# PermitRootLogin 设置为yesPermitRootLogin yes# 开启使用用户名密码验证连接PasswordAuthentication yes重启 sshsystemctl restart sshd3.7 、安全设置# Temporarily disable SELinuxsetenforce 0# Permanently disable SELinuxsed-i's/SELINUX=enforcing/SELINUX=disabled/g'/etc/selinux/config3.8 、禁用透明大页cat'EOF'|sudotee-a/etc/rc.d/rc.local /dev/null# 关闭透明大页 THPiftest-f/sys/kernel/mm/transparent_hugepage/enabled;thenechonever /sys/kernel/mm/transparent_hugepage/enabled fiiftest-f/sys/kernel/mm/transparent_hugepage/defrag;thenechonever /sys/kernel/mm/transparent_hugepage/defrag fi EOF赋权chmod+x/etc/rc.d/rc.local验证cat/sys/kernel/mm/transparent_hugepage/defrag;cat/sys/kernel/mm/transparent_hugepage/enabled3.9 、sysctl.conf优化追加配置cat'EOF'|sudotee-a/etc/sysctl.conf fs.file-max = 6553600 vm.max_map_count = 2000000 vm.swappiness = 0 net.core.somaxconn = 65535 EOF立即生效sysctl-p3.10 、时间同步# 安装yum-y install chrony# 启动systemctlstartchronyd修改硬件时钟为UTC,时区为本地时区# 硬件时钟设置为UTCtimedatectlset-local-rtc 0# 设置本地时区,显示本地时间timedatectlset-timezoneAsia/Shanghai# 手动加载RTC设置hwclock--systohc# 设置ntp为truetimedatectlset-ntptrue3.11 、部署jdkjdk1.8vi/etc/profile# jdkexport JAVA_HOME=/usr/java/jdk1.8.0_202 export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$PATH:$JAVA_HOME/binjdk17tar-zxf jdk-17.0.8_linux-x64_bin.tar.gz-C/usr/java3.12 、基础软件dnf install-y epel-release dnf config-manager--set-enabledpowertools dnf makecache--refresh" dnf-y install chrony asciidoc autoconf automake bzip2-devel cmake cppunit-devel cyrus-sasl-devel fuse fuse-devel gcc gcc-c++krb5-devel libtirpc-devel libtool libxml2-devel lsof lzo-devel make net-tools openssl-devel protobuf-devel python3 rpm-build rsync snappy-devel wget zlib-devel treepython环境# 防止python命令报错ln-s/usr/bin/python3/usr/bin/python3.13 、swap关闭sed-i'/ swap / s/^\(.*\)$/#\1/g'/etc/fstab sudo swapoff-a3.14 、umask设置if![[$(umask)== 0022]];thenechoumask 0022 /etc/profile source/etc/profile;fi3.15 、主机名设置hostnamectlset-hostname$(cat/etc/hosts|grep `hostname-I`|awk'{print $2}') bash3.16 、部署MariaDBMariaDB 10.11 YUM 源sudotee/etc/yum.repos.d/mariadb.repo 'EOF'[mariadb]name = MariaDB baseurl = https://mirrors.aliyun.com/mariadb/yum/10.11/rocky8-amd64/ gpgkey = https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck = 1 enabled = 1 module_hotfixes = 1 EOF dnf clean all dnf makecache部署MariaDB服务端与客户端# 避免冲突,先卸载老版本残留dnf remove-y mariadb mariadb-server mariadb-libs# 部署MariaDBdnf install-y MariaDB-server MariaDB-client# 验证mariadb--version# mariadb Ver 15.1 Distrib 10.11.16-MariaDB, for Linux (x86_64) using readline 5.1配置字符集、性能参数与远程访问vi /etc/my.cnf[client]default-character-set=utf8mb4[mysqld]user=mysql port=3306 basedir=/usr datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock pid-file=