echo
"192.168.58.100 basenode"
>> /etc/hosts
echo
"192.168.58.161 bd1601"
>> /etc/hosts
echo
"192.168.58.162 bd1602"
>> /etc/hosts
echo
"192.168.58.163 bd1603"
>> /etc/hosts
echo
-e
"\e[1;34m
【
----------------------------------------
安装
JDK
】
\e[0m"
sleep
5
rpm
-ivh
jdk-8u231-linux-x64.rpm
echo
'export JAVA_HOME=/usr/java/jdk1.8.0_231-amd64'
>> /etc/profile
echo
'export PATH=$JAVA_HOME/bin:$PATH'
>> /etc/profile
source
/etc/profile
echo
-e
"\e[1;35m
【
----------------------------------------
安装
Tomcat
】
\e[0m"
sleep
5
tar
-zxf
apache-tomcat-8.5.47.tar.gz
mv
apache-tomcat-8.5.47 /opt/lucky/
echo
-e
"\e[1;35m
【
----------------------------------------
安装
Mysql
】
\e[0m"
sleep
5
rpm
-e --nodeps
`rpm -qa | grep mariadb`
tar
-xvf
mysql-5.7.28-1.el7.x86_64.rpm-bundle.tar
rpm
-ivh
mysql-community-common-5.7.28-1.el7.x86_64.rpm
rpm
-ivh
mysql-community-libs-5.7.28-1.el7.x86_64.rpm
rpm
-ivh
mysql-community-client-5.7.28-1.el7.x86_64.rpm
rpm
-ivh
mysql-community-server-5.7.28-1.el7.x86_64.rpm
systemctl
start
mysqld
systemctl enable mysqld
temppasswd
=
`grep "A temporary password" /var/log/mysqld.log | awk '{ print
$NF
}'`
mysql
-uroot -p
$temppasswd
--connect-expired-password
<< EOF
set
global
validate_password_policy
=
low;
set
global
validate_password_length
=
6
;
alter user root@localhost identified by
'123456'
;
use mysql;
update user
set
host
=
'%'
where user
=
'root'
;
commit;
quit
EOF
systemctl
restart
mysqld
echo
-e
"\e[1;35m
【
----------------------------------------
安装
Nginx
】
\e[0m"
sleep
5
echo
-e
"\e[1;36m
【
----------------------------------------
设置开机启动项】
\e[0m"
sleep
5
touch
/usr/local/script/auto_ntpdate.sh
echo
'#!/bin/bash'
>> /usr/local/script/auto_ntpdate.sh
echo
'yum info ntp && ntpdate cn.ntp.org.cn'
>>
/usr/local/script/auto_ntpdate.sh
chmod
u
+
x /usr/local/script/auto_ntpdate.sh
echo
'/usr/local/script/auto_ntpdate.sh'
>> /etc/rc.local
chmod
u
+
x /etc/rc.local
echo
-e
"\e[1;36m
【
----------------------------------------
删除文件】
\e[0m"
sleep
5
rm
-rf
apache-tomcat-8.5.47.tar.gz
rm
-rf
jdk-8u231-linux-x64.rpm
rm
-rf
mysql*
rm
-rf
*.sh
echo
-e
"\e[1;36m
【
----------------------------------------
关闭计算器,拍快照】
\e[0m"
sleep
5
shutdown
-h
now