Summary and centos installation docker

centos not start the fstab
你可能由于对磁盘管理,修改了/etc/fstab文件,进行自动挂载,但是卸载磁盘后,忘记修改/etc/fstab文件,导致了如下启动linux错误,开启进入紧急模式
error getting authority error initializing authority could not connect no such file or directory

How to solve?

注释或删除/etc/fstab中定义的自动挂载配置,以及无用的挂载配置,然后重启系统
systemctl reboot
即可正常重启linux



How centos7 add boot entry? > / Div?

centos7 open the way to provide service to start:


1. System Services management command, if it is installed via yum software, startup script has been automatically created, directly execute the following command


nginx.service suffix may be omitted


systemctl enable nginx.service # nginx here refers to a good pre-configured boot script file


systemctl start nginx.service # services start nginx, nginx also execute a script file



2. Because the / usr / lib / systemd / system / directory is located startup files, which are generally xx.service format


We use systemctl enable nginx.service is in fact calling /usr/lib/systemd/system/nginx.service



3. Default nginx.service script file as follows


[Unit]
Description=The nginx HTTP and reverse proxy server
After=network.target remote-fs.target nss-lookup.target


[Service]
Type=forking
PIDFile=/run/nginx.pid
# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
# SELinux context. This might happen when running nginx -t from the cmdline.
# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
ExecStartPre=/usr/bin/rm -f /run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=process
PrivateTmp=true


[Install]
WantedBy=multi-user.target


 


 


Specific systemctl command usage, see
http://man.linuxde.net/systemctl



4. summary


Copy the code

1 If you are compiling software installation, for example, redis, no default redis.service 
2 . To enter / usr / lib / systemd / system / directory, and then create redis.service ordinary file, Touch redis.service
3 . Then write following the path may need to be modified, modification according to their installation path
[Unit]
the Description
= the Redis persistent key- value Database
the After
= network.target
the After
= Network- online.target
Wants
= Network- online.target

[Service]
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd
ExecStop
=/usr/libexec/redis-shutdown
Type
=notify
User
=redis
Group
=redis
RuntimeDirectory
=redis
RuntimeDirectoryMode
=0755

[Install]
WantedBy=multi-user.target


Copy the code

 


 


4. Then the command, add a boot entry
systemctl enable redis.service
systemctl Start redis.service


 







centos7 installation docker


1, see the linux distributions, the kernel


Copy the code

[root @ Docker ~] # CAT / etc / RedHat Release #-view the version number 

CentOS Linux Release
7.1.1503 (Core)

[root @ Docker ~] # uname -r # to view the Linux kernel

c3.
10.0-229.el7.x86_64


Copy the code

2, replacing Ali cloud yum source



1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7 .repo # Download Ali yum source 2

2 yum repository cache generated makecache #



3, installation docker



yum install docker -y


4, start docker



Start docker systemctl # start docker
systemctl enable docker # boot docker
systemctl Status docker # View docker state


5. Check docker version



Version Docker 

# yum filled with 1.12.6


6, DaoCloud accelerator  is popular Docker tool to solve the problem of domestic users access Docker Hub slow. DaoCloud accelerator combined with the CDN service level optimization and protocol, exponentially enhance the download speed.


Before using make sure your Docker version 1.8 or later, otherwise it will not accelerate.


http://guide.daocloud.io/dcs/daocloud-9153151.html tutorial official website


Copy the code

/etc/docker/daemon.json CAT # modify the contents of this document are as follows 

{
" Registry-Mirrors " : [
" http://95822026.m.daocloud.io "
],
" in the insecure-Registries " : []
}
- -------------------------------------------------- -----
or use this command # after the restart Docker systemctl restart Docker
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://95822026.m.daocloud.io



Copy the code

7, for example, we want to install a nginx, first searched examine what public image, and then start the installation start ..



Search nginx Docker # to find the first one, most downloaded, the official mirror 
docker pull nginx # nginx download mirror
docker images # to see which image


8, mirroring start nginx



RUN -p 8000 Docker: 80 --name mynginx -d nginx 
# -p specify the server port 8000, the port 80 web mapping container, container named mynginx -d startup daemon mode (because the container must have processes running, otherwise it ends hanging)
Docker PS # to view the current working container
docker ps -a # View all run-off container


9, then you can use the server ip address, access the browser, the default port 80 do not write, you can access the welcome nginx


10, the container system can be used to enter the exec command



Docker Exec Expediting IT container ID / bin / bash


 


Linux's RPM GPG signature

Original Address: http: //linux.chinaunix.net/techdoc/system/2007/09/26/968723.shtml

GPG applications on Linux package is to achieve the official release of the signature mechanism.
GPG is divided into public and private keys.
Public: their name means, you can share the key, the private key is used to validate the encrypted data and signature data to be sent to the private party.
Private: local retained by the key, the signature for local data and verification data with the public key of the signature.
               
