1. Teach you how to deploy projects - VMware installs Centos

foreword

The market is involuntary, and programmers who can only write code are not so popular. Many times in the enterprise, the back-end program is required to write the front-end, and even do operation and maintenance, because small companies will not hire special operation and maintenance personnel to solve the cost of. Therefore, for the back-end program, it is only necessary to know some operation and maintenance, and we should move towards the full stack to be more competitive. The column "Teaching You to Deploy Projects" will let you master enterprise project deployment methods step by step from Centos installation, Linux common commands, traditional project deployment, Docker containerized deployment, and K8S service orchestration.

Install VMware

There are two ways to deploy projects in enterprises: one is to purchase servers and network facilities by the enterprise itself, and the other is to purchase servers on cloud platforms (Alibaba Cloud, Tencent Cloud, etc.), and pay a certain fee every year. For our study, it seems that the first two steps are not suitable, so we can install virtual machines such as VMware, VirtualBox, etc. on our personal computers (mostly windows systems), and then deploy the project in the virtual machine with a safe linux operating system (Generally, Linux system deployment is adopted, and the performance is good.) The virtual machine software can be used to simulate a computer, so that any operating system can be installed on it. Commonly used virtual machines are as follows:

  • vmware: NO.1 in virtual machine software, features: perfect simulation, commercial authorization, paid software (serial number), large memory;
  • virtualbox: the original sun company, now belongs to Oracle, free and open source, timely update, small size, memory optimization, compatibility is not particularly good;

I use VMware demonstration here, first need to download vmware workstation, the version I used is: VMware-workstation-full-10.0.0-1295980.exe (I have been using this all the time, I am too lazy to download a new one), the network disk address:

Link: https://pan.baidu.com/s/12b6yZlO0Pji1Xhki61wq4g?pwd=itss
Extraction code: itss
– share from Baidu Netdisk super member V6

After downloading, double-click to start the vmware installation program. Uncertain options can use the default configuration. After selecting the installation path, click Next to
insert image description here
select the installation file storage path. Generally, do not store it in the C drive.
insert image description here
There is an option to check for product updates. , you can remove him, because it will affect the startup speed, and there is no need to check for updates.
insert image description here
Next step, enter the prepared secret key in the following location.
insert image description here
After installation, a shortcut icon will appear on the desktop, and the VM will virtualize 2 for your computer. Network card, check whether the network card is normal through the network and sharing center, open the control panel,
insert image description here
find and change the adapter configuration, click to enter
insert image description here

Check the virtual network card. If there is no virtual network card, centos cannot access the Internet.
insert image description here
Use the dos command to enter ipconfig, you can see the extra network card
insert image description here

Create a new virtual machine

Start the virtual machine, find the file - create a new virtual machine,
insert image description here
you can choose custom and typical installation here, I choose custom
insert image description here

This place requires you to select the OS file of the operating system. There are also some in the network disk that you need to download yourself, then select and click Next.
insert image description here
Here you must choose linux-centos 64 bits, because the OS image I prepared is Centos7 64 bits
insert image description here

All the way down, you will enter the CPU core number selection interface. For example, here I have allocated 4 cores
insert image description here
and then specified the memory size. The bigger the better, this depends on the size of your host’s CPU and memory. If it is too large, your The machine is also not enough resources to support, I choose 4G of memory here
insert image description here

The next step is to choose the network type. It provides 4 kinds of networks, which can be defaulted first, and we can modify them later.
insert image description here

Then create a disk, we choose to create a new disk,
insert image description here
adjust the size of the disk, and store the disk as a single file
insert image description here

In the next step, the custom hardware, USB, printer, and sound card can be removed. If centos7 needs to recognize the U disk, the USB controller can be kept. At the same time, in this interface, you can also readjust the CPU and memory size, select the OS image file, etc. After configuration, click Next to complete the new creation.
insert image description here

install centos7

Because I prepared Centons7 (linux system), you can see Centos 64 here, choose instll centOS7 to install, choose the first one to install without detection (directly press Enter) Note: Click to enter the Linux
insert image description here
system (the mouse disappears), Press and hold Ctrl+Alt to exit (mouse appears)

Waiting until the screen arrives at this position, select Chinese is simple
insert image description here
. Most of the interface does not need to be selected, and the default is fine. Confirm the installation source and software selection. Software selection
insert image description here
Select the local disk for the installation location
insert image description here

