Tag Archives: The server

Error: ENOSPC: no space left on device [How to Solve]

In case of the above error, generally speaking, the server cannot create the file. At this time, we can find the problem from two directions

1. The disk is full of blocks or inodes

1. The disk block is full. Check the command df -h

[root@S100900 ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda3        35G   28G  5.6G  83% /
tmpfs           504M     0  504M   0% /dev/shm
/dev/vda1       194M   47M  138M  26% /boot
/dev/vdb1       325G  118G  192G  38% /home/wwwroot/vdb1data

2. Disk inode is full. Check the command df -i

[root@S1000900 ~]# df -i
Filesystem       Inodes    IUsed   IFree IUse% Mounted on
/dev/vda3       2289280  1628394  660886   72% /
tmpfs            128827        1  128826    1% /dev/shm
/dev/vda1         51200       44   51156    1% /boot
/dev/vdb1      21626880 21626880       0  100% /home/wwwroot/vdb1data

We found after comparison that the disk block occupied 38%, but the inode occupied 100%, it can be imagined that the disk fragmentation of small files are particularly large, we can go to the corresponding disk under the deletion of useless small files to solve the problem; we have to keep the following two ideas, of course, to solve the fundamental problem also need to buy mount more disks to solve;

Idea one: inode is full: delete useless small files as much as possible to release enough inode

Idea two: block full: delete as many useless large files as possible to free up enough blocks

 

2. Error: ENOSPC: no space left on device, watch

node project reactnative Error: Error: ENOSPC: no space left on device, watch

[root@iz2zeihk6kfcls5kwmqzj1z JFReactNativeProject]# npm start
 
> [email protected] start /app/jenkins_workspace/workspace/JFReactNativeProject
> react-native start
 
┌──────────────────────────────────────────────────────────────────────────────┐
│                                                                              │
│  Running Metro Bundler on port 8081.                                         │
│                                                                              │
│  Keep Metro running while developing on any JS projects. Feel free to        │
│  close this tab and run your own Metro instance if you prefer.               │
│                                                                              │
│  https://github.com/facebook/react-native                                    │
│                                                                              │
└──────────────────────────────────────────────────────────────────────────────┘
 
Looking for JS files in
   /app/jenkins_workspace/workspace/JFReactNativeProject
 
Loading dependency graph...fs.js:1413
    throw error;
    ^
 
Error: ENOSPC: no space left on device, watch '/app/jenkins_workspace/workspace/JFReactNativeProject/node_modules/.staging/react-native-ddd311e5/ReactAndroid/src/androidTest/java/com/facebook/react/testing/idledetection'
    at FSWatcher.start (fs.js:1407:26)
    at Object.fs.watch (fs.js:1444:11)
    at NodeWatcher.watchdir (/app/jenkins_workspace/workspace/JFReactNativeProject/node_modules/[email protected]@sane/src/node_watcher.js:159:22)
    at Walker.<anonymous> (/app/jenkins_workspace/workspace/JFReactNativeProject/node_modules/[email protected]@sane/src/common.js:109:31)
    at Walker.emit (events.js:182:13)
    at /app/jenkins_workspace/workspace/JFReactNativeProject/node_modules/[email protected]@walker/lib/walker.js:69:16
    at go$readdir$cb (/app/jenkins_workspace/workspace/JFReactNativeProject/node_modules/[email protected]@graceful-fs/graceful-fs.js:187:14)
    at FSReqWrap.oncomplete (fs.js:169:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `react-native start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
 
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-09-25T06_57_58_754Z-debug.log

Solution:

Enospc means error no more hard disk space available

First, use df -hTto find that there is still a lot of disk space

Then find FSWatcher and Object.fs.watch field, and then view the contents related to the number of files that the system allows users to listen to

#Indicates the number of watches that can be added by the same user at the same time (watches are generally directory-specific and determine the number of directories that can be monitored by the same user at the same time)
[root@iz2zeihk6kfcls5kwmqzj1z JFReactNativeProject]# cat /proc/sys/fs/inotify/max_user_watches
8192
[root@iz2zeihk6kfcls5kwmqzj1z JFReactNativeProject]# echo 100000 > /proc/sys/fs/inotify/max_user_watches
[root@iz2zeihk6kfcls5kwmqzj1z JFReactNativeProject]# cat /proc/sys/fs/inotify/max_user_watches
100000

The permanent effective method is as follows: (this method is recommended)

vim /etc/sysctl.conf
fs.inotify.max_user_watches = 100000(The latter value can be adjusted according to the actual situation)
Just add and run /sbin/sysctl -p 

Start validation:

Restart, normal

[Solved] FTP Setup Error: Job for vsftpd.service failed because the control process exited with error code…

Error in setting up FTP: job for vsftpd service failed because the control process exited with error code. See “systemctl status vsftpd.service” and “journalctl -xe” for details.


Solution:

First check whether our port 21 is occupied:

[root@VM-12-16-centos lighthouse]# lsof -i:21
COMMAND     PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
pure-ftpd 16235 root    4u  IPv4 1014289      0t0  TCP *:ftp (LISTEN)
pure-ftpd 16235 root    5u  IPv6 1014290      0t0  TCP *:ftp (LISTEN) 

We need to kill the process pure-ftpd with process number 16235:

[root@VM-12-16-centos lighthouse]# kill -9 16235 
[root@VM-12-16-centos lighthouse]# lsof -i:21

If there is no prompt, it means that kill is successful!

The next step is to solve the vsftpd configuration file:

[root@VM-12-16-centos lighthouse]# sudo vim /etc/vsftpd/vsftpd.conf

The content of vsftpd configuration file is, which can be copied directly. Just change the IP:

# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP?(Beware - allowed by default if you comment this out).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/xferlog
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode. The vsftpd.conf(5) man page explains
# the behaviour when these options are disabled.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
chroot_local_user=YES
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=YES
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
# Make sure, that one of the listen options is commented !!
#listen_ipv6=YES

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
local_root=/var/ftp/test
allow_writeable_chroot=YES
pasv_enable=YES
pasv_address=xxx.xxx.xxx.xxx#Please change it to the public IP of your lightweight application server, you need to change it yourself
pasv_min_port=40000
pasv_max_port=45000

Finally, take a look at your vsftp on state:

[root@VM-12-16-centos lighthouse]# systemctl status vsftpd.service

[Solved] Red hat 7.9 install DM8 of Damon database and starting graphical error with xmanager enterprise 5

Red hat 7.9 install DM8 of Damon database and starting graphical error with xmanager enterprise 5

Error Messages:

[dmdba@dmdb01 dmsetup]$ ./DMInstall.bin 
Extract install files......... 
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: 
    no swt-pi-gtk-3659 in java.library.path
    no swt-pi-gtk in java.library.path
    /tmp/swtlib-64/libswt-pi-gtk-3659.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
    Can't load library: /tmp/swtlib-64/libswt-pi-gtk.so
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:267)
    at org.eclipse.swt.internal.Library.loadLibrary(Library.java:174)
    at org.eclipse.swt.internal.gtk.OS.<clinit>(OS.java:22)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
    at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
    at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132)
    at org.eclipse.swt.widgets.Widget.isValidSubclass(Widget.java:988)
    at org.eclipse.swt.widgets.Decorations.checkSubclass(Decorations.java:164)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:258)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:253)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:204)
    at org.eclipse.swt.widgets.Shell.<init>(Shell.java:140)
    at com.dameng.common.gui.util.SWTUtility.canInitGUI(SWTUtility.java:380)
    at com.dameng.install.ui.MainApplication.run(MainApplication.java:80)
    at com.dameng.install.ui.MainApplication.main(MainApplication.java:436)
[dmdba@dmdb01 dmsetup]$

 

Solution:
This kind of error is graphics related with the missing rpm package error message, use find command to find the relevant rpm package also does not exist, you need to install additional.
Make sure the local yum source is properly configured or the network is kept open, enter the following command.
yum install gtk2 libXtst xorg-x11-fonts-Type1
[root@dmdb01 yum.repos.d]# yum install gtk2 libXtst xorg-x11-fonts-Type1
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Package libXtst-1.2.3-1.el7.x86_64 already installed and latest version
Resolving Dependencies
–> Running transaction check
—> Package gtk2.x86_64 0:2.24.31-1.el7 will be installed
—> Package xorg-x11-fonts-Type1.noarch 0:7.5-9.el7 will be installed
–> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
–> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
–> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
–> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.5-9.el7.noarch
–> Running transaction check
—> Package ttmkfdir.x86_64 0:3.0.9-42.el7 will be installed
—> Package xorg-x11-font-utils.x86_64 1:7.5-21.el7 will be installed
–> Processing Dependency: libfontenc.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.5-21.el7.x86_64
–> Running transaction check
—> Package libfontenc.x86_64 0:1.1.3-3.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
==========================================================================================================================================
Package                                 Arch                      Version                           Repository                      Size
==========================================================================================================================================
Installing:
gtk2                                    x86_64                    2.24.31-1.el7                     rhel-source                    3.4 M
xorg-x11-fonts-Type1                    noarch                    7.5-9.el7                         rhel-source                    521 k
Installing for dependencies:
libfontenc                              x86_64                    1.1.3-3.el7                       rhel-source                     31 k
ttmkfdir                                x86_64                    3.0.9-42.el7                      rhel-source                     48 k
xorg-x11-font-utils                     x86_64                    1:7.5-21.el7                      rhel-source                    104 k
Transaction Summary
==========================================================================================================================================
Install  2 Packages (+3 Dependent packages)
Total download size: 4.1 M
Installed size: 14 M
Is this ok [y/d/N]: y
Downloading packages:
——————————————————————————————————————————————
Total                                                                                                     120 MB/s | 4.1 MB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : ttmkfdir-3.0.9-42.el7.x86_64                                                                                           1/5
Installing : libfontenc-1.1.3-3.el7.x86_64                                                                                          2/5
Installing : 1:xorg-x11-font-utils-7.5-21.el7.x86_64                                                                                3/5
Installing : xorg-x11-fonts-Type1-7.5-9.el7.noarch                                                                                  4/5
Installing : gtk2-2.24.31-1.el7.x86_64                                                                                              5/5
Verifying  : xorg-x11-fonts-Type1-7.5-9.el7.noarch                                                                                  1/5
Verifying  : libfontenc-1.1.3-3.el7.x86_64                                                                                          2/5
Verifying  : 1:xorg-x11-font-utils-7.5-21.el7.x86_64                                                                                3/5
Verifying  : gtk2-2.24.31-1.el7.x86_64                                                                                              4/5
Verifying  : ttmkfdir-3.0.9-42.el7.x86_64                                                                                           5/5
Installed:
gtk2.x86_64 0:2.24.31-1.el7                                   xorg-x11-fonts-Type1.noarch 0:7.5-9.el7
Dependency Installed:
libfontenc.x86_64 0:1.1.3-3.el7            ttmkfdir.x86_64 0:3.0.9-42.el7            xorg-x11-font-utils.x86_64 1:7.5-21.el7
Complete!
[root@dmdb01 yum.repos.d]#
Start the installer again and it will display the graphical representation properly.

[Solved] shell Error: Syntax error: “(“ unexpected (expecting “}“)

The hard disk is damaged and the system is reinstalled. An error is reported when executing the previous script

Syntax error: “(” unexpected (expecting “}”)

Troubleshooting:

ls -l /bin/sh

The default link is dash

Knowledge supplement

Bash: Unix shell written for GNU Project

SH: equivalent to /bin/bash –posix. It is bash that opens POSIX standard

Dash: it has faster execution speed than bash, but supports fewer statement leaves

Solution:

Here, I have no requirements for the speed of script execution, only that it can be used, so I can change it to bash

cd /bin/; ln -sf bash /bin/sh

l

Problem-solving.

How to Solve Hbase JAVA import Package Error

Elsipe connects to Hbase
When programming with the hbase API, importing many packages may cause errors
Since it is too tedious to add dependencies manually, we finally chose to create a new maven project, which makes it possible to add the dependencies we need automatically.

Create a new maven project
I’m using the latest version of eclipse 2021-12, so I skipped this step.

Create a new project





Modify pom.xml
In the new maven project, find the pom.xml and modify it

Add the following, and make sure that the version is consistent with your own hbase version.
Check your own hbase version with “hbase version” command

<dependency>
    	<groupId>org.apache.hbase</groupId>
    	<artifactId>hbase-client</artifactId>
    	<version>2.4.10</version>
</dependency>

Wait for automatic compilation to complete

The imported packages will not report errors

[Solved] github Error: ERROR: You‘re using an RSA key with SHA-1

github Error: ERROR: You're using an RSA key with SHA-1,RSA can not used and need to upgrade:

ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

Solution:

# Generate a new secret key, if you report an error unknown key type ed25519, use this: ssh-keygen -t ecdsa -b 521 -C "[email protected]", all the way back to the car (the first carriage return is the name of the generated secret key, do not give the default, the last two are the password, you can do without)
$ ssh-keygen -t ed25519 -C "[email protected]"

# start ssh proxy, use different commands depending on the environment
$ eval "$(ssh-agent -s)"

# Add the secret key to the agent, and if there are other previous secret keys, add them too
$ ssh-add id_ecdsa

# View the secret key and copy and paste it to GitHub
$ cat ~/.ssh/id_ecdsa

# Test, it's best to pull a project to see if it can be accessed
$ ssh -T [email protected]

log

(pytorch) [yudong@admin1 Temp]$ git pull
ERROR: You are using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
# 生成秘钥
(pytorch) [yudong@admin1 .ssh]$ ssh-keygen -t ecdsa -b 521 -C "[email protected]"
Generating public/private ecdsa key pair.
Enter file in which to save the key (/public/home/yudong/.ssh/id_ecdsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /public/home/yudong/.ssh/id_ecdsa.
Your public key has been saved in /public/home/yudong/.ssh/id_ecdsa.pub.
The key fingerprint is:
7a:3b:30:d8:b5:a3:5d:c7:85:8b:82:b6:75:2a:d8:fc [email protected]
The key's randomart image is:
+--[ECDSA  521]---+
|                 |
|                 |
|             .   |
|        .   . .  |
|     o oS. o o   |
|    . *.= + +    |
|     =.B.* .     |
|    . *.+.       |
|       oE.       |
+-----------------+
(pytorch) [yudong@admin1 .ssh]$ ls
authorized_keys  config  id_ecdsa  id_ecdsa.pub  id_rsa  id_rsa.pub  known_hosts
# start shh proxy
(pytorch) [yudong@admin1 .ssh]$ eval "$(ssh-agent -s)"
Agent pid 210477
# add proxy
(pytorch) [yudong@admin1 .ssh]$ ssh-add id_ecdsa
Identity added: id_ecdsa (id_ecdsa)
(pytorch) [yudong@admin1 .ssh]$ ssh-add id_rsa
Identity added: id_rsa (id_rsa)
# check the public key
(pytorch) [yudong@admin1 .ssh]$ cat id_ecdsa.pub 
ecdsa-sha2-nistp521 AAAAE2VjZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXkfa6XXXqOS62um3j8ZOXVdabpGwCRCVBLlxMNfmNPRNG2FEl3rkxpw2O91MAINv+JiXPU56sA== [email protected]
# test
(pytorch) [yudong@admin1 .ssh]$ ssh -T [email protected]
Hi ydduong! You have successfully authenticated, but GitHub does not provide shell access.
(pytorch) [yudong@admin1 .ssh]$ cd ../Temp/
# test
(pytorch) [yudong@admin1 Temp]$ git pull
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 3), reused 6 (delta 3), pack-reused 0
Unpacking objects: 100% (6/6), done.
From github.com:ydduong/Temp
   5e7379d..aec2a53  main       -> origin/main
Updating 5e7379d..aec2a53
Fast-forward
 Snipaste_2022-03-25_23-26-58.png | Bin 0 -> 238594 bytes
 plt.py                           |  65 +++++++++++++++++++++++++++++++++++++++++++++++++----------------
 2 files changed, 49 insertions(+), 16 deletions(-)
 create mode 100644 Snipaste_2022-03-25_23-26-58.png
(pytorch) [yudong@admin1 Temp]$ 

yum: Error: Failed to download metadata for repo ‘aliyun-AppStream‘: Cannot download repomd.xml

preface

centos8 stopped the service of source on December 31, 2021

The current system is CentOS

[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 8.5.2111
[root@localhost ~]# 

Yum error message

[root@localhost ~]# yum install ipmitool
CentOS-8 - AppStream                                                                                                                                                                   439  B/s | 2.3 kB     00:05    
Errors during downloading metadata for repository 'aliyun-AppStream':
  - Status code: 404 for https://mirrors.aliyun.com/centos-Vault/8.5.2111/BaseOS/x86_64/os/repodata/repomd.xml (IP: 182.105.147.113)
Error: Failed to download metadata for repo 'aliyun-AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@localhost ~]# 

Solution

1. Execute the following commands

[root@localhost ~]#cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# ls -lh        
total 24K
-rwxr-xr-x. 1 root root  288 Mar 22 20:07 CentOS-AppStream.repo
-rwxr-xr-x. 1 root root  276 Mar 22 20:07 CentOS-BaseOS.repo
-rwxr-xr-x. 1 root root 3.0K Mar 22 20:07 CentOS-Base.repo
-rwxr-xr-x. 1 root root  279 Mar 22 20:07 CentOS-Extras.repo
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
[root@localhost yum.repos.d]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# yum update -y
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
CentOS-8 - AppStream                                                                                                                                                             437  B/s | 2.3 kB     00:05    
Errors during downloading metadata for repository 'aliyun-AppStream':
  - Status code: 404 for https://mirrors.aliyun.com/centos-Vault/8.5.2111/BaseOS/x86_64/os/repodata/repomd.xml (IP: 124.225.134.244)
Error: Failed to download metadata for repo 'aliyun-AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

2. If the problem is not solved, do the following:

[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
--2022-03-22 20:08:42--  https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 124.225.134.241, 124.225.134.239, 124.225.134.243, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|124.225.134.241|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2495 (2.4K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

/etc/yum.repos.d/CentOS-Base.repo                    100%[===================================================================================================================>]   2.44K  --.-KB/s    in 0s      

2022-03-22 20:08:47 (49.0 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2495/2495]

[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# yum clean all
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
18 files removed
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# yum makecache
Repository base is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository PowerTools is listed more than once in the configuration
Repository AppStream is listed more than once in the configuration
CentOS-8 - AppStream                                                                                                                                                             428  B/s | 2.3 kB     00:05    
Errors during downloading metadata for repository 'aliyun-AppStream':
  - Status code: 404 for https://mirrors.aliyun.com/centos-Vault/8.5.2111/BaseOS/x86_64/os/repodata/repomd.xml (IP: 119.41.210.242)
Error: Failed to download metadata for repo 'aliyun-AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@localhost yum.repos.d]# 

3. Then perform the following operations

[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# ls -lh        
total 24K
-rwxr-xr-x. 1 root root  288 Mar 22 20:07 CentOS-AppStream.repo
-rwxr-xr-x. 1 root root  276 Mar 22 20:07 CentOS-BaseOS.repo
-rwxr-xr-x. 1 root root 3.0K Mar 22 20:07 CentOS-Base.repo
-rwxr-xr-x. 1 root root  279 Mar 22 20:07 CentOS-Extras.repo
[root@localhost yum.repos.d]# 
[root@localhost yum.repos.d]# mkdir bak
[root@localhost yum.repos.d]# mv  *.repo  bak
[root@localhost yum.repos.d]# ls
bak
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
--2022-03-22 20:10:10--  https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
Resolving mirrors.aliyun.com (mirrors.aliyun.com)... 124.225.134.239, 124.225.134.241, 124.225.134.243, ...
Connecting to mirrors.aliyun.com (mirrors.aliyun.com)|124.225.134.239|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2495 (2.4K) [application/octet-stream]
Saving to: ‘/etc/yum.repos.d/CentOS-Base.repo’

/etc/yum.repos.d/CentOS-Base.repo   100%[==================================================================>]   2.44K  --.-KB/s    in 0s      

2022-03-22 20:10:15 (98.3 MB/s) - ‘/etc/yum.repos.d/CentOS-Base.repo’ saved [2495/2495]

[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum clean all
0 files removed
[root@localhost yum.repos.d]# yum makecache
CentOS-8.5.2111 - Base - mirrors.aliyun.com                                                                                     454 kB/s | 4.6 MB     00:10    
CentOS-8.5.2111 - Extras - mirrors.aliyun.com                                                                                                                                    1.0 kB/s |  10 kB     00:10    
CentOS-8.5.2111 - AppStream - mirrors.aliyun.com                                                                                                                                 571 kB/s | 8.4 MB     00:15    
Metadata cache created.
[root@localhost yum.repos.d]# ls 
bak  CentOS-Base.repo
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# yum install ipmitool
Last metadata expiration check: 0:00:27 ago on Tue 22 Mar 2022 08:10:54 PM CST.
Dependencies resolved.
=================================================================================================================================================================================================================
 Package                                          Architecture                                   Version                                                 Repository                                         Size
=================================================================================================================================================================================================================
Installing:
 ipmitool                                         x86_64                                         1.8.18-18.el8                                           AppStream                                         395 k

Transaction Summary
=================================================================================================================================================================================================================
Install  1 Package

Total download size: 395 k
Installed size: 1.1 M
Is this ok [y/N]: y
Downloading Packages:
ipmitool-1.8.18-18.el8.x86_64.rpm                                                                                                                                                 71 kB/s | 395 kB     00:05    
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                             71 kB/s | 395 kB     00:05     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                         1/1 
  Installing       : ipmitool-1.8.18-18.el8.x86_64                                                                                                                                                           1/1 
  Running scriptlet: ipmitool-1.8.18-18.el8.x86_64                                                                                                                                                           1/1 
  Verifying        : ipmitool-1.8.18-18.el8.x86_64                                                                                                                                                           1/1 

Installed:
  ipmitool-1.8.18-18.el8.x86_64                                                                                                                                                                                  

Complete!
[root@localhost yum.repos.d]#

At this point, you can use the yum install command.

SSH Connect Service Error: Could not connect to ‘xxx.xxx.xx.xx‘ (port 22): Connection failed.

It was strange to report an error when connecting to SSH service this morning

I have searched a lot of information from Baidu. Now I collect and sort out some useful solutions for you

1. Restart CentOS
2 Restart VMware
3 Firewall problem:
solution:
(1) check the firewall: Service iptables status
(2) close the firewall first: /etc/init.d/iptables stop
(3) open firewall: Service iptables start
Start: systemctl start firewalld (centos7 user)
Close: systemctl stop firewalld (centos7 user)
4 Query whether port 22 is enabled

Query all open port commands

  firewall-cmd --zone=public --list-ports

Permanently open port 22

  firewall-cmd --zone=public --add-port=80/tcp --permanent 

Reload

firewall-cmd --reload

5. Query whether SSH is installed on the Linux server

yum install openssh-server

6. Query whether SELinux is started
modify the file in /etc/selinux/config and set SELINUX = disabled:

[Solved] ERROR OGG-01232 Receive TCP params error: TCP/IP error 104 (Connection reset by peer), endpoint:

Solution 1:
due to the inconsistency between the ports of the source end and the destination end,
the error message of the source end is error ogg-01232 receive TCP params error: TCP/IP error 104 (connection reset by peer), endpoint: 10.238.83.44:7847

Edit the process and view the configured ports

edit params 42P3  42P3 is the port number

The information configured in the discovery process is rmthost 10.238.83.44 mgrport 7839, compress

It is inconsistent with the port reporting an error. Modify the port Edit params 42p3 to prompt port 7847. Then restart the process start 42p3

Solution 2:
after modifying the port or starting the process, it indicates that the previous port is normal (the port of the destination end is the same as that of the source end)

Just delete the line of port and write it again Edit params 42p3 , and restart start 42p3 after writing

Solution 3:
roll forward the source side delivery process to a file and generate a new file point

alter extract 42P3, etrollover

[Solved] Yum Install Software Error: Invalid configuration value: failovermethod=priority…

Error 1:

Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-BaseOS.repo; Configuration: OptionBinding with id "failovermethod" does not exist
CentOS Linux 8 - AppStream                                                 6.3 kB/s | 2.3 kB     00:00    
Errors during downloading metadata for repository 'appstream':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

The current environment is:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# uname -srm
Linux 4.18.0-348.2.1.el8_5.x86_64 x86_64

CentOS version:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# cat /etc/redhat-release
CentOS Linux release 8.5.2111

Solution:

1. Find CentOS related directory, backup CentOS-AppStream, CentOS-Base files, generally CentOS directory is under /etc/yum.repos.d folder, as follows:

Backup:

cp CentOS-Linux-AppStream.repo CentOS-Linux-AppStream.repo1
cp CentOS-Linux-BaseOS.repo CentOS-Linux-BaseOS.repo1

2. Edit the files CentOS-Linux-AppStream.repo,CentOS-Linux-BaseOS.repo for string replacement:

vi CentOS-Linux-BaseOS.repo
# esc 键盘 : 命令模式下执行:
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g 
# 继续执行:
%s/$releasever/$releasever-stream/g

vi CentOS-Linux-AppStream.repo
# esc 键盘 : 命令模式下执行:
%s/mirrors.cloud.aliyuncs.com/mirrors.aliyun.com/g 
# 继续执行:
%s/$releasever/$releasever-stream/g

3. Execute the order:

yum makecache
yum update

Command execution effect:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# yum update
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Last metadata expiration check: 0:01:22 ago on Wed 09 Mar 2022 10:20:01 AM CST.
Error: 
 Problem: package centos-stream-release-8.6-1.el8.noarch requires centos-stream-repos, but none of the providers can be installed
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-2.el8.noarch
  - package centos-stream-repos-8-2.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-3.el8.noarch
  - package centos-stream-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - package centos-linux-repos-8-3.el8.noarch conflicts with centos-repos(8) provided by centos-stream-repos-8-4.el8.noarch
  - package centos-stream-repos-8-4.el8.noarch conflicts with centos-repos(8) provided by centos-linux-repos-8-3.el8.noarch
  - cannot install the best update candidate for package centos-linux-release-8.5-1.2111.el8.noarch
  - problem with installed package centos-linux-repos-8-3.el8.noarch
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

Execute the command Yum install * expect * again, and the results are as follows:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# yum install *expect*
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Last metadata expiration check: 0:07:00 ago on Wed 09 Mar 2022 10:20:01 AM CST.
Package python3-pexpect-4.3.1-3.el8.noarch is already installed.
Dependencies resolved.
===========================================================================================================
 Package                       Architecture         Version                     Repository            Size
===========================================================================================================
Installing:
 expect                        x86_64               5.45.4-5.el8                baseos               267 k
 python3-aexpect               noarch               1.6.2-1.el8                 epel                  93 k
Installing dependencies:
 tcl                           x86_64               1:8.6.8-2.el8               baseos               1.1 M

Transaction Summary
===========================================================================================================
Install  3 Packages

Total download size: 1.5 M
Installed size: 5.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): python3-aexpect-1.6.2-1.el8.noarch.rpm                              467 kB/s |  93 kB     00:00    
(2/3): expect-5.45.4-5.el8.x86_64.rpm                                      282 kB/s | 267 kB     00:00    
(3/3): tcl-8.6.8-2.el8.x86_64.rpm                                          351 kB/s | 1.1 MB     00:03    
-----------------------------------------------------------------------------------------------------------
Total                                                                      461 kB/s | 1.5 MB     00:03     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                   1/1 
  Installing       : tcl-1:8.6.8-2.el8.x86_64                                                          1/3 
  Running scriptlet: tcl-1:8.6.8-2.el8.x86_64                                                          1/3 
  Installing       : expect-5.45.4-5.el8.x86_64                                                        2/3 
  Installing       : python3-aexpect-1.6.2-1.el8.noarch                                                3/3 
  Running scriptlet: python3-aexpect-1.6.2-1.el8.noarch                                                3/3 
  Verifying        : expect-5.45.4-5.el8.x86_64                                                        1/3 
  Verifying        : tcl-1:8.6.8-2.el8.x86_64                                                          2/3 
  Verifying        : python3-aexpect-1.6.2-1.el8.noarch                                                3/3 

Installed:
  expect-5.45.4-5.el8.x86_64       python3-aexpect-1.6.2-1.el8.noarch       tcl-1:8.6.8-2.el8.x86_64      

Complete!

OK, you can install yum

Note: in actual use, if there is no CentOS-AppStream.repo related files, do not operate on them

Eg: install git:

[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# yum -y install git
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Last metadata expiration check: 0:07:51 ago on Wed 09 Mar 2022 10:20:01 AM CST.
Dependencies resolved.
===========================================================================================================
 Package                      Architecture       Version                       Repository             Size
===========================================================================================================
Installing:
 git                          x86_64             2.31.1-2.el8                  appstream             161 k
Installing dependencies:
 git-core                     x86_64             2.31.1-2.el8                  appstream             4.7 M
 git-core-doc                 noarch             2.31.1-2.el8                  appstream             2.6 M
 perl-Error                   noarch             1:0.17025-2.el8               appstream              46 k
 perl-Git                     noarch             2.31.1-2.el8                  appstream              78 k
 perl-TermReadKey             x86_64             2.37-7.el8                    appstream              40 k

Transaction Summary
===========================================================================================================
Install  6 Packages

Total download size: 7.7 M
Installed size: 38 M
Downloading Packages:
(1/6): git-2.31.1-2.el8.x86_64.rpm                                         299 kB/s | 161 kB     00:00    
(2/6): perl-Error-0.17025-2.el8.noarch.rpm                                 185 kB/s |  46 kB     00:00    
(3/6): perl-Git-2.31.1-2.el8.noarch.rpm                                    290 kB/s |  78 kB     00:00    
(4/6): perl-TermReadKey-2.37-7.el8.x86_64.rpm                              148 kB/s |  40 kB     00:00    
(5/6): git-core-doc-2.31.1-2.el8.noarch.rpm                                385 kB/s | 2.6 MB     00:07    
(6/6): git-core-2.31.1-2.el8.x86_64.rpm                                    394 kB/s | 4.7 MB     00:12    
-----------------------------------------------------------------------------------------------------------
Total                                                                      640 kB/s | 7.7 MB     00:12     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                   1/1 
  Installing       : git-core-2.31.1-2.el8.x86_64                                                      1/6 
  Installing       : git-core-doc-2.31.1-2.el8.noarch                                                  2/6 
  Installing       : perl-TermReadKey-2.37-7.el8.x86_64                                                3/6 
  Installing       : perl-Error-1:0.17025-2.el8.noarch                                                 4/6 
  Installing       : perl-Git-2.31.1-2.el8.noarch                                                      5/6 
  Installing       : git-2.31.1-2.el8.x86_64                                                           6/6 
  Running scriptlet: git-2.31.1-2.el8.x86_64                                                           6/6 
  Verifying        : git-2.31.1-2.el8.x86_64                                                           1/6 
  Verifying        : git-core-2.31.1-2.el8.x86_64                                                      2/6 
  Verifying        : git-core-doc-2.31.1-2.el8.noarch                                                  3/6 
  Verifying        : perl-Error-1:0.17025-2.el8.noarch                                                 4/6 
  Verifying        : perl-Git-2.31.1-2.el8.noarch                                                      5/6 
  Verifying        : perl-TermReadKey-2.37-7.el8.x86_64                                                6/6 

Installed:
  git-2.31.1-2.el8.x86_64             git-core-2.31.1-2.el8.x86_64   git-core-doc-2.31.1-2.el8.noarch    
  perl-Error-1:0.17025-2.el8.noarch   perl-Git-2.31.1-2.el8.noarch   perl-TermReadKey-2.37-7.el8.x86_64  

Complete!
[root@iZ2vc5xk901ftf2vfscwc1Z yum.repos.d]# git --version
git version 2.31.1

Error 2:

Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-Linux-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Repository extras is listed more than once in the configuration
CentOS Linux 8 - AppStream                                                 6.7 kB/s | 2.3 kB     00:00    
Errors during downloading metadata for repository 'appstream':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/AppStream/x86_64/os/repodata/repomd.xml (IP: xxx.xxx.xxx.xxx)
Error: Failed to download metadata for repo 'appstream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Solution

Enter the file /etc/yum.repos.d/CentOS-Epel.repo, and comment out  failovermethod=priority :

OK, you can also install yum