The principle (with Red Hat Signed as an example):
1> RH when publishing its official RPM packages (such as local CD and RHEL FTP space package), will provide a GPG key file, the so-called public key.
2> the user to download and install the RPM package, RH official introduction of the RPM GPG public key to verify RH RPM package is not official signature.
Import GPG-KEY:
go https://www.redhat.com/security/team/key/ or / etc / pki / rpm-gpg GPG key to find the appropriate, and introduced into the RPM:
RPM --import / etc / pki / rpm-gpg / RPM -GPG-KEY
signatures and encryption concepts:
signature and encryption is not a concept.
Signature similar to the check code used to identify the package is not being modified, the most common is our GPG signature and MD5, the original parties to use a certain character (MD5) or password (GPG private key) and the corresponding software and calculation to obtain a fixed-length key.
Encryption is to modify the original data with a certain key, even if the program was intercepted in transit, as long as it does not unlock the password, you can not modify the program, unless destroyed documents, so we know the software is modified.
RPM verification methods:
1> Verify the entire package files installed
rpm -V crontabs-1.10-8
2> verify the individual files in the package
rpm -Vf / etc / crontab
If the file has not been modified, any information is not output.
3> Verify that the entire package was modified
RPM -Vp AdobeReader_chs-7.0.9-1.i386.rpm
....... T /usr/local/Adobe/Acrobat7.0/Reader/GlobalPrefs/reader_prefs
S. .... T /usr/local/Adobe/Acrobat7.0/bin/acroread. 5
. 4> verify the signature
RPM AdobeReader_chs -K-7.0.9-1.i386.rpm
AdobeReader_chs-7.0.9-1.i386.rpm: sha1 md5 OK
authentication result meaning:
S: File Size differs
M: Mode differs (Includes Permissions and File type)
. 5: the MD5 SUM differs
D: Device Major / Minor Number MIS-match
L: readLink (2) path MIS-match
the U-: Ownership differs the User
G: Ownership differs Group
T: mtime differs

Linux server to view the public network ip methods

When troubleshooting network problems, we need to see export public IP information of the client, the following two methods:

curl ifconfig.me

Linux commands input to the system, can view the information of the public network is connected to the machine;

If the command is invalid, a command can use the following, it is possible to obtain information corresponding to

curl cip.cc

你可能由于对磁盘管理,修改了/etc/fstab文件,进行自动挂载,但是卸载磁盘后,忘记修改/etc/fstab文件,导致了如下启动linux错误,开启进入紧急模式
error getting authority error initializing authority could not connect no such file or directory

How to solve?

注释或删除/etc/fstab中定义的自动挂载配置,以及无用的挂载配置,然后重启系统
systemctl reboot
即可正常重启linux

centos7 open the way to provide service to start:


1. System Services management command, if it is installed via yum software, startup script has been automatically created, directly execute the following command


nginx.service suffix may be omitted


systemctl enable nginx.service # nginx here refers to a good pre-configured boot script file


systemctl start nginx.service # services start nginx, nginx also execute a script file



2. Because the / usr / lib / systemd / system / directory is located startup files, which are generally xx.service format


We use systemctl enable nginx.service is in fact calling /usr/lib/systemd/system/nginx.service



3. Default nginx.service script file as follows


[Unit]
Description=The nginx HTTP and reverse proxy server
After=network.target remote-fs.target nss-lookup.target


[Service]
Type=forking
PIDFile=/run/nginx.pid
# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
# SELinux context. This might happen when running nginx -t from the cmdline.
# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
ExecStartPre=/usr/bin/rm -f /run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t
ExecStart=/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=process
PrivateTmp=true


[Install]
WantedBy=multi-user.target


 


 


Specific systemctl command usage, see
http://man.linuxde.net/systemctl



4. summary


Copy the code

1 If you are compiling software installation, for example, redis, no default redis.service 
2 . To enter / usr / lib / systemd / system / directory, and then create redis.service ordinary file, Touch redis.service
3 . Then write following the path may need to be modified, modification according to their installation path
[Unit]
the Description
= the Redis persistent key- value Database
the After
= network.target
the After
= Network- online.target
Wants
= Network- online.target

[Service]
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd
ExecStop
=/usr/libexec/redis-shutdown
Type
=notify
User
=redis
Group
=redis
RuntimeDirectory
=redis
RuntimeDirectoryMode
=0755

[Install]
WantedBy=multi-user.target


Copy the code

 


 


4. Then the command, add a boot entry
systemctl enable redis.service
systemctl Start redis.service


 



1, see the linux distributions, the kernel


Copy the code

[root @ Docker ~] # CAT / etc / RedHat Release #-view the version number 

