In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1 operating steps for system installation
OS Version:1804
Image download: http://cdimage.ubuntu.com/releases/
1.1 Select the installation language:
1.2 Select the first item in the installation interface for system installation
1.3 Select the language to be used during installation, which is also the default language to be used after the system is installed
1.4 Select region. Here, select the last other, then enter, then select Asia, and finally select China.
1.5 Select locale
1.6 Keyboard layout check, select NO
1.7 choose an American keyboard
1.8 confirm to use an American keyboard
1.9 configure hostname
1.10 create a normal user and set a password for it
1.11 confirm time zone
1.12 the method of selecting disk partition. Here the player moves the partition.
1.13 Select disk
1.14 confirm partitioning the disk
1.15 pairs of disk partitions
1.16 create a new partition
1.17 specify the partition size, where the full size of the disk is divided into the partition
1.18 Select the partition type, and select the primary partition here
1.19 Partition complete
1.20 complete partitioning and write data
1.21 confirm writing to disk
1.22 whether to use an agent, which is not entered here
1.23 whether to update automatically. Default is selected here, not automatic update.
1.24 Select the installation component, select the corresponding component to be installed, and then press the spacebar to select OpenSSH Server here.
1.25 install the GRUB boot loader to the master boot record
1.26 complete the installation and confirm to restart the server
1.27 logging in to the system
2 basic configuration of the system
Official document: https://help.ubuntu.com/
2.1 change the hostname
# cat / etc/hostname hechunping
2.2 change the name of the network card to eth*
# sed-I'/ GRUB_CMDLINE_LINUX=/s/ "$/ net.ifnames=0 biosdevname=0" /'/ etc/default/grub# update-grubSourcing file `/ etc/default/grub'Generating grub configuration file. Found linux image: / boot/vmlinuz-4.15.0-55-genericFound initrd image: / boot/initrd.img-4.15.0-55-genericdone# reboot# sed-I's Liga
2.3 configure root remote login
# by default, ubuntu does not allow root remote ssh. If there is an actual scenario that needs to allow root remote ssh, you need to set the root password and modify the / etc/ssh/sshd_config password as follows: ~ $sudo vim / etc/ssh/sshd_config32 # PermitRootLogin prohibit-password # defaults to disable login 33 PermitRootLogin yes # instead of allowing login 57 # PasswordAuthentication yes58 PasswordAuthentication yes # to turn on password authentication In fact, the default is to allow login through password authentication ~ $sudo su-root # to switch to the root authentication environment ~ # passwd # set the password Enter new UNIX password:Retype new UNIX password:passwd: password updated successfully~# systemctl restart sshd # restart the ssh service and test the root remote ssh connection
2.4 Network configuration
Official document: https://netplan.io/Ubuntu has abandoned the configuration of "fixed IP" in / etc/network/interfaces since 17.10, and the configuration has been changed to "netplan". The configuration is: / etc/netplan/01-netcfg.yaml# ubuntu 17.04 and previous static IP configuration: ~ # cat / etc/network/interfacesroot@hechunping:~# cat / etc/network/interfaces# interfaces (5) file used by ifup (8) and ifdown (8) auto loiface lo inet loopbackauto eth0 # "card" launch Write "actual" card name iface eth0 inet static # configure static IP, write "actual" card name address 172.18.3.12 # IP address netmask 255.255.0.0 # mask gateway 172.18.0.1 # off dns-nameservers 223.6.6 # DNSdns-nameservers 223.5.5.restart the network service ~ # / etc/init.d/networking restart~# systemctl restart networking.service
2.4.1 static IP address of single network card
Root@hechunping:~# cat / etc/netplan/01-netcfg.yaml # This file describes the network interfaces available on your system# For more information, see netplan (5). Network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no addresses: [192.168.7.132 gateway4 24] gateway4: 192.168.7.2 nameservers: addresses: [223.6.6.6] root@hechunping:~# netplan apply
2.4.2 configure static IP with multiple network cards
# cat / etc/netplan/01-netcfg.yaml # This file describes the network interfaces available on your system# For more information See netplan (5). Network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no addresses: [172.20.7.34 nameservers 16] gateway4: 172.20.0.1 nameservers: addresses: [223.6.6.6] eth2: dhcp4: no addresses: [192.168.7.34 shock 24] routes:-to: 172.20.0.0Uniple 16 via: 192.168.7.march netplan apply
2.4.3 single Nic bridging
# cat / etc/netplan/01-netcfg.yaml # This file describes the network interfaces available on your system# For more information, see netplan (5). Network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no bridges: br0: dhcp4: no addresses: [172.20.7.34 dhcp4 16] gateway4: 172.20.0.1 nameservers: addresses: [223.6.6.6] interfaces:-eth0# netplan apply
2.4.4 Multi-Nic bridging
Bridge br0 and br1 to eth0 and eth2, respectively. # cat / etc/netplan/01-netcfg.yaml # This file describes the network interfaces available on your system# For more information See netplan (5). Network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no eth2: dhcp4: no bridges: br0: dhcp4: no addresses: [172.20.7.34 nameservers 16] gateway4: 172.20.0.1 nameservers: addresses: [223.6.6.6] interfaces:-eth0 br1: dhcp4: no addresses: [192.168.7.34 Universe 24] routes:-to: 172.20. 0.0ax 16 via: 192.168.7.2 interfaces:-eth2root@hechunping:~# netplan apply
2.4.5 binding of dual network cards
The bridge command needs to be installed in advance Two network cards use the same network mode # cat / etc/netplan/01-netcfg.yaml # This file describes the network interfaces available on your system# For more information See netplan (5). Network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no eth2: dhcp4: no bonds: bond0: interfaces:-eth0-eth2 addresses: [172.20.7.34 nameservers 16] gateway4: 172.20.0.1 nameservers: addresses: [223.6.6223.5.5.5] parameters: mode: active-backup mii-monitor-interval: 10 percent poweroff# netplan apply
2.4.6 dual Nic binding + bridging
The purpose of card binding is to provide "card" redundancy and "available" and end-to-end aggregation functions, and bridging cards are used for services that require bridging devices. # cat / etc/netplan/01-netcfg.yaml # This file describes the network interfaces available on your system# For more information See netplan (5) .network: version: 2 renderer: networkd ethernets: eth0: no eth2: dhcp4: no bonds: bond0: interfaces:-eth0-eth2 parameters: mode: active-backup mii-monitor-interval: 100bridges: br0: dhcp4: no addresses: [172.20.7.34no bonds 16] gateway4: 172.20.0.1 nameservers: addresses: [223.6.6223.5.5.5] interfaces:-bond0# netplan apply
2.4.7 binding of internal and external multiple network cards
Achieve card binding in the case of multiple contacts. Two network modes, eth0,eth2 and NAT (eth3,eth4), are used here # cat / etc/netplan/01-netcfg.yaml # This file describes the network interfaces available on your system# For more information See netplan (5). Network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no eth2: dhcp4: no eth3: dhcp4: no eth4: dhcp4: no bonds: bond0: interfaces:-eth0-eth2 addresses: [172.20.7.34 nameservers 16] gateway4: 172.20.0.1 nameservers: addresses: [223.6.6.6223.5.5.5] parameters: mode: active-backup mii-monitor- Interval: 100 bond1: interfaces:-eth3-eth4 addresses: [192.168.7.34 netplan apply 24] parameters: mode: active-backup mii-monitor-interval: 100 routes:-to: 172.20.0.0 to 16 via: 192.168.7.
2.4.8 binding of internal and external multiple network cards + bridging
# cat / etc/netplan/01-netcfg.yaml # This file describes the network interfaces available on your system# For more information See netplan (5) .network: version: 2 renderer: networkd ethernets: eth0: dhcp4: no eth2: dhcp4: no eth3: dhcp4: no eth4: dhcp4: no bonds: bond0: interfaces:-eth0-eth2 parameters: mode: active-backup mii-monitor-interval: 100bond1: interfaces:-eth3-eth4 parameters: mode: active-backup mii-monitor-interval: 100bridges: br0: dhcp4: no addresses: [ 172.20.7.34 nameservers 16] gateway4: 172.20.0.1 nameservers: addresses: [223.6.6223.5.5.5] interfaces:-bond0 br1: dhcp4: no addresses: [192.168.7.34 no addresses 24] routes:-to: 172.20.0.0 via 16 via: 192.168.7.2 interfaces:-bond1# netplan apply
3 software package management
3.1 modify the address of the software warehouse
A Tsinghua Cloud Warehouse address: https://developer.aliyun.com/mirror: http://mirrors.ustc.edu.cn/help/ubuntu.html Tsinghua Xue: https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/ Huawei: https://mirrors.huaweicloud.com/###### Tsinghua Source configuration # Ubuntu's software source configuration file is / etc/apt/sources.list. Make a backup of the file that comes with the system and replace the file with the following, and you can use the software source image of TUNA. # cd / etc/apt/# cp-p sources.list sources.list.bak# vim sources.list# annotated source code image by default to improve apt update speed Uncomment deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu. if necessary Cn/ubuntu/ bionic-backports main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse# pre-release Software Source It is not recommended to enable # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse# apt update # to update the local package list index After modifying the apt repository, you must implement # Ali Source configuration # sed-I's _
3.2 apt tool usage
Apt list # apt lists repository packages equal to yum listapt search NAME # search for installation packages apt show apache2 # View details of an installation package apt install apache2 # online installation packages apt remove apache2 # Uninstall individual packages but retain configurations apt autoremove apache2 # remove installation packages and resolve dependencies apt update # update local package list index After modifying the apt repository, you must instruct apt purge apache2 # to uninstall a single package, remove configuration pieces, apt upgrade # upgrade all installed packages that can be upgraded to a new version, apt full-upgrade # upgrade the entire system, and remove old packages if necessary. Apt edit-sources # Edit source source package apt-cache madison nginx # check which version of the package in the repository you can install apt install nginx=1.14.0-0ubuntu1.6 # specify the specific version to install when installing the package
3.3 dpkg installation package Management
Rpm:RPM (Red Hat Package Manager) is a Red hat-based Linux Distribution package management system, which also refers to rpm packages. RPM is related to the management of rpm packages (such as installation, uninstallation, upgrade, etc.). "dpkg" is the abbreviation of "Debian Packager". It is a suite management system developed for "Debian" to facilitate the installation, update and removal of software. All "Linux" versions of source "Debian" make "dpkg", such as "Ubuntu", "Knoppix", and so on. Dpkg-I gitlab-ce_11.9.8-ce.0_amd64.deb # install a package dpkg-r gitlab-ce # remove a package retention configuration dpkg-r-P gitlab-ce # remove a package without retaining configuration dpkg-I gitlab-ce_11.9.8-ce.0_amd64.deb # View package information dpkg-c gitlab-ce_11.9.8-ce.0_amd64.deb # Check the contents and contents of the package dpkg-l # list all the software installed on this machine
3.4 set up the oracle JDK environment
# pwd/usr/local/src decompress the "binary" component and set the soft connection: # tar xf jdk-8u212-linux-x64.tar.gz# ln-sv / usr/local/src/jdk1.8.0_212 / usr/local/jdk configuration environment variable: # vim / etc/profileexport JAVA_HOME=/usr/local/jdkexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATHexport CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib / tools.jar redirects the environment variables and validates: # source / etc/profile# java-versionjava version "1.8.0x212" Java (TM) SE Runtime Environment (build 1.8.0_212-b10) Java HotSpot (TM) 64-Bit Server VM (build 25.212-b10 Mixed mode)
3.5 install OpenJDK
# apt install openjdk-8-jdk
3.6 install regular system commands
# apt purge ufw lxd lxd-client lxcfs lxc-common# apt install iproute2 ntpdate tcpdump telnet traceroute nfs-kernel-server nfs-common lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev ntpdate tcpdump telnet traceroute gcc openssh-server lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev ntpdate tcpdump telnet traceroute iotop unzip zip
3.7 Optimization of system resource constraints
# soft and hard limits of resources in cat / etc/security/limits.conf#root accounts root soft core unlimitedroot hard core unlimitedroot soft nproc 1000000root hard nproc 1000000root soft nofile 1000000root hard nofile 1000000root soft memlock 32000root hard memlock 32000root soft msgqueue 8192000root hard msgqueue 819200 "soft and hard limits of resources in other accounts" * soft core unlimited* hard core unlimited* soft nproc 1000000 * hard nproc 1000000 * soft nofile 1000000 * hard nofile 1000000 * soft memlock 32000 * hard memlock 32000 * soft msgqueue 8192000 * hard msgqueue 8192000
3.8e kernel parameter optimization
# Controls source route verificationnet.ipv4.conf.default.rp_filter = 1net.ipv4.ip_nonlocal_bind = 1net.ipv4.ip_forward = "Do not accept source routingnet.ipv4.conf.default.accept_source_route =" Controls the System Request debugging functionality of the kernelkernel.sysrq = "Controls whether core dumps will append the PID to the core filename.# Useful for debugging multi-threaded applications.kernel.core_uses_pid =" Controls the use of TCP syncookiesnet.ipv4.tcp_syncookies = "Disable netfilter on" Bridges.net.bridge.bridge-nf-call-ip6tables = 0net.bridge.bridge-nf-call-iptables = 0net.bridge.bridge-nf-call-arptables = "Controls the default maxmimum size of a mesage queuekernel.msgmnb = 6553" # Controls the maximum size of a message In byteskernel.msgmax = 6553 Controls the maximum shared segment size, in byteskernel.shmmax = 6871947673 Controls the maximum number of shared memory segments In pageskernel.shmall = 429496729 "TCP kernel paramaternet.ipv4.tcp_mem = 786432 1048576 1572864net.ipv4.tcp_rmem = 4096 87380 4194304net.ipv4.tcp_wmem = 4096 16384 4194304net.ipv4.tcp_window_scaling = 1net.ipv4.tcp_sack =" socket buffernet.core.wmem_default = 8388608net.core.rmem_default = 16777216net.core.wmem_max = 16777216net.core.netdev_max_backlog = 262144net.core.somaxconn = 20480net.core.optmem_max = 8192 TCP connnet " .ipv4.tcp _ max_syn_backlog = 262144net.ipv4.tcp_syn_retries = 3net.ipv4.tcp_retries1 = 3net.ipv4.tcp_retries2 = "tcp conn reusenet.ipv4.tcp_timestamps = 0net.ipv4.tcp_tw_reuse = 0net.ipv4.tcp_tw_recycle = 0net.ipv4.tcp_fin_timeout = 1net.ipv4.tcp_max_tw_buckets = 20000net.ipv4.tcp_max_orphans = 3276800net.ipv4.tcp_synack_retries = 1net.ipv4.tcp_syncookies = 1 # keepalive connnet.ipv4.tcp_keepalive_time = 300net.ipv4.tcp_keepalive_intvl = 30net.ipv4.tcp_keepalive_probes = 3net.ipv4.ip_local_port_range = 10001 6500mm swapvm.overcommit_memory = 0vm.swappiness = 10#net.ipv4.conf.eth2.rp_filter = 0#net.ipv4.conf.lo.arp_ignore = 1#net.ipv4.conf.lo.arp_announce = 2#net.ipv4.conf.all.arp_ignore = 1#net.ipv4.conf.all.arp_announce = 2
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
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: 267
*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.