Centos7 minimal初始化
程序员文章站
2022-03-01 17:24:14
...
1.配置网络,如果虚拟机配置nat和 配置网络
vi /etc/sysconfig/network-scripts/ifcfg-ens33
修改内容为下面的
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=STATIC
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=0396167e-d619-4592-b25e-d5eb4a0da830
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.5.10
PREFIX=24
NETMAST=255.255.255.0
GATEWAY=192.168.5.2
DNS1=192.168.5.2
IPV6_PRIVACY=no
保存退出
/etc/init.d/network restart
2.ping www.baidu.com,网络通了之后,配置国内源
yum -y install wget
cd /etc/yum.repos.d
mv ./CentOS-Base.repo ./CentOS-Base.repo.bak
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
mv CentOS7-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo
yum clean all;yum makecache
3.安装常用工具
yum groups install Development\ Tools -y
yum install -y vim lrzsz lsof
4.关闭防火墙,关闭selinux
sudo systemctl stop firewalld
sudo systemctl disable firewalld
setenforce 0
vi /etc/selinux/config
修改为SELINUX=disabled
重启电脑
5.配置java环境变量
yum -y install httpd createrepo
wget https://archive.cloudera.com/cm6/6.3.0/redhat7/yum/RPMS/x86_64/oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
createrepo oracle-j2sdk1.8-1.8.0+update181-1.x86_64.rpm
yum install oracle-j2sdk1.8
vi /etc/profile
export JAVA_HOME=/usr/lib/jvm/java-1.8.0
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
保存退出
source /etc/profile
6.安装mysql
wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server
service mysqld start
获取mysql临时密码
grep 'temporary password' /var/log/mysqld.log
登录mysql
mysql -uroot -p
修改密码策略
set global validate_password_policy=0;
set global validate_password_length=1;
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '123456' WITH GRANT OPTION;
FLUSH PRIVILEGES;
上一篇: 虚拟机部署k8s集群