192.168.210.133 node1 192.168.210.134 node2 192.168.210.135 node3 192.168.210.136 node4
vim /etc/sysconfig/network NETWORKING=yes HOSTNAME=node2
systemctl stop firewalld systemctl disable firewalld
先到幾臺機器分別生成密鑰:html
# 安裝ssh yum -y install openssh-clients rm -rf ~/.ssh/* ssh-keygen -t rsa # 一路回車,而後拷貝到受權文件
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh-copy-id -p 2121 root@node1
cat .ssh/authorized_keys
測試能夠免登陸就ok了。java
yum -y install ntp ntpdate cn.pool.ntp.org
組件 | 版本 |
---|---|
操做系統 | CentOS7 |
Ambari | 2.7.4 |
HDP | 3.1.4 |
MySQL | 5.7.25 |
OracleJDK11 | JDK11 build 11+28 |
https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.53322f70KNuobsnode
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
vi, /etc/sysconfig/selinux
修改文件中的SELINUX屬性 SELINUX=disabled
便可python
透明大頁面(THP)是一種Linux內存管理系統,經過使用更大的內存頁面,能夠減小具備大量內存的計算機上的Translation Lookaside Buffer(TLB)查找的開銷。可是,數據庫工做負載一般在THP上表現不佳,由於它們每每具備稀疏而不是連續的內存訪問模式。 您應該在Linux機器上禁用THP以確保使用MongoDB得到最佳性能。mysql
查詢THP狀態 cat /sys/kernel/mm/transparent_hugepage/defrag cat /sys/kernel/mm/transparent_hugepage/enabled
若結果爲 [always] 則表示啓動了THP linux
vim /etc/rc.d/rc.local
在文件末尾添加nginx
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi if test -f /sys/kernel/mm/transparent_hugepage/defrag; then echo never > /sys/kernel/mm/transparent_hugepage/defrag fi
並賦予rc.local文件執行權限sql
chmod +x /etc/rc.d/rc.local
重啓reboot後查看THP狀態,若結果顯示爲 [never] 則代表關閉成功 數據庫
設置最大文件描述符數,通常要求爲10000及以上。apache
ulimit -Sn ulimit -Hn
如若輸出小於10000,則將其設置爲10000
ulimit -n 10000
準備一臺mysql,utf8mb4格式的 建立ambari數據庫,一臺hive數據庫 各自準備用戶名密碼
#下載repo,製做本地鏡像(參照官方文檔的No Internet Access部分)
Ambari-2.7.4.0
下載 http://public-repo-1.hortonworks.com/ambari/centos7/2.x/updates/2.7.4.0/ambari-2.7.4.0-centos7.tar.gz (3.08 MB/s) - 已保存 「ambari-2.7.4.0-centos7.tar.gz」 (1.9G) 用時 10m 29s
hdp 3.1.4
下載HDP http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.4.0/HDP-3.1.4.0-centos7-rpm.tar.gz
再下載HDP-UTILS http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7/HDP-UTILS-1.1.0.22-centos7.tar.gz (7.88 MB/s) - 已保存 「HDP-3.1.4.0-centos7-rpm.tar.gz」 (8.9G) 用時 19m 11s
/etc/yum.repos.d/ambari.repo
目錄下,即/etc/yum.repos.d/ambari.repo
touch /etc/yum.repos.d/HDP.repo vim /etc/yum.repos.d/HDP.repo
添加內容以下
#VERSION_NUMBER=3.1.4.0-135 [HDP-3.1.4.0] name=HDP Version - HDP-3.1.4.0 baseurl=http://192.168.210.133/hdp/HDP/centos7 gpgcheck=1 gpgkey=http://192.168.210.133/hdp/HDP/centos7/3.1.4.0-315/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1 [HDP-UTILS-1.1.0.22] name=HDP-UTILS Version - HDP-UTILS-1.1.0.22 baseurl=http://192.168.210.133/hdp/HDP-UTILS gpgcheck=1 gpgkey=http://192.168.210.133/hdp/HDP-UTILS/centos7/1.1.0.22/RPM-GPG-KEY/RPM-GPG-KEY-Jenkins enabled=1 priority=1
scp -P2121 /etc/yum.repos.d/HDP.repo root@node4:/etc/yum.repos.d/ scp -P2121 /etc/yum.repos.d/ambari.repo root@node4:/etc/yum.repos.d/
vim /etc/yum/pluginconf.d/priorities.conf
[main] enabled=1 gpgcheck=0
yum repolist
安裝yum的相關工具
yum install yum-utils -y yum repolist yum install createrepo -y
yum install ambari-sever
[root@node1 main]# ambari-server setup --jdbc-db=mysql --jdbc-driver=/main/soft/mysql-connector-java-8.0.18.jar Using python /usr/bin/python Setup ambari-server Copying /main/soft/mysql-connector-java-8.0.18.jar to /var/lib/ambari-server/resources/mysql-connector-java-8.0.18.jar Creating symlink /var/lib/ambari-server/resources/mysql-connector-java-8.0.18.jar to /var/lib/ambari-server/resources/mysql-connector-java.jar If you are updating existing jdbc driver jar for mysql with mysql-connector-java-8.0.18.jar. Please remove the old driver jar, from all hosts. Restarting services that need the driver, will automatically copy the new jar to the hosts. JDBC driver was successfully initialized. Ambari Server 'setup' completed successfully.
mkdir -p /usr/share/java/ cp /main/soft/mysql-connector-java-8.0.18.jar /usr/share/java/ chmod 644 /usr/share/java/mysql-connector-java-8.0.18.jar
ambari-server setup
由於repo已經複製過去了,因此很快 yum install ambari-agent
http://public-repo-1.hortonworks.com/HDP/centos7/3.x/updates/3.1.4.0
修改成 http://192.168.210.133/hdp/HDP/centos7/3.1.4.0-315
HDP-UTILS-1.1.0.22部分 http://public-repo-1.hortonworks.com/HDP-UTILS-1.1.0.22/repos/centos7
修改成:http://192.168.210.133/hdp/HDP-UTILS/centos7/1.1.0.22
都是admin,都是wq_
中途有兩個警告,再議
Highly Recommended Configurations 3 Please review the folowing recommended changes, and click on the property name to change its value. Type Service Property Current Value Description Warning Ambari Metrics hbase.rootdir file:///var/lib/ambari-metrics-collector/hbase It is not recommended to use root partition for hbase.rootdir Ambari Metrics service uses HBase as default storage backend. Set the rootdir for HBase to either local filesystem path if using Ambari Metrics in embedded mode or to a HDFS dir, example: hdfs://namenode.example.org:8020/amshbase. Warning Ambari Metrics hbase.tmp.dir /var/lib/ambari-metrics-collector/hbase-tmp Consider not using / partition for storing metrics temporary data. / partition is already used as hbase.rootdir to store metrics data Temporary directory on the local filesystem. Change this setting to point to a location more permanent than '/tmp' (The '/tmp' directory is often cleared on machine restart). Warning Atlas atlas.graph.storage.hostname node1,node2,node3 Atlas is configured to use the HBase installed in this cluster. If you would like Atlas to use another HBase instance, please configure this property and HBASE_CONF_DIR variable in atlas-env appropriately.
dfs.permissions.enabled=false