Calculation based base

Computer Basics

Computer Organization and functions

  Von Neumann architecture: Von Neumann 1946, a computer hardware five major operator, controller, memory, input devices and output devices.

--- CPU server hardware

CPU is the Central Processing Unit acronym, that is the central processor. Constituted by a controller and operator, the whole computer system is the most important part .
♦ frequency: the frequency is the clock frequency of the CPU (CPU Clock Speed), when the operating frequency of CPU operation (the number of synchronization pulses that occur within one second) short. The unit is Hz. Generally, the higher the frequency, the faster the CPU, due to different internal structure, not all of the same clock frequency of CPU performance are the same.
♦ FSB: operating frequency of the system bus, the CPU and the external (motherboard chipset) exchange data, clock frequency instruction.
♦ multiplier; multiplier means CPU FSB frequency and the phase difference in multiples.
♦ three relations are: frequency = FSB * multiplier.
♦ cache (Cache): the exchange of high-speed memory. CPU cache is divided into primary, secondary and tertiary cache, i.e. Ll, L2 of, L3
♦ speed memory bus (Memory-Bus Speed): generally equivalent to the CPU FSB, the CPU refers to two (L2) cache and communication speed between the memory.
♦ address bus width: determines the physical address space of CPU can access.

Server hardware --- Board

  • Motherboard Mainboard, Motherboard system board systemboard or template, is mounted in the chassis, a computer is one of the most important basic component .
  • Board generally rectangular circuit board, keyboard and panel control switch interface lamp connectors, expansion slots, card board and DC power supply plug-like element.

    --- server hardware memory

  • Between the CPU and the memory is an external memory , the external memory when the CPU is in the high speed operation programs and data stored program instructions, data and results of intermediate temporary sites, its physical essence it is provided with a set of data input and data output high-speed integrated circuit memory function .
  • CPU memory is directly addressable memory space, is made of a semiconductor device. Memory is characterized by memory speed .
  • The computer running all programs are carried out in memory , thus affecting the performance of computer memory is very large.
  • External memory: hard disk, U disk, floppy disk, CD-ROM.
  • The difference between memory and external memory:
    • Data loss after power failure memory
    • External memory data can be saved after power failure
  • Capacity: the storage capacity of the memory unit is typically "MB" or "GB"

    Server hard disk hardware ---

    Mechanical hard disk structure:

  • Storage media (Media) - disk
     substrate disc is made of a metal or glass materials, high density and high quality to achieve stable, smooth surface of the substrate requirements, you can not have any defects.
  • A head (Read Write Head) - heads
     head is a key component of the hard disk to read data, his role is primarily magnetic information stored on the hard disc into electrical signals transmitted outwardly.
  • A motor
     provided with a motor up to the platters, and the like to 7200,10000,15000 RPM constant speed of rotation, in order to maintain its equilibrium can not shake, so that stringent quality requirements, no noise temperature.

    The basic parameters of the hard disk

  • Capacity: capacity hard disk is the most important parameter. Units are MB, GB, TB
  • Speed: speed refers to the number of turns of rotation of the disk platter per minute, the unit in rpm. Now the hard drive speed has reached 10000rpm, 15000rpm.
  • Transmission Speed: Transmission speed (Data Transfer Rate). Hard disk data transfer rate is the speed of reading and writing data to the hard disk, in megabytes per second (MB / s).
  • Cache: The purpose of the hard disk cache is to solve the problem before and after the class read and write speeds do not match the system to increase the speed of the hard disk read and write.

    Hard disk interface type

      The current mainstream hard drive interface is SATA and SAS interfaces.

    Server performance short board

      If the CPU is capable of handling 1,000 service requests per second, a variety of bus load capacity can reach 500, but the card can only accept 200 requests, while the hard disk can only afford 150, then this server processing power only could be 150 requests / sec, 85 percent of the computing power of the processor is wasted.
      Among the computer system, read and write speed of the hard disk has an impact on system performance bottleneck problem.

    SSD hard drive

      SSD refers to the use of the composition of NAND Flash SSD. Which is unique in that no mechanical structure, the write mode and erase in blocks do read and write performance, and therefore in the efficiency of reading and writing, reading and writing very dependent on the technical design of fast read and write access speed SSD, the performance stability, high shock resistance, low heat, low temperature, low power consumption, no noise. Because there is no mechanical parts, so prolonged use smaller chance of failure. Disadvantages: high prices, small capacity, no hard disk before the general cost advantage.

    --- server hardware array card

    Raid Card

  • To establish and implement a RAID rebuild, repair and multi-bit error detection, error disk auto detection. RAID chip allows the CPU resources to be released.

    Action array card (RAID card)

  • The array of several hard disk drive card according to certain requirements of the composition as a whole, by the array controller of the management system
  • Array card used to increase the reliability and performance of the disk subsystem.

    Array card parameters

  • Supported RAID Levels
  • Cache array card
  • Battery Protection

    --- server hardware, power supplies and fans

  • Support for server power load
  • Supports redundant, prevent power failures
    • Fault warning and prevention
    • Preventive maintenance before failure
    • To ensure the continued operation of the server
  • The power subsystem comprising: a power supply and fan Smart
  • Redundant power supplies and fans

    --- server hardware graphics

      Servers are integrated on the motherboard graphics, but the memory capacity is not high, usually 16M or 32M

    LAN server hardware ---

      Servers are integrated on the motherboard of the card, 1Gbps transmission rate, i.e., Gigabit Ethernet. Special applications require high card, such as a fiber network card, Infiniband network card, a transmission rate can reach 10Gbps, 20Gbps, i.e., Gigabit card.

    Server hardware --- hot swap technology

  • Referred to as heat exchange technology (Hot Swap), to allow replacement of faulty devices without turning off the hot plug state.
  • Common hot-plugged device: hard drives, power, PCI equipment, fans and the like.
  • Hot-swap hard disk technology with RAID technology together, we can restore the server data on the failed hard drive without turning off the state, co-workers does not affect network users to use the data.

    Basics --- storage network storage

      Equipment and media for storing data information, an external storage of a computer system, data can be securely stored long-term presence.

    Storage Networking

  • ----- direct attached storage the DAS (Direct Attached Storage)
  • ----- the NAS Network Attached Storage (Network Attached Storage)
  • SAN ----- storage area network (Storage Area Networks)

