一、环境
服务器名称 | 配置 | IP地址 | 备注 |
hdp-161-141 | 8核/16G内存/300G SSD硬盘 | 10.32.161.141 | MGR/Agent |
hdp-161-142 | 8核/16G内存/300G SSD硬盘 | 10.32.161.142 | Agent |
hdp-161-143 | 8核/16G内存/300G SSD硬盘 | 10.32.161.143 | Agent |
ssh-keygen -q -N '' ssh-copy-id 10.32.161.141 ssh-copy-id 10.32.161.142 ssh-copy-id 10.32.161.143 #不知道root密码的情况 复制当前主机/root/.ssh/id_rsa.pub的内容到其他主机的authorized_keys文件
2、主机名配置
hostnamectl set-hostname hdp-161-141 #其他主机参照设置,注意主机名称 # vim /etc/hosts 10.32.161.141 hdp-161-141 10.32.161.142 hdp-161-142 10.32.161.143 hdp-161-143
3、优化
# vim /etc/rc.local echo never > /sys/kernel/mm/transparent_hugepage/enabled echo never > /sys/kernel/mm/transparent_hugepage/defrag # vim /etc/sysctl.conf vm.swappiness = 10
三、数据库准备
1、部署数据库设置repo源 yum -y install http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm ---------------------------------------- 安装MySQL yum install -y mysql-community-server ---------------------------------------- 配置MySQL if [ ! "$(cat /usr/bin/mysqld_pre_systemd | grep -v ^\# | grep initialize-insecure )" ]; then sed -i "s@--initialize @--initialize-insecure @g" /usr/bin/mysqld_pre_systemd fi ---------------------------------------- 配置文件修改 # vim /etc/my.cnf [client] port = 3306 socket = /var/lib/mysql/mysql.sock default-character-set = utf8mb4 [mysql] prompt="MySQL [\d]> " no-auto-rehash [mysqld] port = 3306 socket = /var/lib/mysql/mysql.sock datadir = /var/lib/mysql/ pid-file = /var/run/mysqld/mysqld.pid user = mysql bind-address = 0.0.0.0 server-id = 1 init-connect = 'SET NAMES utf8mb4' character-set-server = utf8mb4 skip-name-resolve #skip-networking back_log = 300 max_connections = 3783 max_connect_errors = 6000 open_files_limit = 65535 table_open_cache = 1024 max_allowed_packet = 500M binlog_cache_size = 1M max_heap_table_size = 8M tmp_table_size = 128M read_buffer_size = 2M read_rnd_buffer_size = 8M sort_buffer_size = 8M join_buffer_size = 8M key_buffer_size = 256M thread_cache_size = 64 query_cache_type = 1 query_cache_size = 64M query_cache_limit = 2M ft_min_word_len = 4 log_bin = mysql-bin binlog_format = row expire_logs_days = 7 log_error = /var/log/mysqld.log slow_query_log = 1 long_query_time = 1 slow_query_log_file = /var/lib/mysql/slow.log performance_schema = 0 explicit_defaults_for_timestamp lower_case_table_names = 1 skip-external-locking default_storage_engine = InnoDB #default-storage-engine = MyISAM innodb_file_per_table = 1 innodb_open_files = 500 innodb_buffer_pool_size = 1024M innodb_write_io_threads = 4 innodb_read_io_threads = 4 innodb_thread_concurrency = 0 innodb_purge_threads = 1 innodb_flush_log_at_trx_commit = 2 innodb_log_buffer_size = 2M innodb_log_file_size = 32M innodb_log_files_in_group = 3 innodb_max_dirty_pages_pct = 90 innodb_lock_wait_timeout = 120 bulk_insert_buffer_size = 8M myisam_sort_buffer_size = 64M myisam_max_sort_file_size = 10G myisam_repair_threads = 1 interactive_timeout = 28800 wait_timeout = 28800 binlog_rows_query_log_events = 1 log_bin_trust_function_creators = 1 log_timestamps = SYSTEM sql_mode = NO_AUTO_VALUE_ON_ZERO [mysqldump] quick max_allowed_packet = 500M [myisamchk] key_buffer_size = 256M sort_buffer_size = 8M read_buffer = 4M write_buffer = 4M ---------------------------------------- 启动MySQL systemctl enable mysqld --now ---------------------------------------- 配置root密码 > update mysql.user set authentication_string=password('Demo2@22-#') where User='root'; > flush privileges; 或者可以通过自动的安全配置工具设置 # mysql_secure_installation
2、创建数据库及用户和权限
CREATE DATABASE ambari; GRANT ALL ON ambari.* TO 'ambari'@'10.32.161.%' IDENTIFIED BY 'Demo@123';
四、准备HDP程序
1、安装httpdyum -y install httpd createrepo rm -f /etc/httpd/conf.d/welcome.conf
2、修改/etc/httpd/conf/httpd.conf
vim /etc/httpd/conf/httpd.conf ServerName localhost:80 #95行 AllowOverride All #151行 DirectoryIndex index.html index.cgi index.php #164行 ServerTokens Prod #最后添加
3、启动服务
systemctl enable httpd --now
4、上传HDP压缩包至/var/www/html目录并解压
mkdir /var/www/html/{ambari,hdp,hdp-utils} -p tar xf ambari-2.7.6.3-centos7_8-x86_64.tar.gz -C /var/www/html/ambari tar xf HDP-3.3.1.0-001-centos7_8-x86_64.tar.gz -C /var/www/html/hdp tar xf HDP-UTILS-1.1.0.22-centos7_8-x86_64.tar.gz -C /var/www/html/hdp-utils chown -R apache.apache /var/www/html
五、安装Ambari
1、配置安装源# vim /etc/yum.repos.d/ambari.repo [ambari] name=ambari baseurl=http://10.32.161.141/ambari/2.7.6.3-0/ enabled=1 gpgcheck=0
2、安装jdk及Ambari Server
yum localinstall /usr/local/src/jdk-8u181-linux-x64.rpm -y #所有主机都需要安装 mkdir /usr/share/java -p cp mysql-connector-java-8.0.18.jar /usr/share/java/mysql-connector-java.jar #所有主机 yum install -y ambari-server
3、初始化并启动服务
ambari-server setup --jdbc-db=mysql --jdbc-driver=/usr/share/java/mysql-connector-java.jar ambari-server start
4、 Ambari Agent安装、配置和启动
# 所有Agent节点安装 # yum install -y ambari-agent # vi /etc/ambari-agent/conf/ambari-agent.ini [server] hostname=hdp-161-141 # 将localhost修改为hdp-161-141 # 启动 ambari-agent start
六、服务集群部署 1、控制台
http://10.32.161.141:8080/ 默认账号:admin 默认密码:admin
参考:https://mp.weixin.qq.com/s/KrhgKnbca1IuSR65UcbCzQ
标签:ambari,log,CentOS,HDP,buffer,innodb,3.3,mysql,size From: https://www.cnblogs.com/a120608yby/p/17199480.html