Build a Linux high availability cluster (Day 1)

Source: Internet
Author: User

The first time you install software in Linux.

As a person who has never used Linux for a few days, it is also a harvest to learn how to install software on Linux. The general steps for installing a .tar.gz file are as follows (find the file, decompress, configure, compile, and install it): [yonghu @ localhost ~] # Su Root
[Root @ localhost ~] # Cd/home/New/desktop
[Root @ localhost desktop] # tar-xzvf fcitx-3.4.2.tar.gz
[Root @ localhost desktop] # cd/home/New/desktop/fcitx-3.4.2
[Root @ localhost fcitx-3.4.2] #./configure -- prefix =/opt/fictx
[Root @ localhost fcitx-3.4.2] # Make
[Root @ localhost fcitx-3.4.2] # make install

Detailed steps

[Yonghu @ localhost ~] # Su root // (use the root account to log on. Other users may not have sufficient permissions for subsequent operations)
Password: // enter the root password
[Root @ localhost ~] # Cd/home/New/desktop

// (Switch to the tar.gzfile directory, and my tar.gz file is on the desktop)

[Root @ localhost desktop] # tar-xzvf fcitx-3.4.2.tar.gz

// (Decompress the tar.gz file, here to fcitx-3.4.2 for example, extract the fcitx-3.4.2 folder)

[Root @ localhost desktop] # cd/home/New/desktop/fcitx-3.4.2

// (Switch directory to fcitx-3.4.2, software decompressed directory)

[Root @ localhost fcitx-3.4.2] #./configure -- prefix =/opt/fictx

// (Configure to store the file under/opt/fictx. When you delete the file, you only need to delete the file when you uninstall the software)

[Root @ localhost fcitx-3.4.2] # Make (Compilation)

[Root @ localhost fcitx-3.4.2] # make install (installation) for some software packages end with. SRC. rpm, which is an RPM package containing the source code and needs to be compiled during installation. 2. Linux ln command


Ln is a very important command in Linux. Its function is to create a synchronization link for a file in another location (what is the link? To put it bluntly, the so-called link is nothing more than linking the file name with the node number used by the computer file system .), The most common parameter of this command is-S. The specific usage is:

The target file-S of the Ln-S source file is symbolic.
Example: ln-S/lib/LSB/usr/LJ
That is, create an LJ file pointing to the/lib/LSB directory under the USR directory.

When we need to use the same file in different directories, we do not need to put a file that must be the same under each required directory. We only need to put it in a fixed directory, put the file, and then use the ln command link in other directories to link it, without occupying disk space repeatedly. For example, Ln-S/bin/less/usr/local/bin/less-s indicates the symbol (symbolic. There are two points to note: first, the ln command will keep the synchronization of each link file, that is, no matter which one you change, other files will change the same; second, there are two types of LN links: Soft link and hard link. The soft link is ln-s *****. It will only generate a file image at your selected location, it does not occupy disk space. The hard link ln *** has no parameter-S. It will generate a file of the same size as the source file at the selected position, both soft links and hard links are synchronized. Soft links can be cross-partition, but hard links can only be within the same partition. If you use ls to view a directory, you will find that some files are followed by a @ symbol, that is, a file generated using LN command, and you can use LS-l command to view it, we can see the link path displayed. When we need to use the same file in different directories, we do not need to put a file that must be the same in every required directory, we only need to put the file in a fixed directory, and then use the ln command link in other directories, without occupying disk space repeatedly. Example: ln-S/bin/less/usr/local/bin/less
Note:

First, the ln command will keep the synchronization of each link file. That is to say, other files will change the same no matter which one you have changed;

Second, there are two types of LN links: Soft link and hard link. The soft link is ln-s *****. It will only generate a file image at your selected location, it does not occupy disk space. The hard link ln *** has no parameter-S. It will generate a file of the same size as the source file at the selected position, both soft links and hard links are synchronized. Soft links can be cross-partition, but hard links can only be within the same partition.
Third, the directory cannot create a hard link, but you can create a soft link.

We also mentioned a node number. What is this?

The Linux File System uses an index node to record file information, which is similar to the file allocation table in windows. An index node is a structure that contains information such as the length of a file, creation and modification time, permission, ownership, and location on the disk. A file system maintains an array of index nodes. Each file or directory corresponds to the unique element in the index node array. The system assigns a number to each index node, that is, the index number of the node in the array, which is called the index node number.

The Linux File System saves the node number and file name of the file index in the directory at the same time. Therefore, the directory is only a table that combines the file name and its index node number. Each pair of file names in the Directory and the index node number are called a connection. A file has a unique index node number that corresponds to it. For an index node number, multiple file names can correspond to it. Therefore, the same file on the disk can be accessed through different paths.

After a whole day, I still failed to make the cluster. Alas, the power is going to be cut off. I will write it here for now. Continue tomorrow ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.