\ SAS NAS SAN
Transport Type SCSI、FC IP IP、FC、SAS
type of data data block file data block
typical application any file server database application
advantage Disk and server separation
to facilitate unified management
Do not take up the application server resources,
broad support for operating systems,
expansion easier,
plug and play,
easy to install
High scalability,
high availability,
data centralized,
easy to manage
Shortcoming Short connection distance
data scattered,
difficult to share
storage space utilization is not high
Limited scalability
Block-level application data backup and recovery network bandwidth is not suitable for large memory capacity NAS higher compared to the cost of installing and upgrading complex than NAS

Kernel function and role

Core Overview

  Refers to a kernel provides hardware abstraction layer, disk and file system control, multi-tasking and other features of the system software. The kernel is the core of an operating system, is the most basic part of the operating system. It is responsible for process management system, memory, device drivers, and network file systems, determines the performance and stability of the system. It is to provide part of the software for many applications secure access to computer hardware, which access is limited, and the kernel decide at what time a program on how long a part of the hardware operation. Operate directly on the hardware is very complex, so the kernel typically provides a hardware abstraction method to complete these operations. Hardware abstraction hides the complexity, provides a simple to use software and hardware, unified interface to make programming easier.
  A kernel is not a complete operating system. For example, an operating system called Linux, or GNU / Linux operating system based on Linux kernel intact.

