Centos7 configuration network card and some software installation

Since the disk space of the previous virtual machine is not enough, it is not using the lvm logical volume group, so I finally chose to flush and install the virtual machine, so here are some basic environment constructions, so that you can directly query the document next time, without the need for each A variety of Baidu software installation, some frameworks use docker to install, this article will also give some response commands for reference learning

1. Configure the network card

The first step to install the virtual machine is to configure the network and configure the static ip. I usually choose the net mode so that I don’t need to reset it every time I change the network.

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33

change into:

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
IPADDR=192.168.18.107
NETMASK=255.255.255.0
GATEWAY=192.168.18.2
DNS1=8.8.8.8
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=1097bcbf-a5c8-422f-8917-e5ae2db1ca84
DEVICE=ens33
ONBOOT=yes

Restart the network:

systemctl restart netwrok

View ip

image-20210310194130325

2. Replace yum source

There is a quick yum source that is very helpful for installing software, so use 163 yum source here

#备份
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
#更换
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
#刷新 建立缓存
yum makecache

3. Install docker

1) Uninstall docker

yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

2) Install docker dependencies

yum install -y yum-utils device-mapper-persistent-data lvm2

3) Set the yum location of the docker repo

yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

4) Install docker, and docker-cli

 yum install docker-ce docker-ce-cli containerd.io

5) Start docker

systemctl start docker

6) Set self-start after power-on

systemctl enable docker

7) Set up Alibaba Cloud image acceleration

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
    
    
  "registry-mirrors": ["https://263mn3oi.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

Guess you like

Origin blog.csdn.net/weixin_44706647/article/details/114646001