第一部分:搭建基本環境java
一、網絡配置
vim /etc/sysconfig/network-scripts/ifcfg-ens32
service network restartnode
vim /etc/hosts
192.168.15.121 node1
192.168.15.122 node2
192.168.15.123 node3python
二、SSH免密鑰登陸
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
ssh-copy-id node1
ssh-copy-id node2
ssh-copy-id node3mysql
cd ~/.ssh
scp ./authorized_keys node2:`pwd`
scp ./authorized_keys node3:`pwd`linux
三、防火牆關閉
systemctl stop firewalld.service
systemctl disable firewalld.service sql
四、SELINUX關閉
setenforce 0
vim /etc/selinux/config (SELINUX=disabled)shell
五、安裝JDK配置環境變量
mkdir /usr/java
官網下載jdk的rpm文件,並上傳到/usr/java目錄下(如:/usr/java/jdk-8u221-linux-x64.rpm)
scp ./jdk-8u221-linux-x64.rpm node2:`pwd`
scp ./jdk-8u221-linux-x64.rpm node3:`pwd`數據庫
rpm -ivh jdk-8u221-linux-x64.rpm json
vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_221-amd64
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jarvim
source /etc/profile
java -version
六、安裝NTP 設置開機啓動(若是時間相同就能夠不一樣步時間,能夠繞過這個步驟)
chkconfig ntpd on 設置時間同步 ntpdate 202.120.2.101
七、安裝配置
yum install -y mysql-server
systemctl start mysqld.service #啓動 mysql
systemctl restart mysqld.service #重啓 mysql
systemctl stop mysqld.service #中止 mysql
systemctl enable mysqld.service #設置 mysql 開機啓動
mysql
use mysql
delete from user
update user set Password=password("admin") where User='root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'admin' WITH GRANT OPTION;
flush privileges
八、下載第三方依賴包
yum -y install chkconfig python bind-utils psmisc libxslt zlib sqlite cyrus-sasl-plain cyrus-sasl-gssapi fuse fuse-libs redhat-lsb
第二部分:搭建cm+cdh
一、ClouderaManager安裝
1.一、安裝Cloudera Manager Server、Agent
mkdir /opt/cloudera-manager
tar -zxf cloudera-manager-centos7-cm5.16.1_x86_64.tar.gz -C /opt/cloudera-manager/
1.二、配置CM Agent
修改文件vim /opt/cloudera-manager/cm-5.16.1/etc/cloudera-scm-agent/config.ini中server_host爲node1
1.三、建立用戶cloudera-scm
useradd --system --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
1.四、配置CM Server數據庫(node1)
mkdir /usr/share/java/
拷貝mysql jar文件到目錄 /usr/share/java/
注意jar包名稱要修改成mysql-connector-java.jar
grant all on *.* to 'temp'@'%' identified by 'temp' with grant option;
cd /opt/cloudera-manager/cm-5.16.1/share/cmf/schema/
./scm_prepare_database.sh mysql temp -h node1 -utemp -ptemp --scm-host node1 scm scm scm
格式:數據庫類型、數據庫、數據庫服務器、用戶名、密碼、cm server服務器
1.五、建立Parcel目錄
mkdir -p /opt/cloudera/parcel-repo
chown cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo
mkdir -p /opt/cloudera/parcels
chown cloudera-scm:cloudera-scm /opt/cloudera/parcels
1.六、製做CDH本地源
下載好文件CDH-5.4.0-1.cdh5.4.0.p0.27-el6.parcel以及manifest.json,將這兩個文件放到server節點的/opt/cloudera/parcel-repo下。
打開manifest.json文件,裏面是json格式的配置,找到與下載版本相對應的hash碼,新建文件,文件名與你的parel包名一致,並加上.sha後綴,將hash碼複製到文件中保存。
1.七、啓動CM Server、Agent
cd /opt/cloudera-manager/cm-5.16.1/etc/init.d/
./cloudera-scm-server start Sever
首次啓動會自動建立表以及數據,不要當即關閉或重啓,不然須要刪除全部表及數據從新安裝
查看啓動是否完成
cd /opt/cloudera-manager/cm-5.16.1/log/cloudera-scm-server
tail -f cloudera-scm-server.log
啓動完成後
訪問:http://note1的ip:7180 默認用戶名與密碼:admin/admin 則安裝成功了