In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Author: sery@163.com
After the release of Redhat RHEL 8 for a while, centos 8 was finally officially released, and can't wait to download its ISO file and run installation tests. Compared with centos 7, the file size is much larger.
After obtaining the centos 8 iso image file, you can burn it to a CD or a bootable installation U disk. If it is a physical server, you need to confirm that it is booted with UEFI. Compared with the older BIOS, the UEFI approach requires some extra work, such as creating a separate partition / boot/efi when partitioning manually, otherwise the installation may not proceed.
Pre-installation planning
If it is used in a production system, it needs to be planned before deployment, and it should not be done immediately and recklessly. So which projects are planned? There is really no standard specification. Before I move the bricks, I generally consider a few aspects for your reference:
Disk redundancy configuration: what raid level does multiple disks do?
IP address allocation: good planning can avoid administrative confusion and avoid conflicts between ip addresses and other servers.
Hostname: the hostname had better be literal, such as my common purpose name + ending ip (web118, indicating that the system is for web use, and the last field of the ip address is 118). In a time when I didn't have much experience, I used to manage more than 500 physical servers, all with the hostname localhost, which is killing me to maintain.
Disk partition: it is strongly recommended that physical servers do not make a root in the end! One of the benefits of partitioning is data isolation. In the process of long-term operation and maintenance management, there is still a chance of file system corruption. If you have one to the end, it will be tricky to fix the file system. In another case, if you store a separate partition for the log, even if the log is stuffed, it will not cause the system to hang (at the end of the day, the log is full of the entire root partition, I am afraid remote login is a problem).
Directory naming: it mainly refers to the naming of partition mount points outside the system disk, such as / data, / backup, etc.
Start system installation
Prepare the installation media and understand the basic configuration of the device, then insert the bootable installation media and make sure that the boot media is set to the highest priority.
The normal boot interface is shown in the following figure:
The cursor key selects the first line "Install Centos Linux 8.0.1905" and enter to proceed to the next step. If you plan to install in text mode, press the "esc" key directly to enter the boot interface and enter the command: linux text (in previous versions, you can type text directly). In case you can't get into the boot interface, try changing the boot mode to traditional BIOS.
Compared with installing centos 8 in a graphical interface, text is much more troublesome and time-consuming, especially manual partitioning.
Therefore, in order to install more efficiently, it is better to change the original habit and install from the graphical interface.
Centos 8 custom layout is more reasonable, all in one interface, concise and lively.
I need to customize the time zone (Time & Data), software selection (Software Selection), network and hostname (Network & Host Name), and required system installation location (Installation Destination). In order to ensure the efficiency of installation, you can first select the installation location of the system with the mouse. The purpose of doing this is to check whether the hard drive is recognized by the system. If the hard drive is not recognized by the system and other customizations are made first, it is a waste of time and cannot continue.
Customize the system installation location
My 100g hard drive has been correctly identified. If it is multiple disks, it will be displayed with multiple lines and multiple icons, and a disk can be selected with the mouse. In the custom partition section, click "Custom" (default is automatic), and then click the left button "Done" at the top of the interface. Enter the custom partition interface and click the button "+" to partition manually.
First create the partition / boot/efi, and after selecting, click "Add mount point".
Modify the partition size to 1G (the default takes up all disk space) and make sure that the file system type is "EFI System partition". After confirmation, the mouse punctuates "Update Setting".
Continue to click the plus sign "+" to add swap partition, / boot partition, root partition /, Syslog partition / var, etc. A custom created disk partition layout is as follows:
Click the mouse button "Done", pop up the partition summary interface, and click the change "Accept Changes" button to complete the operation of customizing the installation location of the system.
Custom time zone
After returning to the installation summary interface, click "Time & Data" and select the location of China on the map. After it is selected, the area on the upper left is automatically filled with "Asia" and the city is filled with "Shanghai".
The mouse punctuation "Done" completes the setup and returns to the main customization interface.
Customize the required software packages for installation
Click "Software Selection" to enter the package selection interface. Optionally minimize installation of "Minimal Install" or customize installation of "Custom Operation System". I generally choose custom installation, and select the sub-items "Standard", "Developmet Tools", "System Tools".
In the old version of centos, you can press F2 to see the information of the software package contained in the subkey on the right. After confirmation, click the button "Done" to complete the setup and return to the customized main interface.
Customize hostname and network
The main interface mouse punctuation hyperlink "Network & Host Name" to enter the network customization interface. Normally, the network card is identified by the system, will display the name of the network card, multiple network cards, with multiple lines displayed.
(1) modify the host name: enter pre-planned characters and click the button "Apply" to take effect immediately.
(2) continue in the previous interface, click the button "Configure …" on the lower right side. After popping up the subinterface, click "IPv4 Setting", and then continue to click the drop-down list box "Method".
Continue to click the button "Add" in this interface, and fill in the corresponding content in the edit box according to the plan in advance.
(3) Click the right slide button to enable the network connection (from OFF to ON).
After confirmation, the mouse punctuation "Done" button returns to the custom installation main interface.
Formal installation
After customizing all the items, click the button "Begin Installation", and the installer will format the hard disk and copy the files to the corresponding directory. In this process, you can set the user setting, that is, setting the root password.
It is strongly recommended that the production environment set complex passwords and use kepass password management tools to generate passwords randomly, which is a good choice.
When the interface button "Reboot" appears, even if the installation process is complete, click this button to restart the system and eject the installation media at the same time.
Post-processing and system delivery
After the system is installed, the minimum requirement is to be able to connect remotely. If the network is not set or set up incorrectly during installation, you need to enter the system from the console (the physical server is the monitor) and set up the network after the system restart.
Change the hostname
The console executes the following instructions to take effect:
Hostnamectl set-hostname mysql116
After executing this instruction, open the file / etc/hostname and you can see the changes. Unlike directly modifying / etc/hostname, editing this file directly will take effect only if you restart the system.
Set up the network
First execute the instruction ip add to see if the network is set up.
Then check the network interface configuration file to see if there are any settings, if so, you need to set the value of BOOT to yes.
In the case of no ip address set in the figure above, it is easy to make mistakes when editing the file manually, and you can't copy, paste and modify it from elsewhere. In previous versions of centos, there was a tool setup that was set up graphically. Later versions of Centos 7 use nmtui (Network Management text user Interface) to set up the network.
Select "Edit a connection" with the cursor and enter.
Select "" with the cursor selected and continue to enter. In the next interface, the left side of the ipv4 configuration is selected with the cursor, and enter selects "Manual". Then continue to move the cursor to the "show" on the right side of the line, enter, and pop up the editing interface.
Fill in the values according to the plan in advance.
After confirming that it is correct, locate the cursor to the bottom right button, complete the setting and go back to the previous interface, continue to use the cursor to locate the "button" on the lower right side, enter, and return to the main interface.
In the main interface, position the cursor to "Quit" and exit to the command line to complete the settings.
Open and edit the network interface file to see if the above settings have automatically modified the interface file.
If you modify it with a script, execute the following instructions:
Sed-I s#ONBOOT=no#ONBOOT=yes# / etc/sysconfig/network-scripts/ifcfg-ens18
For the changes to take effect, continue to execute the following instructions:
Service NetworkManager restart
Note that centos 8 no longer has the service name network!
After a successful network restart, execute ip add or other ping hosts to verify the correctness of the network settings.
Turn off unnecessary services
Use remote management tools such as SecureCRT to connect to the newly installed centos 8 server system and execute instructions to see what programs or services are started with the system booting.
Systemctl list-unit-files | grep enable
[root@mysqlq126 ~] # systemctl list-unit-files | grep enable
Atd.service enabled
Auditd.service enabled
Autovt@.service enabled
Crond.service enabled
Dbus-org.fedoraproject.FirewallD1.service enabled
Dbus-org.freedesktop.NetworkManager.service enabled
Dbus-org.freedesktop.nm-dispatcher.service enabled
Dbus-org.freedesktop.timedate1.service enabled
Firewalld.service enabled
Getty@.service enabled
Import-state.service enabled
Irqbalance.service enabled
Kdump.service enabled
Libstoragemgmt.service enabled
Loadmodules.service enabled
Lvm2-monitor.service enabled
Mcelog.service enabled
Mdmonitor.service enabled
Microcode.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager-wait-online.service enabled
NetworkManager.service enabled
Nis-domainname.service enabled
Rngd.service enabled
Rsyslog.service enabled
Selinux-autorelabel-mark.service enabled
Smartd.service enabled
Sshd.service enabled
Sssd.service enabled
Syslog.service enabled
Timedatex.service enabled
Tuned.service enabled
Vdo.service enabled
Dm-event.socket enabled
Lvm2-lvmpolld.socket enabled
Sssd-kcm.socket enabled
Remote-fs.target enabled
Dnf-makecache.timer enabled
Unbound-anchor.timer enabled
In fact, there are many services that do not need to be started, waste resources and can be shut down. You can use the instruction systemctl disable firewalld to turn it off one by one, but it's too troublesome. It would be nice to close it in batches. Remember that there is a tool ntsysv,centos 8 that does not install this software. Use the following instructions to install it:
Yum install ntsysv
After installing ntsysv, execute the instruction ntsysv in any path and call up the setting interface.
To verify that the setting of ntsysv is consistent with the systemctl instruction operation, I temporarily remove the services "atd" and "firewalld" from the list of ntsysv services, click "ok" to make their exit effective, and then enter the following instructions on the command line:
Systemctl list-unit-files | egrep-I 'firewalld | atd'
[root@mysqlq126 ~] # systemctl list-unit-files | egrep-I 'firewalld | atd'
From the output, we can see that it is indeed the result we want. Then execute ntsysv, enter the list of services, shut down all the services you don't want, and then restart the system (which is the fastest).
Close selinux
First check whether selinux is turned on, and use the instruction getenforce. If the output is "Enforcing", it indicates that selinux is not set to unusable.
Next, edit the file / etc/sysconfig/selinux so that the value of SELINUX is disabled, which can be modified by the following directive:
Sed-is # SELINUX=enforcing#SELINUX=disabled# / etc/sysconfig/selinux
After the file is modified, it will not take effect. If you do not intend to restart the system on the code, execute the command setenforce 0 to temporarily shut down the annoying selinux (will there be tiles flying in? ).
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.