The graphics processing unit, or GPU was originally designed to accelerate the rendering of 3D graphics. you can use graphics SDK(DirectX, OpenGL) to use GPU for rendering, but it has become one of the most important types of computing technology now, it is designed for parallel processing, the GPU is used in a wide range of applications, including:
Since the inception of FPGA(field programmable gate array) technology there were actually only two FPGA companies in the market: Xilinx and Altera. Along the years, both companies did a terrific job growing the market and protecting their market share. When Intel acquired Altera, Xilinx was left as the only major FPGA company in the market. Xilinx had ~50% market share while Altera (Intel) has ~37% and Lattice Semiconductor has a 10% market share. In October 2020, AMD has acquired Xilinx. This concludes that the 2 largest CPU vendors have acquired the 2 largest FPGA companies.
TOML stands for Tom’s Obvious, Minimal Language. It is a data serialization language designed to be a minimal configuration file format that’s easy to read due to obvious semantics. It is an alternative to YAML and JSON. It aims to be more human friendly than JSON and simpler that YAML.
Go is a statically typed, compiled programming language designed at Google, Go is syntactically similar to C, but with memory safety, garbage collection, structural typing, concurrency.
Go is influenced by C, but with an emphasis on greater simplicity and safety.
A syntax and environment adopting patterns more common in dynamic languages:
Optional concise variable declaration and initialization through type inference (x := 0 instead of int x = 0; or var x = 0;).
Fast compilation.
Remote package management (go get) and online package documentation.
Distinctive approaches to particular problems:
Built-in concurrency primitives: light-weight processes (goroutines), channels, and the select statement.
An interface system in place of virtual inheritance, and type embedding instead of non-virtual inheritance.
A toolchain that, by default, produces statically linked native binaries without external dependencies.
YUM is the primary package management tool for installing, updating, removing, and managing software packages in Red Hat Enterprise Linux. YUM performs dependency resolution when installing, updating, and removing software packages.
RPM is a popular package management tool in Red Hat Enterprise Linux-based distros. Using RPM, you can install, uninstall, and query individual software packages. Still, it cannot manage dependency resolution like YUM. RPM does provide you useful output, including a list of required packages. An RPM package consists of an archive of files and metadata. Metadata includes helper scripts, file attributes, and information about packages.
Yum
Yum is much more useful than rpm as it resolves dependencies of the package and installs them all!, First yum download meta data of packages from enalbed repo, rpm is downloaded only when it’s installing. any another command like search, list only check the meta data.
# show all repos, disabled and enabled $ yum repolist all
# yum cache $ yum clean all $ yum makecache
# show packages from local cache, no auto cache update $ yum list # installed and not $ yum list libvirt # installed and not of given package $ yum list installed # installed only $ yum list installed libvirt # installed only of given package # shell-style glob $ yum list mysql* # installed and not pkg with prefix mysql
$ yum install yum-utils # can trigger cache update
# show latest version of ipvsadm(will trigger cache update) of repo $ repoquery ipvsadm
# show files of given pkg from local cache and will trigger cache update # bash can be installed or not(list files of given packages) $ repoquery --list bash /etc/skel/.bash_logout /etc/skel/.bash_profile /etc/skel/.bashrc /usr/bin/alias /usr/bin/bash /usr/bin/bashbug ...
mysql++.x86_64 3.1.0-12.el7 epel # not install available from epel repo ipvsadm.x86_64 1.27-8.el7 @base # installed from base repo: @ indicate installed
# check all packages contains ipvs in its name(package name) $ yum search ipvs # wildcard searching
$ yum info ipvsadm # show basic info of a package installed or not, no auto cache update $ yum provides /etc/fstab # show which package(installed or not) has such file from local cache, no auto cache update $ yum provides rm# show which package(installed or not) has rm binary from local cache, no auto cache update
$ yum grouplist $ yum groupinfo "Development tools"# show what packages in this group $ yum groupinstall -y "Development Tools"# install group of packages $ yum groupremove
######################## Download file of given rpm ######################### $ yumdownloader ipvsadm # save at current dir(no matter it's installed or not)
$ yum install --downloadonly ipvsadm # saved at /var/cache/yum/x86_64/ $ yum install --downloadonly --downloaddir=/tmp ipvsadm # if packet is already installed $ yum reinstall --downloadonly --downloaddir=/tmp ipvsadm
$ yumdownloader --source ipvsadm # download ipvsadm-xxx-src.rpm ######################## Download file of given rpm #########################
$ yum history# show what operations happened $ yum history undo <id> # undo an operation
#####################upgrade and downgrade#################################### # list all possible version of given packet from local cache $ yum provides ipvsadm
# check current installed version $ rpm -qa | grep ipvsadm
# upgrade to latest or specific version # NOTE for upgrade, package must be installed before!!! $ yum upgrade libvirt Package(s) libvirt available, but not installed.
# upgrade does not run daemon-reload and service restart!!! $ yum upgrade -y ipvsadm # can trigger local cache update $ yum upgrade -y ipvsadm-1.27-7.el7.x86_64 # can trigger local cache update
# yum upgrade return 0 (OK) !!! # if packet does not exist # or upgrade to specific version or latest
$ yum upgrade -y no-exist-package Loaded plugins: fastestmirror, langpacks, priorities Loading mirror speeds from cached hostfile 47 packages excluded due to repository priority protections No Match for argument: no-exist-package No package no-exist-package available. No packages marked for update $ echo $?
# downgrade to previous version or specific version # NOTE for upgrade, package must be installed before!!! $ yum downgrade ipvsadm $ yum downgrade ipvsadm-1.27-7.el7.x86_64 #####################upgrade and downgrade####################################
RPM
Name Format of RPM name-version-release.os.arch., example: bash-4.3.2-5.el6.x86_64.rpm
name: package name
version: package version
release: identifier of RPM itself, not related to package
# rebuild xx.rpm from source, then install it $ rpm -rebuild *.src.rpm $ rpm -ivh /usr/src/dist/RPMS/xx.rpm
# Query $ rpm -qa # check all installed packages $ rpm -q ipvsadm # check if ipvsadm installed or not
$ rpm -qi ipvsadm # check basic info of this installed rpm
# show files of given pkg, NOTE this requires ipvsadm must be installed!!! $ rpm -qlv ipvsadm # check all installed files of given installed rpm # show files of given local rpm $ rpm -qlp ./ipvsadm.x86_64 0:1.27-8.el7
# preinstall scriptlet – this will run before a package is installed # postinstall scriptlet – this will run after a package is installed # preuninstall scriptlet – this will run before a package is uninstalled # postuninstall scriptlet – this will run after a package is uninstalled
# check scripts of the installed rpm, post/pre etc $ rpm -q --scripts libvirt preinstall scriptlet (using /bin/sh): # 'libvirt' group is just to allow password-less polkit access to # libvirtd. The uid number is irrelevant, so we use dynamic allocation # described at the above link. getent group libvirt >/dev/null || groupadd -r libvirt
exit 0 postinstall scriptlet (using /bin/sh):
if [ $1 -eq 1 ] ; then # Initial installation systemctl preset virtlockd.socket virtlogd.socket libvirtd.service >/dev/null 2>&1 || : fi
# In upgrade scenario we must explicitly enable virtlockd/virtlogd # sockets, if libvirtd is already enabled and start them if # libvirtd is running, otherwise you'll get failures to start # guests
$ rpm -qf /usr/sbin/ipvsadm # check which rpm this file belongs to
############################ For uninstalled package ########################################################### # -p, --package PACKAGE_FILE # Query an (uninstalled) package PACKAGE_FILE. The PACKAGE_FILE may be specified as an ftp or http style URL ############################ For uninstalled package ########################################################### # show files of given rpm $ rpm -qlp ./ipvsadm.x86_64 0:1.27-8.el7
# Rebuild rpm from installed files then deploy it with rebuild rpm # edit some conf files then rebuild it $ rpmrebuild ipvsadm
# with editing ipvsadm.spec prompt, then rebuild $ rpmrebuild -e ipvsadm
When scriptlets are called, they will be supplied with an argument. This argument, accessed via $1 (for shell scripts) is the number of packages of this name which will be left on the system when the action completes. So for the common case of install, upgrade, and uninstall we have:
install
upgrade
uninstall
%pretrans
$1 == 1
$1 == 2
(N/A)
%pre
$1 == 1
$1 == 2
(N/A)
%post
$1 == 1
$1 == 2
(N/A)
%preun
(N/A)
$1 == 1
$1 == 0
%postun
(N/A)
$1 == 1
$1 == 0
%posttrans
$1 == 1
$1 == 1
(N/A)
Note: even some scripts in rpm(built-in, no such files after installation) come from .spec, there is NO spec file in xxx.rpm but xxx.src.rpm.
It depends on the xx.rpm, as RPM allows to add scripts, hence you can do this there, but most of time, service is not started automatically after installation.
show all services with systemctl
1 2 3 4 5 6 7 8
# show all active systemd service $ systemctl --type=service
# show all active/inactive systemd service $ systemctl --type=service --all # enable means start at boot time
$ systemctl enable htg
yum upgrade vs yum install
yum upgrade needs the package installed before
yum upgrade does NOT touch conf file, it remains what changed, actually, this depends on rpm.spec file
libvirt provides lots of tools to manage VM or virtual disk, let’s take a quick look about them.
VM management
virt-install: install VM etc
virsh: start, stop, destroy VM, monitor and collect stats of VM etc
virt-manager: GUI for manage VM
Virtual disk management(provided by libguestfs)
guestfish: interactive shell to manage disk(–verbose for debug)
guestmount/guestumount: mount/umount disk to host path(–verbose for debug)
virt-cat/virt-copy-in/virt-copy-out/virt-format/virt-xxx: commands to manage virtual disk(–berbose for debug)
ALL libvirt tools(included libguestfs tools) communicate with libvirt daemon to manage vm or disk by default, but you can direct with qemu if libvirt is not thre
Network block devices (NBD) are used to access remote storage device that does not physically reside in the local machine, for each network block device, it’s mapped with (/dev/nbdx) to client as a local block device, you can do low level operation for this block device, like partition, format with filesystem that NFS can NOT do.
NBD works according to a client/server architecture. You use the server to make a volume available as a network block device from a host, then run the client to connect to it from another host.
Load balancing is a method of distributing IP traffic across a cluster of real servers, providing one or more highly available virtual services. When designing load balanced topologies, it is important to account for the availability of the load balancer itself as well as the real servers behind it.
Keepalived provides frameworks for both load balancing and high availability. The load balancing framework relies on the well-known and widely used Linux Virtual Server (IPVS) kernel module, which provides Layer 4 load balancing. Keepalived implements a set of health checkers to dynamically and adaptively maintain and manage load balanced server pools according to their health.
high-availability is achieved by the Virtual Router Redundancy Protocol (VRRP). VRRP is a fundamental brick for router failover. In addition, Keepalived implements a set of hooks to the VRRP finite state machine providing low-level and high-speed protocol interactions. In order to offer fastest network failure detection, Keepalived implements the Bidirectional Forwarding Detection (BFD) protocol. VRRP state transition can take into account BFD hints to drive fast state transition. Keepalived frameworks can be used independently or all together to provide resilient infrastructures.
In short, Keepalived provides two main functions:
Health checking for LVS systems
Implementation of the VRRPv2 stack to handle load balancer failover