Tag Archives: centos7

Error message after installing docker in CentOS 7

Start docker

 

$ sudo systemctl start docker

report errors.

View status:

$ systemctl status docker.service -l

If you add – L, some lines of information are very long and will be omitted during printing. If you add this parameter, all lines will be displayed.

 

 

Error message:

Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel or disable selinux in docker (–selinux-enabled=false)

This means that SELinux in the Linux kernel does not support the overlay 2 graph driver. There are two solutions: either start a new kernel or disable SELinux in the docker, — SELinux enabled = false

 

Re edit the docker configuration file:

vi /etc/sysconfig/docker

 

Replace with:

 

Restart docker:

 

 

View status:

$ systemctl status docker.service -l

Done!!

Handling of various error reports of installing vmtools on CentOS 7

Basically, if an error occurs when installing vmtools, first record the error information

For example, what I met this time is

/TMP/modconfig-8md7iy/vmhgfs only/page. C: 1625:23: error: supplied to function ‘wait’_on_Too many arguments for bit ‘
task_UNINTERRUPTIBLE);

This error report is different due to specific circumstances, and the handling method is basically the same

First run uname – A to see the kernel version of CentOS

Linux localhost.localdomain 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

You can see that my current is 3.10.0

Then go to the installation directory of vmtools and find the vmhgfs.tar compressed package

Decompress

In the extracted vmhgfs only folder, find the corresponding error file. In this case, it is line 1625 of page. C

Change its previous judgment from 3,17,0 to its own kernel. Here is 3,10,0

Then run the installation again

 

When other error reporting information is different, you should see the error reporting content clearly. Some of the error reporting contents have prompt error reporting reasons, which should be handled according to the error reporting reasons

 

In vmware10, centos7 mounts the shared folder of windows host, and prompts: error: cannot mount filesystem: no such device

1. Set sharing permissions

Write picture description here

2. Install VMware tools

Write picture description here

  • Click on the virtual machine
  • Click to install VMware tools
  • Copy VMwareTools-9.6.2-1688356.tar.gz in the /run/media/zhaojq/VMware\ Tools directory to the home directory
  • Generate vmware-tools-distrib after decompression
  1. [zhaojq @localhost vmware-tools-distrib] $ ls
  2. bin doc etc FILES INSTALL installer lib vmware-install.pl

Run ./vmware-install.pl

[zhaojq@localhost vmware-tools-distrib]$ ./vmware-install.pl 

Keep enter

  1. The path “” is not valid path to the gcc binary.
  2. Would you like to change it? [yes] no
  3. Enter no
  4. At The path “” IS not A! Valid path to at The 3.10 .0 – 514.26 .2.el7.x86_64 Kernel
  5. headers.
  6. Would you like to change it? [yes] no
  7. Enter no

Return after successful installation

  1. Enjoy ,
  2. – – at The VMware Team

2. Mount the shared folder of the Windows host

mnt/hgfs directory

  1. [zhaojq @localhost ~] cd /mnt/hgfs/
  2. [zhaojq @localhost hgfs] pwd
  3. /mnt/hgfs

vmware-hgfsclient command to view the current shared directory

  1. [zhaojq @localhost hgfs] $ vmware-hgfsclient
  2. E

mount error

  1. [zhaojq @localhost hgfs] $ sudo mount -t vmhgfs. host:/ E /mnt/hgfs
  2. Error : cannot mount filesystem: No such device

 

vmhgfs-fuse, need to install toolkit

  1. [zhaojq @localhost hgfs] $ yum install open-vm-tools-devel -y
  2. [zhaojq @localhost hgfs] $ vmhgfs-fuse. host:/ E /mnt/hgfs

 

3. View the mount

Note: Root privileges are required to view.

Disk E of the Windows host

Write picture description here