Software selection - use the GNOME desktop, the default is the minimal installation (only a black window, not very friendly to beginners), here you can choose to choose this mode with a desktop, select the icon and select the network and host, the network needs to be
insert image description here
opened
insert image description here
The final effect is as follows, click to start the installation
insert image description here
Here you need to specify the password of the root user, you can also create other accounts
insert image description here
and then wait for a long time, after the installation is complete, restart the system After restarting,
insert image description here
you will enter the startup guide page for initial configuration, select Chinese and then advance to
insert image description here
the time zone If the default is Shanghai, you don’t need to choose, just go to the next step,
insert image description here
online account, you can skip it here.
insert image description here
After creating an account, complete the guidance
insert image description here
and initialization, and you can start using it.
insert image description here
Click not listed? , Switch to the root user to log
insert image description here
in. After logging in, the interface is as follows

Network Configuration

Enter the system, right click on the desktop - open the terminal - enter the command: ifconfig to view the IP as follows
insert image description here

The network configuration can be configured through the network icon in the upper right corner - wired connection.
insert image description here
The display effect is as follows, and you can see the current system ip, routing, etc. Click IPV4 to modify the IP.
insert image description here
The default is the automatic mode. If you want to modify the IP, you can change it to the manual mode. The effect is as follows:
insert image description here
In addition to modifying the IP through the visualization window, we can also modify the network card by modifying the network card file. The modification command: vi / etc/sysconfig/network-scripts/ifcfg-eth33, currently it is not recommended to modify, just use automatic. for example:

[root@nvm01 network-scripts]# vi /etc/sysconfig/network-scripts/ifcfg-eth33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static #设置静态固定IP(手动)
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=e4ee73d5-28d6-48ca-9ffd-2d0e87255571
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.0.106 #ip地址
NETMASK=255.255.255.0 #掩码
GATEWAY="192.16.0.1"    # 网关地址
DNS1="192.16.0.1"       # DNS服务器
DNS2="119.29.29.29"

Now let's talk about the network mode. Find the menu: Virtual Machine - Settings
insert image description here
After entering, select: Network Adapter, and then you can see the following network modes, so what is the difference between these network modes?
insert image description here
vmware provides four network access modes, which are:

1. Nat network address translation mode (NAT, Network Address Translation)

Network Address Translation (NAT) belongs to the technology of accessing the Wide Area Network (WAN), which is a translation technology that converts private (reserved) addresses into legal IP addresses. Through the host's NAT (Network Address Translation) function, use the host's network to access the Internet; the features are as follows:

​ (1) The virtual machine NIC and the host NIC are not on the same network segment;

(2) Can access the external network;

(3) Virtual machine hosts can access each other;

(4) Safe intranet environment;

(5) The external network cannot directly access the virtual machine through NAT;

Summary: The ip address of the NAt method is allocated by the virtual network card, shares the network with the host, and is not in the same network segment as the host, but can communicate with the host and access the external network.

2. Bridged Adapter bridge mode

​ Bridge mode is to use the virtual bridge to communicate between the host network card and the virtual network card. Similar to virtualizing a physical host as a switch, all virtual machines with bridge settings are connected to an interface of this switch, and the physical host is also plugged into this switch, so all network cards and network cards under the bridge are in switching mode, mutual Can be accessed without interference. In bridge mode, the IP address of the virtual machine needs to be on the same network segment as the host. If networking is required, the gateway and DNS need to be consistent with the network card of the host.

(1) It needs to occupy an independent ip address in the network and occupy network ip resources, which limits the number of virtual machine network cards to a certain extent;

(2) equal to the host network;

(3) No virtual network card will be generated on the host network adapter page;

Summary: It can be understood that one more machine needs to be assigned an additional IP from the router, which is on the same network segment as the host machine.

3.Host-only Adapter host-only mode

​Host-Only mode is actually the NAT mode that removes the virtual NAT device, and then uses the VMware Network Adapter VMnet1 virtual network card to connect to the VMnet1 virtual switch to communicate with the virtual machine. The Host-Only mode separates the virtual machine from the external network, making the virtual machine Become an independent system that only communicates with the host computer.

Summary: In this mode, the private network shared by centos and the host cannot access the external network

ssh terminal

It would be inconvenient if we log in to the system in the VM every time to operate, so we usually use an SSH terminal to connect to the Centos system.

SSH is the abbreviation of Secure SHell, developed by the Network Working Group of the IETF, called the Secure Shell Protocol, which is a protocol that provides secure remote login and other secure network services on an insecure network.

Centos7 has SSH enabled by default, so we only need to install the SSH terminal on the windows machine. It is available in Baidu Netdisk. I choose SecureCRT here, and it can be used after decompression. The above two are ssh terminal and the other is FTP file upload
insert image description here
. tool, click SecureCRTPortable.exe, and the following interface will be displayed
insert image description here
Create a new quick connection - specify centos ip and user name root, and then confirm, just enter the password and enter the terminal
insert image description here
The end of the article, if it is helpful to you, please give a good review!!!

Guess you like

Origin blog.csdn.net/u014494148/article/details/130704262