首页 > 系统相关 >CentOS 7 部署 HDP 3.3.1

CentOS 7 部署 HDP 3.3.1

时间:2023-03-10 12:15:43浏览次数:46  
标签:ambari log CentOS HDP buffer innodb 3.3 mysql size

一、环境

服务器名称 配置 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
  二、服务器初始化   1、配置服务器之间免密登录
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、安装httpd
yum -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

相关文章

  • 在centos7启动多用户vncserver失败(dbus连接异常)
    前言最近在一台60个用户的centos7上启动vncserver,当启动到第46个用户的时候就会开始启动失败,而且系统也会开始卡顿。比如用su-user切换用户时会卡很久。寻找原因我开......
  • 2023.3.7 每日三题
    1、业务负责人要求项目经理提供最小可行产品(MVP)的估计成本。为了获得这个项目的正式批准,需要估计成本。项目经理应该如何报告这个成本?A.确定控制账户并使用顶部估算。B.......
  • 升级openssl for Centos
     下载wgethttps://www.openssl.org/source/openssl-1.1.1t.tar.gz 解压tar-zxvfopenssl-1.1.1t.tar.gz 编译cdopenssl-1.1.1t./config--prefix=/usr......
  • 安装python3 for Centos
     以安装3.7.5为例下载安装包wgethttp://npm.taobao.org/mirrors/python/3.7.5/Python-3.7.5.tar.xz 解压xz-dPython-3.7.5.tar.xztar-xfPython-3.7.5.tar......
  • 在CentOS中用Linux命令行测试网速/带宽安装
    导读在使用Centos的时候,有没有想过,如果不用测速网站的话,如何测试网络速度呢?下面分享一个使用speedtest的方法。安装speedtest-clispeedtest-cli是一个用Python编......
  • CentOS7 安装 docker
    CentOS7安装卸载docker查看内核版本,需要3.10以上uname-r更新yum软件包索引yummakecachefast卸载旧版本yumremovedocker\docker-cli......
  • day09(2023.3.9)
    1.继承和组合 2.Object类和toString方法 运行结果:3."=="和equals方法 运行结果: 4.super 运行结果: 5.继承树追溯 运行结果: 6.封装 测试类......
  • CentOS7 配置动态ip
    [root@FortA]#vim/etc/sysconfig/network-scripts/ifcfg-ens32 #修改网卡配置信息TYPE="Ethernet"PROXY_METHOD="none"BROWSER_ONLY="no"BOOTPROTO="dhcp"DEFROU......
  • CentOS7 配置静态ip
    修改启动协议BOOTPROTO=static根据大家自己的环境,ip地址可能略有不同。接下来重启网络服务systemctlrestartnetwork重启之后xshell可能无响应,这是因为ip变了,公网DN......
  • 2023.3.9
    学习时间:2小时代码行数:200行今天学习了python的相关知识,Python进制函数,常见的有bin()#二进制,二进制数字格式为0b**,oct()#八进制,八进制数字格式为0o**,hex()#十六进制......