Mount situation under Centos virtual machine

  1. [[email protected] hgfs] # ls
  2. jashkenas-coffeescript- 1.12 . 6- 0-gf0e9837 .tar .gz LeaRun agile background development framework_6 . 3 .4 $RECYCLE .BIN System Volume Information
  3. LeaRun_6 . 3 .4 .zip node-v6 . 11 .1-linux-x64 .tar .xz redis- 3.2 . 9 .tar .gz

 

Mounted successfully

Centos7 vmware Install Error: C header files matching your running kernel were not found.

C header files matching your running kernel were not found when installing VMware in centos7

02 OCT 2015 06:48:45jcxch number of readings: 3812

When installing VMware 11.0 in CentOS 7

1. Install gcc compiler first, because some files need to be compiled when installing VMware. If the system does not install GCC, you will be prompted to install GCC. Just use Yum install GCC

2. C header files matching your running kernel were not found. Refer to your distribution’s documentation for installation instruction. The general meaning is that there are no C header files and other files found in the current kernel. If there is such a problem that the development package of the corresponding kernel is not installed, you need to solve it by Yum install kernel devel or download the corresponding RPM package for installation

Centos7 Install MYSQL Error: Could NOT find Curses (missing CURSES_LIBRARY CURSES_INCLUDE_PATH)

Today, when installing mysql 5.7, I had the following problem when compiling.

[[email protected] software]# cd mysql-5.7.21

[[email protected] mysql-5.7.21]# cmake .

The following error message appears.

— Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:82 (MESSAGE):
Curses library not found. Please install appropriate package,

remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:126 (FIND_CURSES)
cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:250 (MYSQL_CHECK_READLINE)

— Configuring incomplete, errors occurred!

 

Solution:

[[email protected] mysql-5.7.21]# rm CMakeCache.txt

[[email protected] mysql-5.7.21]# yum install ncurses-devel

[[email protected] mysql-5.7.21]# yum install bison

[[email protected]]# make && make install

Done!

Centos7 Compile Error: ./configure: No such file or directory

Generally, look at the readme and install files in the directory, which will tell you how to install the software

Now I know that there may be two situations:

1. When there is no configure in the directory, but there is configure.am or configure.in, you need to use Autoconf command to generate configure. The code is as follows:

$CD (software name) – (version number)
$Autoconf

2. This software or library is not installed in the following way

$CD (software name) – (version number)
$./configure
$make
$sudomakeinstall

You need to carefully read the relevant files under the folder, readme, and so on, according to the way written inside to install

Install a docker container in centos7 that can log in SSH

Recently, I’ve been working on docker, which really excited me for a few days. Let’s share the installation process

Because docker requires a higher version of Linux kernel, I installed centos7 in VBox. As for how to install CentOS 7, I don’t need to worry about it. Here is the minimal installation

First, configure the network card to ensure that the virtual machine can access the network normally, because the installation of docker requires networking. I am usually used to setting up two network cards when installing virtual machine. One uses NAT to connect and is responsible for surfing the Internet; A host only connection is used to connect the host to the virtual machine. Then enable the two network cards, the simplest way is to enter dhclient mode, the system will automatically assign IP to the network card

First of all, the command to install docker:
is used

#yum-yinstalldocker

After the installation, you can use the following command to view the available images:

#dockerimages
REPOSITORYTAGIMAGEIDCREATEDVIRTUALSIZE

At this time, no image is available and the container cannot be started, so we need to download the image. In this step, we can choose to download images of different systems. Here, we still choose the most familiar CentOS. In this step, docker will download image files online

#dockerpullcentos

Wait until the image download is completed, and then use the docker images command to see several CentOS images:

#dockerimages
REPOSITORYTAGIMAGEIDCREATEDVIRTUALSIZE

 

First, build a docker container that can be accessed through SSH

1. Start a docker container:

#dockerrun-i-tcentos/bin/bash

This creates a new docker container and enters the bash of the container

2. Install sshd:

#yum-yinstallopenssh-server

3. Start sshd. Use absolute path here. To view the path of a command, use where is or which:

#/usr/sbin/sshd-D

