1. 程式人生 > >平臺安裝--環境準備(1)

平臺安裝--環境準備(1)

環境準備

Oracle_Linux_7.3_x86_64.iso

1-1)、節點說明

本例中安裝一個六個節點的叢集,一個控制節點,兩個管理節點,兩個資料節點。控制節點主要安裝Ambari、Ambari Metrics等服務,用於叢集各服務的控制,監控,任務提交等。管理節點主要安裝各服務的Master元件,如Namenode、ResourceManager、Hive、Hbase、KDC、OpenLdap、Ranger、Ambari infra等。資料節點主要安裝各服務的Slave元件,如Datanode、NodeManager、Regionserver等。

IP地址

主機名

節點型別

198.168.199.50

rdsp-cn-01/rdsp-cn-01.cars.com

控制節點

198.168.199.51

rdsp-nn-01/rdsp-nn-01.cars.com

管理節點

198.168.199.52

rdsp-nn-02/rdsp-nn-02.cars.com

198.168.199.53

rdsp-dn-01/rdsp-dn-01.cars.com

資料節點

198.168.199.54

rdsp-dn-02/rdsp-dn-02.cars.com

1-2)、設定IP

 # vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

TYPE=Ethernet

BOOTPROTO=static

IPADDR=192.168.199.50

NETMASK=255.255.255.0

GATEWAY=192.168.199.1

DNS1=192.168.199.1

DNS2=8.8.8.8

DEFROUTE=yes

PEERDNS=yes

PEERROUTES=yes

IPV4_FAILURE_FATAL=no

IPV6INIT=yes

IPV6_AUTOCONF=yes

IPV6_DEFROUTE=yes

IPV6_PEERDNS=yes

IPV6_PEERROUTES=yes

IPV6_FAILURE_FATAL=no

IPV6_ADDR_GEN_MODE=stable-privacy

NAME=enp0s3

UUID=0ddfc571-6d5d-4d1e-9442-f3ef337e7f12

DEVICE=enp0s3

ONBOOT=yes

1-3)、重啟網路

# service network restart

1-4)、檢視IP

# pifconfig

lo       

          inet addr:127.0.0.1   Mask:255.0.0.0

          inet6 addr: ::1/128 Scope: host

          UP LOOPBACK RUNNING

enp0s3    HWaddr 08:00:27:25:cc:9c

          inet addr:192.168.0.50 Bcast:192.168.0.255   Mask:255.255.255.0

          inet6 addr: fe80::32a8:4a1a:3b8c:4cbd/64 Scope: link

          UP BROADCAST RUNNING MULTICAST

1-5)、修改主機名字

# hostnamectl set-hostname rdsp-cn-01

# vi /etc/sysconfig/network

# Created by anaconda

HOSTNAME=rdsp-cn-01

1-6)、配置hosts

指令碼下載:連結: https://pan.baidu.com/s/1c2OnGq 密碼: gkqt

# vi iplist

export ap="192.168.0.50

192.168.0.51

192.168.0.52

192.168.0.53

192.168.0.54"

export op="192.168.0.51

192.168.0.52

192.168.0.53

192.168.0.54"

export dp="192.168.0.53

192.168.0.54"

export np="rdsp-cn-01.cars.com

rdsp-nn-01.cars.com

rdsp-nn-02.cars.com

rdsp-dn-01.cars.com

rdsp-dn-02.cars.com"

1-7)、關閉防火牆

# systemctl disable firewalld

1-8)、安裝httpd

1-9)、安裝ntp

# systemctl status ntpd.service

# systemctl enable ntpd.service

1-10)、同步時ssh-copy.sh

*********

# sh cmd.sh ap "hwclock"

# sh cmd.sh ap "date"

1-11)、關閉Selinux

A)、臨時關閉

B)、永久關閉

C)、分發檔案

# sh sync.sh op -r "/etc/selinux/config /etc/selinux/config"

1-12)、關閉PackageKit

A)、修改

B)、分發

 sh sync.sh op -r "/etc/yum/pluginconf.d/refresh-packagekit.conf /etc/yum/pluginconf.d/refresh-packagekit.conf"

1-13)、設定umask

A)、修改

# vi /etc/security/limits.conf

*        soft    noproc 10240

*        hard    noproc 10240

*        soft    nofile 10240

*        hard    nofile 10240

B)、分發

# sh sync.sh ap -r "/etc/security/limits.conf  /etc/security/limits.conf"

1-14)、建立httpd目錄

# mkdir -p /var/www/html/

# systemctl enable httpd

# systemctl status httpd

1-15)、安裝mysql5.6

# service mysqld stop

# yum remove mysql mysql-*

# yum list installed | grep mysql

# rpm -e --nodeps `rpm -qa | grep mysql`

#rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

#yum install mysql-community-server

#mysql -V

#service mysqld start

登入mysql密碼為空,直接回車

# mysql -uroot -p

開啟mysql的遠端登入許可權

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '1234' WITH GRANT OPTION;

Query OK, 0 rows affected (0.00 sec)

重新整理使之立刻生效

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

修改密碼

# mysql -uroot -p

mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

mysql> update user set password=password("123456") where user='root';

Query OK, 5 rows affected (0.01 sec)

Rows matched: 5  Changed: 5  Warnings: 0

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

1-16)、下載安裝包(地址)

1-17)、nc安裝

1-18)、JDK配置

A)、解壓軟體包

# tar -zxvf jdk-8u131-linux-x64.tar.gz

# mv jdk1.8.0_131 jdk1.8

B)、配置環境變數

# vi  /etc/profile

export JAVA_HOME=/opt/jdk1.8

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

export PATH=$JAVA_HOME/bin:$PATH

C)、配置JAVAJCE

下載地址,連結:https://pan.baidu.com/s/1fC2_v16oLbDipLeHUHdd-g 密碼:sgnh

如果無法下載請聯絡作者

# cp local_policy.jar US_export_policy.jar  /opt/jdk1.8/jre/lib/security

1-19)、安裝netstart命令

# yum install  net-tools