Core role

  Process management: the kernel is responsible for creating and destroying processes, and process them in touch with the outside world (input and output), communications between different processes (through signals, between the pipes, or interprocess communication primitives) is a function of the whole system is essential , also handled by the kernel. In addition, the scheduler, the process of how to share control CPU, is part of the process management. More generally, the kernel process management activities to achieve a more abstract processes on a single or a few CPU.
  Memory management: the computer's memory is a major resource, processing strategy it uses the system performance is critical. For each kernel all processes have established a virtual address space on the limited available resources. The different parts of the kernel memory management subsystem to interact through a set of function calls, from simple malloc / free for the more complex functions.
  File Management: Linux file system concept largely based; almost anything in Linux can be regarded as a file. Kernel established a structured file system on top of unstructured hardware, the result is very much abstract file application throughout the system. Further, Linux file systems support multiple types, that is, different physical media data organization. For example, the disk can be formatted into a standard Linux ext3 file system, FAT file system commonly used, or several other file systems.
  Management driving: Almost every system operation are finally mapped to a physical device, in addition to the processor, memory and very little other entity, any control by all devices specific to the addressed devices related operations code to. These codes called device drivers. The kernel must be embedded in the driving system for each peripheral appearing, from the hard disk drives and tape drives to the keyboard.
  Network management: network must be managed by the operating system, because most network operations are not specific to one process: access to the system message is asynchronous events. Packets must be collected before a certain process to take over, identification, distribution, system is responsible for delivering data packets between the program and the network interface, it must control the execution of the program according to the network activity of the program. In addition, all the routing and address resolution issues are implemented in the kernel.

Common Linux distributions

Moderators Linux distributions have three branches: Debian, Slackware, Redhat.

Debian

  • Ubuntu: Debian-based development of open source Linux operating system, mainly for desktops and servers;
  • Linux Mint: Linux distribution based on Debian and Ubuntu, desktop systems dedicated to individual users daily work easier to use, more efficient, and the goal is to provide a more complete experience instantly available.

Slackware

  • Suse: Based on the development of a secondary Slackware Linux, mainly for commercial desktops, servers.
  • SLES (Suse Linux Enterprise Server (SLES)): Enterprise Server operating system, Microsoft is the only system compatible with the Linux operating system.
  • OpenSuse: Suse by the evolved, aimed at promoting the use of Linux, mainly for the desktop environment, the user interface is very beautiful, and good performance.

Redhat

  • rhel (red hat enterprise Linux): Red Hat's announcement of a business user-oriented Linux operating system. Mainly used for early versions of the desktop environment, free of charge:
  • Fedora: Red Hat Linux terminated after Issue-based company plans to Red Hat Fedora Red Hat Linux to replace the application in the field of personal, while the other issue of Red Hat Enterprise Linux to replace Red Hat Linux applications in the field of business. Fedora functionality for the user, it is a full-featured, free operating system updates fast, while the sponsor Red Hat company, it is a lot of new technology test platform is considered the available technology will eventually be added to Red Hat Enterprise Linux in. Fedora release a new version about every six months.
  • Centos: Based on Red hat Linux provides enterprise-class Linux distribution freely available source code. Each version of Centos will get years of support (by way of security updates). The new version of Centos issued once every two years, and each version of Centos regularly (about 6 months) updated to support new hardware. In this way, the establishment of a safe, low-maintenance, stable, high predictability and reproducible Linux environment.

