Windows操作系统初始化
Win10-64bit
Vmvare12Pro-64bit
Jdk8-64bit
LINUX虚拟机配置
NAT模式
Linux操作系统配置初始化
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[root@localhost ~]# uname -r
3.10.0-1160.el7.x86_64
[root@localhost ~]# cd /etc/yum.repos.d/
cp CentOS-Base.repo CentOS-Base.repo.backup
yum install wget
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum update -y
yum -y install pcre pcre-devel openssl openssl-devel openssh-server gcc+ unzip zip lrzsz tree telnet-server telnet.* gcc gcc-c++ gcc-g77 make cmake bison ncurses-devel autoconf automake zlib* fiex* libxml* libmcrypt* libtool-ltdl-devel* libaio libaio-devel bzr libtool ncurses5-devel imake libxml2-devel expat-devel ncurses-devel fontconfig mkfontscale httpd-tools wget ifconfig net-tools vim ntpdate dos2unix nc socat conntrack ipvsadm ipset jq sysstat curl iptables libseccomp yum-utils
[root@localhost ~]# hostname node-X
[root@localhost ~]# hostnamectl set-hostname node-X
[root@localhost ~]# cd /etc/sysconfig/network-scripts
vim ifcfg-ens33
vim ifcfg-ens37
比如公网IP:10.0.0.21/内网IP:172.16.1.21
systemctl restart network
[root@localhost ~]# ping www.baidu.com
[root@localhost ~]# mkdir -pv /data/{application,scripts,software}
[root@localhost ~]# mkdir -pv /data/application/{project,logs}
[root@localhost ~]# mkdir -pv /data/scripts/{application,system,software}
[root@localhost ~]# mkdir -pv /data/software/{workspace,install}
[root@localhost ~]#cd /data/scripts/system
cat sync_time.sh
#!/bin/sh
/usr/sbin/ntpdate ntp1.aliyun.com > /dev/null 2>&1
[root@localhost ~]#crontab -e
*/5 * * * * /bin/sh /data/scripts/system/sync_time.sh > /dev/null 2>&1
[root@localhost ~]# vim /etc/hosts
127.0.0.1 localhost
172.16.1.21 node-X
#关闭防火墙
[root@localhost ~]# systemctl stop firewalld && systemctl disable firewalld && systemctl status firewalld
#关闭selinux 这个要重启
[root@localhost ~]# setenforce 0 必须要设置
[root@localhost ~]# vim /etc/selinux/config
SELINUX=disabled
echo '* - nofile 65535 ' >>/etc/security/limits.conf
[root@localhost ~]# init 6
Linux操作系统软件初始化
JDK1.8
[root@node-X ~]# mkdir -pv /data/software/workspace/jdk
[root@node-X ~]# cd /data/software/workspace/jdk
[root@node-X jdk]# tar -zxf jdk-8u231-linux-x64.tar.gz
[root@node-X jdk]# chown -R root.root /data/software/workspace/jdk/jdk1.8.0_231
[root@node-X jdk]# ln -s /data/software/workspace/jdk/jdk1.8.0_231 /data/software/install/jdk
[root@node-X jdk]# rm -f /usr/bin/java
[root@node-X jdk]# ln -s /data/software/install/jdk/bin/java /usr/bin/java
[root@node-X jdk]# ll /usr/bin/java
lrwxrwxrwx 1 root root 35 Jan 9 23:57 /usr/bin/java -> /data/software/install/jdk/bin/java
[root@node-X jdk]# rm -f /usr/bin/javac
[root@node-X jdk]# ln -s /data/software/install/jdk/bin/javac /usr/bin/javac
[root@node-X jdk]# ll /usr/bin/javac
lrwxrwxrwx 1 root root 36 Jan 9 23:55 /usr/bin/javac -> /data/software/install/jdk/bin/javac
[root@node-X jdk]# java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)
[root@node-X jdk]# cat /etc/profile
JAVA_HOME=/data/software/install/jdk
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
[root@node-X jdk]# source /etc/profile
[root@node-X jdk]# java -version
标题:(虚拟机)Centos7.X-64bit操作系统初始化配置
作者:yazong
地址:https://blog.llyweb.com/articles/2022/10/28/1666934408548.html