The following error occurs when starting sshd under centos.

Could not load host key: /etc/ssh/ssh_host_rsa_key

Could not load host key: /etc/ssh/ssh_host_dsa_key

Simply execute the following commands in sequence.

ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key #just enter

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key #just enter

ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N “”

Press and start the sshd service again, it should be fine. 4.

4. After finishing, edit the sshd_config configuration file, find the paragraph UsePAM yes, change it to UsePAM no

#UsePAMno
UsePAMyes
to
UsePAMno
#UsePAMyes

If you don’t modify this paragraph, you will exit immediately when you log in to the container using SSH

5. Install passwd and change the password of root

#yum-yinstallpasswd
#passwroot
Changingpasswordforuserroot.
Newpassword:

6. After changing the password, execute the exit command to exit. At this time, you will return to the shell of the host machine and execute the following command to submit the container to the image:

#dockercommitcontaineridimagename

Here, containerid is the ID of the container, and imagename is the name of the image at the time of submission. It’s better to use a new name when submitting for the first time, instead of covering the original clean CentOS image

The container ID can be viewed through the docker PS – L command. After starting the container, the default host name is actually the container ID

7. Start a new container through docker run. The parameter – D means running in the background and – P means mapping the docker to the host port

#dockerrun-d-p10022:22imagename/usr/sbin/sshd-D

If there is no problem starting, you can log in to the container:

#[email protected]

After logging in, we can install all kinds of software and build all kinds of environments

After installing mysql, centos7 can’t start the service, and prompts unit not found

Phenomenon:

Start MySQL database prompt:

Failed to start mysqld.service: Unit not found

MySQL is no longer supported in centos7. Even if you have installed it, centos7 still says it’s disgusting

 

 

Solutions

Maria dB, an open source version of MySQL

(Maria DB is like the shadow version of MySQL. Maria DB is a branch version of MySQL, not a folk version. The functions provided by Maria dB are fully compatible with MySQL.)

1. Installation:

yum install -y mariadb-server

2.start maria DB serves:

systemctl start mariadb.service

(Note: since CentOS 7. X, CentOS has started to use SYSTEMd service instead of daemon, and the original commands related to the start-up and management of system services are all replaced by systemctl commands.)

3. Add to boot auto start:

systemctl enable mariadb.service

Initialize database configuration

mysql_secure_installation

The first step is to set the password. You will be prompted to enter the password first

Set password

Enter current password for root (enter for none):<– Direct return

Set root password?[ Y/n] <– Whether to set the root password, enter y and press enter or press enter directly
new password: & lt; — Set the password of the root user
re enter new password: & lt; — Enter the password you set again
for other configurations

Remove anonymous users?[ Y/n] <– Do you want to delete anonymous users?Y enter

Disallow root login remotely?[ Y/n] <– Do you want to disable root remote login?N enter

Remove test database and access to it?[ Y/n] <– Delete test database, y enter

Reload privilege tables now?[ Y/n] <– Do you want to reload the permission table?Y enter

Complete the initialization of MariaDB, and then test the local login

Location of configuration file: VIM/etc/my.cnf.d/mysql-clients.cnf

Turn on remote access

Log in to the database locally and execute the following command:

First of all, configure the users who are allowed to access, and give the users permission in the way of authorization

GRANTALLPRIVILEGESON*.*TO'root'@'%'IDENTIFIEDBY'123456'WITHGRANTOPTION;

Finally, after configuring the permissions, you should not forget to refresh them to make them take effect. Note: root is the user who logs in to the database, 123456 is the password for logging in to the database, * means that any host from any source has great permissions anyway

flushprivileges;

[Solved] Centos7 Install MYSQL Error: Failed to start mariadb.service: Unit not found.

Solution:

First, you need to install MariaDB server

yum install -y mariadb-server

Start the service

systemctlstartmariadb.service

Add to boot

systemctlenablemariadb.service

Make some security settings, and modify the database administrator password