Other releases

  • Gentoo: linux-based free operating system based on the free Linux operating system, it can be automatically optimized and customized for just about any application or need. Extreme configurability, performance and a top-notch user and developer community are all hallmarks of the Gentoo experience, Gentoo philosophy is freedom and choice. Thanks to a technology called Portage, Gentoo can become an ideal secure server, development workstation, professional desktop, gaming system, embedded solution or something else - whatever you need it to be, what it can become . Because of its near-unlimited adaptability, call Gentoo a meta-distribution.
  • Aech Linux (also known as Arch): with simplicity as a lightweight Linux distribution design concept. The development team adhering to the simple, elegant, and is designed to minimize the code.

    Common open source license

    GPL agreement

      Among the various free software licenses used, most attention is perhaps universal public license (General Public License, referred to as the GPL), GPL, like other free software licenses permit the public to enjoy: running, freedom, free distribution of software spread of replication software, access to the source code of free software, free to improve the software and to make their own improved version of the spread of the social issue.

    GPL agreement's main principles:

  • From beginning to end to ensure that the software released as open source form, protection and development gains are not stolen for commercial sale. Any set of software, as long as the use of third-party source software protected by the GPL, and to non-developer release, the software itself will automatically be protected by the GPL entities and constraints. In other words, at which point it must be open source.
  • GPL is a left side roughly reflect copyright (Copyleft, or translated as "anti-copyright" "copyright belongs to the left", "copyleft", "version responsibility", etc.). You can remove all of the original copyright information, as long as you keep an open source, and with the source code, binary version of the GPL license attached on the line, so that future generations can be very clear that the authorization information for this software. GPL is the essence, as long as the complete open source software in the situation, as far as possible so that users get the space for free play, the software get faster and better development.
  • Whether the software publisher in what form, must be accompanied source code. For example, available for download on the Web, it must be binary version (if any) to download the same page, clearly provide the source code download link. If you publish on CD-ROM, CD-ROM must be accompanied source file.
  • Development or maintenance of the company or individual to follow the development of the GPL software, the user can charge a service fee. But still the old saying - must provide free full source code for software, source code and do not be bundled service or any disguised bundling.
      We are very familiar with Linux is to use the GPL. The GPL and BSD, Apache Licence and so encourage code reuse license very different. The starting point of the GPL open source code / free use and reference / modification / derivative code open source / free, but not allowed to modify the code and derived as a closed-source commercial software distribution and sales. This is why we can use a variety of free linux, including a variety of by individuals, organizations, and commercial software free software developed by commercial companies on the linux and linux.
      The main content of the GPL is to simply use ( "use" refers to the class library reference, the revised code or derivative of this code) GPL agreement in a software product, the software product must also be GPL license must also be both open source and free . This is called "contagious." The GPL products as a separate product without any problems, you can also enjoy free advantage.
      Due to the stringent requirements of the use of the GPL GPL library of software products must use the GPL, GPL agreement for the use of open source, commercial software or code division confidentiality requirement is not suitable for integration / adoption as the basis for the development of libraries and secondary .

    LGPL agreement

      LGPL is GNU Lesser General Public License (GNU General Public License) abbreviated form, formerly known GNU Library General Public License (GNU General Public License), referred later changed Lesser GPL, the GPL that is more relaxed, loose extent on similar to BSD, Apache, XFree86 license. GPL (General Public License) and the License GNU LGPL are two. More and more free software (Free Software) use the GPL as his authority, if the risk of GPL is not know, may violate the GPL in the use of free software license, I am afraid there will be indicted. So before any company should ensure that the use of free software under license GPL LGPL or other variants.
      LGPL is a GPL is designed for use primarily open source libraries agreement. And the use of any software requirements GPL / modify / GPL-derived library must use different protocols GPL. LGPL allow commercial software library reference (link) mode without using the open source code library LGPL commercial software. This makes use of the LGPL open source code can be used as a reference library and publish and sell commercial software. However, if the code changes the LGPL or derivatized, all the modified code, the code involves additional code modifications and derived portions must use the LGPL. Thus the LGPL open source code is very suitable as a third-party commercial software libraries are referenced, but not for those who want to the LGPL code base, and derived by modifying the way to do secondary development of business software used.
      GPL / LGPL are the original author of protecting intellectual property rights, prevent people from copying and use of open-source development of similar products.

    BSD agreement

      Original BSD license with the University of California, Berkeley, published each 4.4BSD / 4.4BSD-Lite version of the above (BSD is Berkly Software Distribution shorthand), then it will gradually use down. In 1979 the University of California at Berkeley released a BSD Unix, is known as a pioneer in open source, BSD license is as BSD Unix developed. BSD licenses was adopted by Apache and BSD operating system and other open source software.
      Compared to the GPL license rigor and MPL licenses, BSD license on a number of loose, just as is the need to attach the original license, but more interesting it is that it requires all developers to further their own copyright information is entered, so to get the software BSD license issuance may experience a small state, that these licenses copyrighted material larger than the space occupied by the program.

    Apache Agreement

      Apache Licence protocol is well-known non-profit organization open source Apache used. The agreement is similar to BSD and also encourage code sharing and respect the original author copyright, also allows code changes, then released (as open source or commercial software). Conditions need to be met and BSD also similar:
  • Users need to code an Apache Licence
  • If you modify the code, a description of the modified files.
  • Extending the code (code and source code modifications are derived) having the same code as the need in the protocol, trademarks, patents, and other statements contained in the original OF predetermined required.
  • If the re-release of the product is included in a Notice file, the file needs to have in the Notice Apache Licence. You can add your own license in the Notice, but not the performance of the Apache Licence to change the constitution.
      Apache Licence also licensed for commercial use friendly. Users can also modify the code as needed to meet the needs and as open source or commercial product launches / sales.

    MIT agreement

      MIT and BSD license is as wide range of authors want to retain the copyright, without any other restrictions. In other words, you must include a statement of the original license agreement in your distro, no matter you are in binary or source code released released. MIT Massachusetts Institute of Technology, also known as license agreement, originally developed by the Massachusetts Institute of Technology. Licensee the right to: 1, the authorized person has the right to use, copy, modify, merge, publishing, distribute, sublicense and sell copies of the software and the software. 2, the authorized person may be authorized to modify the terms of the program as needed for appropriate content. Licensee obligations: in all copies of the software and software must include a copyright notice and permission notice.

    Linux's philosophy

    Everything is a file

      Everything is a file: is one of the basic philosophy of Unix / Linux is. Not only ordinary files, directories, character devices, block devices, sockets, etc. are treated in Unix / Linux are in a file; although they are different types, but it is provided with a user interface.

    Small, single-purpose program

      Programs and executable files should not be too complicated, so as to ensure the efficient operation of the linux kernel

    Linker together to accomplish complex functions

      Complex tasks by connecting a number of simple procedures to implement complex functions. For linux complex functions implemented in many ways a combination of a simple procedure, to ensure efficiency of a simple function while bound to be complex procedures of efficiency

    Avoid confusing user interface

      Such as windows as a problem most people choose will be restarted, it is not, then is to re-install the system, because for windows that is not open source, and the user interface is more complex operating system is a problem, the average person is simply no solution of. But linux is not the same, the first linux is open source, no matter what the problem may be all right for configuration troubleshooting, modifying the system through simple commands, everything is clear and concise basis.

    Configuration data is stored in the text

      Configuration data is stored in the text: All linux configuration files are stored in text configuration file which, no matter what configuration changes are simply modify its configuration files, configuration file in text form only need a text editor to modify any that is rather than as may be similar to the windows will be saved in the registry, windows registry and require specialized binary or hex editor before editing, modifying more complicated.

    Linux directory

    linux directory structure

    / - Root directory

      As the name suggests, the root directory is the directory where all directories, it is the root of all Linux directory, to some Conceptually, it is somewhat similar to the disk drive letter in Windows. After'll see, all the other catalogs are in / beginning.

    / Bin - important user store binary files directory

      is an abbreviation for binary bin, / bin directory for a very important user binary files, in fact, some programs. Of particular note is / bin commands are stored in single-user mode can also be operated to maintain, these commands can be used and the ordinary users root. In / bin, we can see for example, chmod, du these Linux command program we use often.

     / Boot - files directory needs to start when the storage system

      / Boot is stored in the main need to use the system startup files, such as EFI, GRUB and Linux kernel.

    / Dev - the device file directory

      Linux will be everything as files, devices are no exception, whether hardware or virtual device entity. A first physical hardware such as the hard disk is detected will be mounted to / dev / sda, the second block is mounted to the / dev / sdb, and so on. Virtual devices such as null, random, stderr, stdin and stdout.

    / Etc - configuration files directory

      etc is the meaning of Et cetera, represent some other things related, / etc from the early UNIX was used to store configuration files, still in use. Note that, / etc is stored in system configuration files, user-specific configuration files on each user's / home directory.

    / Home - user directory

      / Home directory is stored in each user's user directory, for example, a user named tom, / home / tom is his user directory, user directory for each user to store user data and user profiles, such as each .bashrc file users, .ssh catalog. Ordinary users can only access their own user directory and can not access someone else's, root user does not have this limitation.

    / Lib - shared important library directory

      / Lib directory is stored in / bin and / sbin those important binary files (program) requires shared library. In addition / usr / bin binary file (program) requires shared libraries are stored in / usr / lib.

    / Lost + found - to recover files directory

      Each Linux file system has / lost + found directory, when the file system crashes, file system self-test will be when the next start, any file corruption in the process of collapse will be placed in / lost + found, you you can try to find and recover the files.

    / Media - to delete the media directory

      When you delete some media linked (such as CD, U disk, CD-ROM, etc.) when loaded onto a computer, the system will automatically create a subdirectory under / media, then the media can be accessed by visiting this subdirectory. For example, you insert the CD on your computer, it will automatically create a subdirectory under the / media directory, you can access the contents of the CD by accessing this subdirectory.

    / Mnt - temporary mount point directory

      mnt is an abbreviation of the mount, to mount the various devices to the system, the device will generate the corresponding directory in / mnt directory, for example to mount the CD, file systems, CD and the like.

    / Proc - process kernel and file directory

      / Proc is a virtual directory, the file does not contain any standard. When the system starts, the current kernel and hardware information for testing, and the information in this directory (in fact, in memory). You can use the cat / proc / meminfo to see some information about the memory, or use the cat / proc / version Linux kernel to see the information.

    / Opt - optional packages directory

      Optional opt is meant optional packages installed in the system is stored in / opt directory.

    / Root - root user's home directory

      And general user's home directory in / home / {username}, root has been placed in the home directory dedicated / root.

    / Run - the state of the application directory

      / Run directory used to store temporary files exist in the application is necessary during operation, such as socket and pid files that are important to run these applications, it can not put them in the / tmp directory because the / tmp files in the directory system is likely to be cleared.

    / Sbin - binary system administrators with directory

      / Sbin and directory / bin directory is somewhat similar, are stored in binary files. Special is / are system administration commands stored procedures sbin directory, usually only the root user can use.

    / Srv - data directory service

      / Srv directory mainly used to store data network services, some provided by the system, if you run a HTTP server on the machine to provide the external static files, / srv / http directory to store these static files, if you run a FTP server External provide documentation, the / srv / ftp directory to store these files.

    / Tmp - temporary files directory

      Applications will be some temporary files are stored in the / tmp directory, in general, when the system is restarted, the files in / tmp is automatically cleared, will be cleared of some monitoring procedures.

    / Usr - user binary files read-only file and directory

      / Usr directory is stored under the procedures used by the user, can be clearly found that, Linux will be kept separate from ordinary users and programs used by the system, such as the above mentioned, the system uses a number of important programs stored in / bin, and those who do not important program was placed in / usr / bin. Less critical systems management program stored in the / usr / sbin instead of / sbin. usr is also known as UNIX Software Resource, which is relatively early to say. The following are common meaning several subdirectories of / usr directory:
  • / Usr / bin to store user commands
  • / Usr / include stored programming language header files and include files
  • / Usr / lib to store each application libraries and object files
  • / Usr / local storage system administrator to download the software installation directory
  • / Usr / sbin store less frequently used system commands
  • / Usr / src storage source

    / Var - variable data directory

      / Var generally used to store frequently variable data, such as log files and file cache. The following are common meaning several subdirectories under the / var directory:
  • Temporary files / var / cache to store applications running generated
  • / Var / lib stored procedures in the implementation process need to use the data file in this directory each software has its own directory
  • / Var / lock state of the program stored lock
  • / Var / log storing various log files
  • / Var / mail store personal e-mail
  • / Var / run some programs running, they'll be the pid, socket file into this directory

    The directory structure naming conventions

  • Up to 255 bytes of the file name, the file name including the path including the 4095 byte maximum;
  • In addition to slash and NUL, all the characters are valid, but the use of special characters in directory names and file is not recommended, some characters need to use quotation marks to refer to them;
  • Standard Linux file system (such as ext4), file names are case-sensitive.
  • File type classification

File name color file type
blue table of Contents
green executable file
red Compressed file
Light Blue Link file
gray Other files

Guess you like

Origin www.cnblogs.com/bridge430/p/11610254.html