Tag Archives: Centos

Problems encountered after Maven installation or upgrade: could not find or load main class org.codehaus.plexus .class…..

After the M2_HOME environment variable is changed, mVN-V is executed on the terminal and the following error occurs:
 
Exception in thread “main” java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher
Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.classworlds.launcher.Launcher
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org. Codehaus. Breadth. Classworlds. The launcher. The launcher. The Program will exit.
 
 
If you are a Linux system, you may be in the/etc/profile, ~ /. Following/~/bashrc file configured in the environment variable M2_HOME, when M2_HOME value change, even if you execute the source/etc/profile operation, also can appear as wrong, then you will need to open a terminal or log back in to, if you are a Windows system, to open a CMD window, generally is ok, So the root cause of the appeal error is that mVN-V was executed on the same terminal when switching between two versions of Maven without opening a new terminal or logging in again.

SELinux solution to Apache SSL failure

The blogger today plans to configure a multi-certificate Apache so that multiple domain names can be accessed via https://***. According to the online tutorial, just add multiple < VirtualHost *:443> You can do that. But restarting HTTPD always prompts:

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

Journalctl-xe examines with the command:

systemd[1]: Unit httpd.service entered failed state.
systemd[1]: httpd.service failed.
polkitd[475]: Registered Authentication Agent for unix-process:7076:2357584 (system bus name :1.219 [/usr/bin/pkttyagent -.....

It’s hard to see what’s wrong (at this point the blogger doesn’t know that HTTPD has an error_log, face-covering)
After a long time, I finally opened /var/log/ HTTPD /error_log

AH02312: Fatal error initialising mod_ssl, exiting.
SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
Permission denied: AH02201: Init: Can't open server certificate file 

When the blogger saw this error message, he immediately understood that it was SELinux!! A lot of potholes on the SELinux before. So the first thing that comes to mind is that the SSL certificate file, the private key file, is not in the right context. Turning SELinux off directly would certainly solve the problem. But this is just a once-and-for-all approach that will cause more problems.
The solution
Three files are required to configure SSL:
2_domain.com.crt
3_domain.com.key
1_root_bundle.crt
Let’s say they’re all under /usr/local/apache/conf/

cd /usr/local/apache/conf/ 

Displays the current context of each file

ll -Z

Change context

chcon -u system_u -r object_r -t cert_t 1_root_bundle.crt
chcon -u system_u -r object_r -t cert_t 2_domain.com.crt
chcon -u system_u -r object_r -t cert_t 3_domain.com.key

The context configuration is not unique. If this setting doesn’t work, try something else.

Putty encountered an error when logging into alicloud CentOS: dis connected:No supported authentication methods available

The problem is caused by SSH links that do not allow remote password authentication
Enter the system through the administrative console, check whether the following configuration
PasswordAuthentication no
is included in the /etc/sshd_config file. Change this parameter to yes through the vim editor, as follows:
PasswordAuthentication yes
save, and then restart SSH service
service SSHD restart

In depth analysis of mysq exceeding the number of connections error 1040 (HY000): too many connections

ERROR 1040 (HY000): Too many connections indicates that mysql has more than one connection
The first solution (not recommended) :
Need to wait for a period of time (quite long), let the existing connection timeout automatically released; Or restart mysql (CentOS7: SystemCTL Restart Mysqld.Service)
The second option (use with caution) :
Login to mysql: mysql-uroot-p your root password
Look at the maximum number of connections mysql is currently setting. In general, the default number of connections to mysql is over 100, and the maximum number can be set to 16384 (2 ^ 14)
show variables like ‘%max_connections%’;
Set the maximum number of connections as needed, so I’m going to set 1000 here
set GLOBAL max_connections = 1000;

Note: This is used with caution because once the server or mysql service is restarted, the Settings will not take effect and the default Settings will be restored
 
The third option (the conditions allow the recommended use) :
Add or modify the max_connections parameter in the mysql configuration file
Linux (centos7) environment:
Windows environment:
Find my.ini in the installation directory. If you don’t have it, find My-default.ini, make a copy and rename it my.ini. Add or modify the max_connections parameter
After setting parameters, restart mysql service.
 
Resources:
FAQ for Installing Mysql5.7 and mysql under Linux(Centos7)

Vacuum box installation CentOS encountered the pit

Vagrant Box installation Centos encounter pit
The main thing is that there are some pits when installing Centos. Moreover, most of the online tutorials are not complete, so I am writing this blog to help some of the newcomers to the pit of Vagrant Box.
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox>
virtualBox> Virtualbox-6.0.18-136238-win
1. CMD below to initialize your virtual environment vagrant init your environment name, which I use when

D:\self\vagrant_workspace>vagrant init  centos7

2. Generally, this process is extremely slow and may not succeed, because it needs to go to the remote factory to download, you can use the University of Science and Technology of China mirror this is faster

D:\self\vagrant_workspace>vagrant init centos7 https://mirrors.ustc.edu.cn/centos-cloud/centos/7/vagrant/x86_64/images/CentOS-7.box

3. Don’t worry about the following errors that may occur in the first and second steps

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
again.

4. Use the following command to view the Vagrant installation list to see if the installation was successful

D:\self\vagrant_workspace>vagrant box list

5. Start the vagrant

D:\self\vagrant_workspace>vagrant up

The following error may occur

An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
Couldn't open file D:/self/vagrant_workspace/base

Box = “base”, default is “base”, you need to change the name of your own environment, here I will change it to “config.vm.box =” centos7 “
and then execute the command again

D:\self\vagrant_workspace>vagrant up

The presence of this indicates successful startup

default: SSH username: vagrant
default: SSH auth method: private key

Centos 7 | mariadb/mysql | [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11

The article directories
Error overview solution

Error in

2020-06-29  0:17:42 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:43 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:43 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:44 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:44 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:45 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:45 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:46 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:46 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:47 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:47 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:48 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:48 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:49 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-29  0:17:49 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-29  0:17:49 0 [Note] InnoDB: Unable to open the first data file
2020-06-29  0:17:49 0 [ERROR] InnoDB: Operating system error number 11 in a file operation.
2020-06-29  0:17:49 0 [ERROR] InnoDB: Error number 11 means 'Resource temporarily unavailable'
2020-06-29  0:17:49 0 [Note] InnoDB: Some operating system error numbers are described at https://mariadb.com/kb/en/library/operating-system-error-codes/
2020-06-29  0:17:49 0 [ERROR] InnoDB: Cannot open datafile './ibdata1'
2020-06-29  0:17:49 0 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2020-06-29  0:17:49 0 [ERROR] InnoDB: Plugin initialization aborted with error Cannot open a file
2020-06-29  0:17:49 0 [Note] InnoDB: Starting shutdown...
2020-06-29  0:17:50 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-06-29  0:17:50 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-06-29  0:17:50 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-06-29  0:17:50 0 [ERROR] Unknown/unsupported storage engine: InnoDB
2020-06-29  0:17:50 0 [ERROR] Aborting

The solution
Website query Error code 11
Operating System Error Codes – MariaDB Knowledge Base
https://mariadb.com/kb/en/operating-system-error-codes

Number Error Code Description
11 EAGAIN Try again

It’s no use trying again
An attempt was made to remove the deleted error file

cd /var/lib/mysql
ll

total 188492
-rw-rw---- 1 mysql mysql    16384 Jun 28 22:43 aria_log.00000001
-rw-rw---- 1 mysql mysql       52 Jun 28 22:43 aria_log_control
-rw-rw---- 1 mysql mysql     7007 Jun 28 22:43 ib_buffer_pool
-rw-rw---- 1 mysql mysql 79691776 Jun 28 22:49 ibdata1
-rw-rw---- 1 mysql mysql 50331648 Jun 28 23:18 ib_logfile0
-rw-rw---- 1 mysql mysql 50331648 Jun 22 09:17 ib_logfile1
-rw-rw---- 1 root  root  12582912 Jun 28 23:18 ibtmp1
-rw-rw---- 1 mysql mysql        0 Jun 22 09:28 multi-master.info
drwx------ 2 mysql mysql     4096 Jun 22 09:17 mysql
-rw-rw---- 1 mysql mysql      351 Jun 28 21:52 mysql-bin.000001
-rw-rw---- 1 mysql mysql      351 Jun 28 22:19 mysql-bin.000002
-rw-rw---- 1 mysql mysql      351 Jun 28 22:31 mysql-bin.000003
-rw-rw---- 1 mysql mysql      351 Jun 28 22:32 mysql-bin.000004
-rw-rw---- 1 mysql mysql      351 Jun 28 22:43 mysql-bin.000005
-rw-rw---- 1 mysql mysql       95 Jun 28 22:32 mysql-bin.index
-rw-rw---- 1 mysql mysql        0 Jun 28 22:43 mysql-bin.state
drwx------ 2 mysql mysql     4096 Jun 22 09:17 performance_schema

Remove or delete the following three files :(note the backup)

ibdata1、ib_logfile0、ib_logfile1

Restart the mariadb/mysql

WordPress appears Too many failed login attempts error solution

Use idle resources to earn pocket money (suitable for school students and housewives)
Solutions:
1. Log in to the database
mysql -uroot -p
Enter the password
2. Select your database instance (e.g., my instance name is Blog)
use blog;
3. Execute the following command (the table name depends on what the prefix is and find the table with the _options suffix).
Update TB_options Set option_value= ‘where option_name=’ WAS_LIMIT_login_lockouts’;

use the idle resources of computer to earn pocket money (suitable for students and housewives)
online generating external chain tools (international version)
online generating external chain tools (Chinese version)

Centos6 suddenly cannot access the network VM communication interface socket family: failed

Question:

VM communication interface socket family: failed
Determining IP information for eth0... failed; no link present. Check cable?

Solutions:

    open the terminal, administrator identity (su, then enter the password), run /usr/bin/vmware-config-tools.pl -d, close the image, close the virtual machine, and restart the computer.
    ps: copy a big guy’s picture, encounter similar problem.