CentOS Linux Release
7.1.1503 (Core)

[root @ Docker ~] # uname -r # to view the Linux kernel

c3.
10.0-229.el7.x86_64


Copy the code

2, replacing Ali cloud yum source



1 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7 .repo # Download Ali yum source 2

2 yum repository cache generated makecache #



3, installation docker



yum install docker -y


4, start docker



Start docker systemctl # start docker
systemctl enable docker # boot docker
systemctl Status docker # View docker state


5. Check docker version



Version Docker 

# yum filled with 1.12.6


6, DaoCloud accelerator  is popular Docker tool to solve the problem of domestic users access Docker Hub slow. DaoCloud accelerator combined with the CDN service level optimization and protocol, exponentially enhance the download speed.


Before using make sure your Docker version 1.8 or later, otherwise it will not accelerate.


http://guide.daocloud.io/dcs/daocloud-9153151.html tutorial official website


Copy the code

/etc/docker/daemon.json CAT # modify the contents of this document are as follows 

{
" Registry-Mirrors " : [
" http://95822026.m.daocloud.io "
],
" in the insecure-Registries " : []
}
- -------------------------------------------------- -----
or use this command # after the restart Docker systemctl restart Docker
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://95822026.m.daocloud.io



Copy the code

7, for example, we want to install a nginx, first searched examine what public image, and then start the installation start ..



Search nginx Docker # to find the first one, most downloaded, the official mirror 
docker pull nginx # nginx download mirror
docker images # to see which image


8, mirroring start nginx



RUN -p 8000 Docker: 80 --name mynginx -d nginx 
# -p specify the server port 8000, the port 80 web mapping container, container named mynginx -d startup daemon mode (because the container must have processes running, otherwise it ends hanging)
Docker PS # to view the current working container
docker ps -a # View all run-off container


9, then you can use the server ip address, access the browser, the default port 80 do not write, you can access the welcome nginx


10, the container system can be used to enter the exec command



Docker Exec Expediting IT container ID / bin / bash


 


Original Address: http: //linux.chinaunix.net/techdoc/system/2007/09/26/968723.shtml

GPG applications on Linux package is to achieve the official release of the signature mechanism.
GPG is divided into public and private keys.
Public: their name means, you can share the key, the private key is used to validate the encrypted data and signature data to be sent to the private party.
Private: local retained by the key, the signature for local data and verification data with the public key of the signature.
               
The principle (with Red Hat Signed as an example):
1> RH when publishing its official RPM packages (such as local CD and RHEL FTP space package), will provide a GPG key file, the so-called public key.
2> the user to download and install the RPM package, RH official introduction of the RPM GPG public key to verify RH RPM package is not official signature.
Import GPG-KEY:
go https://www.redhat.com/security/team/key/ or / etc / pki / rpm-gpg GPG key to find the appropriate, and introduced into the RPM:
RPM --import / etc / pki / rpm-gpg / RPM -GPG-KEY
signatures and encryption concepts:
signature and encryption is not a concept.
Signature similar to the check code used to identify the package is not being modified, the most common is our GPG signature and MD5, the original parties to use a certain character (MD5) or password (GPG private key) and the corresponding software and calculation to obtain a fixed-length key.
Encryption is to modify the original data with a certain key, even if the program was intercepted in transit, as long as it does not unlock the password, you can not modify the program, unless destroyed documents, so we know the software is modified.
RPM verification methods:
1> Verify the entire package files installed
rpm -V crontabs-1.10-8
2> verify the individual files in the package
rpm -Vf / etc / crontab
If the file has not been modified, any information is not output.
3> Verify that the entire package was modified
RPM -Vp AdobeReader_chs-7.0.9-1.i386.rpm
....... T /usr/local/Adobe/Acrobat7.0/Reader/GlobalPrefs/reader_prefs
S. .... T /usr/local/Adobe/Acrobat7.0/bin/acroread. 5
. 4> verify the signature
RPM AdobeReader_chs -K-7.0.9-1.i386.rpm
AdobeReader_chs-7.0.9-1.i386.rpm: sha1 md5 OK
authentication result meaning:
S: File Size differs
M: Mode differs (Includes Permissions and File type)
. 5: the MD5 SUM differs
D: Device Major / Minor Number MIS-match
L: readLink (2) path MIS-match
the U-: Ownership differs the User
G: Ownership differs Group
T: mtime differs

When troubleshooting network problems, we need to see export public IP information of the client, the following two methods:

curl ifconfig.me

Linux commands input to the system, can view the information of the public network is connected to the machine;

If the command is invalid, a command can use the following, it is possible to obtain information corresponding to

curl cip.cc

Guess you like

Origin www.cnblogs.com/abdm-989/p/12166964.html