网络选择桥接模式,选择当前使用的网卡。
三台虚拟机硬盘都是12GB 内存不同CM1:8196MB CM2、CM3:2048MB
查看网络地址 ip addr
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
DEVICE=enp0s3
TYPE=Ethernet
BOOTPROTO=static
ONBOOT=yes
NM_CONTROLLED=yes
IPADDR=192.168.50.167
PREFIX=24
NETMASK=255.255.255.0
GATEWAY=192.168.50.4
DNS1=192.168.50.1
DNS2=114.114.114.114
vi /etc/hostname或hostnamectl --static set-hostname cm1
cm1
vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.50.167 cm1
192.168.50.168 cm2
192.168.50.169 cm3
查看防火墙 firewall-cmd --state
systemctl stop firewalld
systemctl disable firewalld
systemctl list-unit-files
关闭SELinux
vi /etc/selinux/config
SELINUX=disabled
更新yum(可不做)
yum clean all
yum makecache
免密登录
(每台)
yum -y install openssh-clients
cd ~
ssh localhost 输入yes 和 密码 最后exit
ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.165.163 输入yes和密码
ssh root@192.168.165.163
测试成功exit
(仅cm1)以下3行已废弃
ssh-copy-id cm1 输入yes 和 密码
cd ./ssh
scp ./authorized_keys cm2:`pwd` 输入yes 和 密码
scp ./authorized_keys cm3:`pwd`
visudo
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
devuser ALL=(ALL) NOPASSWD: ALL
## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
yum -y install rsync
vi etc/hadoop/hadoop-env
export JAVA_HOME=
[devuser@hadoop102 hadoop-3.1.3]$ bin/hdfs namenode -format
[devuser@hadoop102 hadoop-3.1.3]$ sbin/start-dfs.sh
[devuser@hadoop103 hadoop-3.1.3]$ sbin/start-yarn.sh
ln -s /home/devuser/jdk1.8.0_281/bin/jps /usr/local/bin/jps
时钟同步
安装JDK8u181
rpm -ivh jdk-8u181-linux-x64.rpm
vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0.181-amd64
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/toos.jar
source /etc/profile
java -version
报错“bash: jps: command not found”
运行xcall.sh jps时提示,报错“bash: jps: command not found”
检查如下:
已经安装jdk,配置好jdk的环境变量,且本机执行jps命令没有问题!
解决办法:
1.切换root用户
su root
2.创建符号链接
ln -s jps的路径 链接目标存放位置
我的设置如下:
ln -s /opt/module/jdk1.8.0_144/bin/jps /usr/local/bin/jps
卸载sudo rpm -qa | grep -i java | xargs -n1 sudo rpm -e --nodeps
安装mysql(仅cm1)
yum -y install wget
wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum -y install mysql-server
systemctl start mysqld
systemctl status mysqld
vi /etc/my.cnf
【mysqld】增加
plugin-load=validate_password.so
validate-password=OFF
systemctl restart mysqld
grep 'temporary password' /var/log/mysqld.log
mysql -uroot -p 输入临时密码
set password for 'root'@'localhost'=password('123456');
systemctl enable mysqld
systemctl daemon-reload
安装必要的附件(每台)
yum -y install chkconfig bind-utils psmisc cyrus-sasl-plain cyrus-sasl-gssapi portmap /lib/lsb/init-functions httpd mod_ssl openssl-devel python python-psycopg2 MySQL-python libxslt zlib sqlite fuse fuse-libs redhat-lsb