Tag Archives: Centos

Install Xen virtual machine using virt-manager

directory
Install Xen Virtual Machine with Virt-Manager Install Xen Virtualization Install Virt-Manager check libvirtd service status Create Xen Virtual machine view issues encountered with virtual machine status

Install the Xen virtual machine using virt-Manager
This article focuses on how to install the Xen virtual machine on CentOS 7 using Virt-Manager. The following environments need to be prepared:
CentOS 7Xen virtualization Virt-managerVMware Workstation 12
Note: The desktop version of CentOS7 is installed on the same host as Xen virtualization and Virt-Manager for this environment


Install Xen virtualization
See my post on Installing Xen virtualization under CentOS 7 for details
Install the virt – manager
Use the following command to install

yum install -y virt-manager

Check the status of the libvirtd service
Use the following command to see that the service starts properly

systemctl status libvirtd


Create the Xen virtual machine
Open the virt-Manager interface

virt-manager


To connect to Xen virtualization, click File-> Add Connection, select Xen, where Hostname fill in Xen virtualization server IP
create virtual machine, right click Xen:localhost-> New opens the create page and selects the installation method specified.
input Network Install Network Install installation address
select the virtual machine memory and CPU configuration, the image installed in this paper is centos6.5-minnal version
select the virtual machine disk size
confirm the installation information (including the selection of Network configuration, whether to customize the configuration information), Check the first red box in the figure below if there is a custom requirement. click Finish to enter the installation interface. Installation steps are not described in this article, but you can find the installation tutorial by yourself
View virtual machine status

can be viewed through the virt-manager to enter the virtual machine command line by entering the following command

virsh


You can use help to view relevant commands. For example, enter the following command to see the virtual list and its status

list --all


Problems encountered
In the process of creating virtual machines using Virt-Manager, the following problems are encountered, and the solutions are attached for your reference.
:'internal error:process exited while connecting to monitor:qemu:could not load PC BIOS 'bs-256k.bin ' Unable to complete install:’internal error:process exited while connecting to monitor:qemu:could not load PC BIOS’ bs-256k.bin ‘ Just create a BIOS -256k.bin file under seabios directory

cp /usr/share/seabios/bios.bin /usr/share/seabios/bios-256k.bin

incapable to complete install:'interbal error:libxenlight failed to create new domain 'centos6.5' 1. There is a centos6.5 virtual machine in the current virtual machine list. Rename the currently created virtual machine or delete the existing virtual machine to
2. Use the command yum update qemu-img to update the file
3. Determine if the memory and CPU of the virtual machine being created is greater than the memory and CPU of the host, and ensure that the virtual machine’s resources are smaller than those of the host

Tencent Cloud server encountered “Active: failed (Result: start-limit)” error when starting lightdm

I installed the GUI on Tencent Cloud server and failed to start LightDM:
[root @vm_0_11_centos GDM]# systemctl start lightdm
[root @vm_0_11_centos GDM]# systemctl status lightdm
● lightdm.service-light Display Manager
Loaded: loaded (/usr/lib/systemd/system/lightdm.service; enabled; Vendor presets: enabled)
Active: failed (Result: start-limit) since Sat 2020-04-04 12:02:18 CST; 6s ago
Docs: man:lightdm(1)
Process: 8495 ExecStart=/usr/sbin/lightdm (code=exited, status=1/FAILURE)
Main PID: 8495 (code=exited, status=1/FAILURE)
Apr 04 12:02:17 VM_0_11_centos systemd[1]: Unit lightdm.service entered failed state.
Apr 04 12:02:17 VM_0_11_centos systemd[1]: Triggering OnFailure= dependencies of lightdm.service.
Apr 04 12:02:17 VM_0_11_centos systemd[1]: lightdm.service failed.
Apr 04 12:02:18 VM_0_11_centos systemd[1]: lightdm.service holdoff time over, scheduling restart.
Apr 04 12:02:18 VM_0_11_centos systemd[1]: Stopped Light Display Manager.
Apr 04 12:02:18 VM_0_11_centos systemd[1]: start request repeated too quickly for lightdm.service
Apr 04 12:02:18 VM_0_11_centos systemd[1]: Failed to start Light Display Manager.
Apr 04 12:02:18 VM_0_11_centos systemd[1]: Unit lightdm.service entered failed state.
Apr 04 12:02:18 VM_0_11_centos systemd[1]: Triggering OnFailure= dependencies of lightdm.service.
Apr 04 12:02:18 VM_0_11_centos systemd[1]: lightdm.service failed.
Solution:
because the libdrm version is too low, so just update.
[root @vm_0_11_centos ~]# yum update libdrm
[root @vm_0_11_centos ~]# systemctl start lightdm
[root @vm_0_11_centos ~]# systemctl status lightdm
● lightdm.service-light Display Manager
the Loaded: the Loaded (/ usr/lib/systemd/system/lightdm. Service; enabled; Vendor presets: enabled)
Active: Active (running) since Sat 2020-04-04 22:21:33 CST; 6s ago

My cloud server instance type is a standard SA1, CENTOS 7.5-64-bit system.

Samba shared server cannot be accessed and the path cannot be found

The Path cannot be found because the Samba Shared server is inaccessible
First blog post: P
Windows access can only go to the root directory, opening the Shared subdirectory indicates that the path could not be found, spelling error may occur, and the server appears “make_connection_SNum: canonicalize_connect_Path Fail…”
As an amateur, recently tried to built a Shared server, using the virtual machine to do the test before, run successfully, permissions can be implemented, the day before yesterday with a spare industrial control server, reinstall the Samba server, configuration files, and access configuration is copied, is unable to access, the same Windows, access to the original virtual machine SMB, completely normal, and access to the physical machine SMB, input \ IP address, a successful connection, input user name and password, is normal to list the Shared directory, but want to get into Shared subdirectory, have been tip don’t have access to:

recognized the wrong path, the Shared configuration is: share name: [security] and path /… /AQ, which identifies the Shared name as a path.
looks at the server and prompts “make_connection_snum: canonicalize_connect_path fails for service security, path/MNT /jx1_share/AQ”, the same is true for logging.

CentOS Liunx 7 uses rdesktop to remotely connect to the Alibaba Cloud server and it appears Failed to connect, CredSSP required by server.

CredSSP Required by Server fails to connect when Liunx connects to Window server.
1. Connect to the server remotely on the web side. 2. Right click on my computer -> Property – & gt; Remote setting -& GT; 3. Uncheck computer connections that allow running remote desktops using network sector authentication only (recommended)(N)

The exact reason is not clear, but this operation successfully connected to the Aliyun server. Note: the image of ali cloud Server system is: Windows Server 2012 D2 Datacenter


Write in the last
I am a pure white, and the blog I write is also written because of the problems encountered in learning to use to find information and then solve the problem. If there are some mistakes, or involving infringement, please contact me.
QQ: 994961015
E-mail: [email protected]
WeChat: this can not be given.

Centos8 solves SSH secure shell error algorithmic negotiation failures

the new server version has arrived at CentOS8 today, but SSH Secure Shell is still 3.2.9 years ago, so I encountered an error in the title when connecting to the server. This question is a tragic waste of my time.

there are many, many posts on the web that address this problem, and they all go like this:

Sshd_config
sudo vim /etc/ssh/sshd_config

2. at the end of the file add the following information
Ciphers either aes128 – CBC, aes192 – CBC, aes256 – CBC, either aes128 – CTR, aes192 – CTR, aes256 – CTR, 3 des – CBC, arcfour128, arcfour256, arcfour, blowfish – CBC, cast128 – CBC
MACs Hmac – md5, hmac – sha1, [email protected], hmac – ripemd160 digest, hmac – sha1-96, hmac – md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-g roup1-sha1,[email protected]

3. after saving SSH service
sudo /etc/init.d/ SSH restart

everyone said it was good, but after I tried it, it was tragic. After I added the configuration, I could not restart SSH and it would report an error.

these two articles explain the real reason and offer a solution:

https://blog.csdn.net/pgmzyy/article/details/88586101

https://blog.csdn.net/Vertoria/article/details/82226340

, however, I still failed to solve the problem, and finally decided to abandon the outdated SSH Secure Shell Client and replace it with FileZilla to solve the problem: FileZilla also supports SSH protocol to transfer files, and its operation is slightly more humane than SSH Secure Shell Client

Failed to restart ssh.service: Unit not found.

1,

after modifying the sshd_config configuration file

vim /etc/ssh/sshd_config

2. Restart SSH

service ssh restart

3, the following error

Redirecting to /bin/systemctl restart ssh.service
Failed to restart ssh.service: Unit not found.

4, reason: the above command is centos6 inside the command, centos7 need to use

systemctl restart sshd

5, the problem is perfectly solved, nice

How to solve the failed to start switch root error during centos8.1 startup?

boot today found CentOS8.1 system can not boot!! I recall that I updated some system packages yesterday. At that time, the updated system was not restarted, and the updated system was not detected. It was an oversight!

take a closer look at the log and it turns out that the Switch Root is wrong, as shown below:

prompt error log generation, a simple look, want to get the U disk first, then follow up.

is inserted into the U disk, no device is detected, exit is performed, and sda is identified after repeated twice. As shown below:

then U disk mounted to/sysroot, prompt data to test with U disk,, FSCK detection, the log file/run/initramfs/rdsosreport. TXT is copied to the U disk, and then uninstall U disk. As shown below:

try manually mounting CentOS8 system disk to /sysroot and find the partition mount corresponding to CentOS8. As shown below:

then exit and the system starts normally! Fortunately, it’s not a big problem.

come in the system, think under the analysis of the cause, to fundamentally solve it…

open the log file rdsosreport.txt in the U disk, find the error fragment log analysis:

[   79.300190] xxx systemd[1]: Reached target Switch Root.[   79.300600] xxx systemd[1]: Starting Switch Root...[   79.304948] xxx systemctl[2113]: Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.[   79.305456] xxx systemd[1]: initrd-switch-root.service: Main process exited, code=exited, status=1/FAILURE[   79.305593] xxx systemd[1]: initrd-switch-root.service: Failed with result 'exit-code'.[   79.305789] xxx systemd[1]: Failed to start Switch Root.[   79.305811] xxx systemd[1]: initrd-switch-root.service: Triggering OnFailure= dependencies.[   79.306342] xxx systemd[1]: Starting Setup Virtual Console...[   79.364641] xxx systemd[1]: Started Setup Virtual Console.[   79.365205] xxx systemd[1]: Started Emergency Shell.[   79.365348] xxx systemd[1]: Reached target Emergency Mode.[   79.380910] xxx systemd[1]: Received SIGRTMIN+21 from PID 1675 (plymouthd).

see the key record:

 Failed to switch root: Specified switch root path '/sysroot' does not seem to be an OS tree. os-release file is missing.

because the root path was not mounted successfully, /sysroot had no content, and the os-release file was not found.

, can you imagine if the os-release file for the system is gone?Open the /etc/cenos-release file and find the content, that’s not the problem with this file!

[root@server ~]# cat /etc/os-release NAME="CentOS Linux"VERSION="8 (Core)"ID="centos"ID_LIKE="rhel fedora"VERSION_ID="8"PLATFORM_ID="platform:el8"PRETTY_NAME="CentOS Linux 8 (Core)"ANSI_COLOR="0;31"CPE_NAME="cpe:/o:centos:centos:8"HOME_URL="https://www.centos.org/"BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"CENTOS_MANTISBT_PROJECT_VERSION="8"REDHAT_SUPPORT_PRODUCT="centos"REDHAT_SUPPORT_PRODUCT_VERSION="8"

continue to search, efi directory to see centos related files are there any questions?The size of the GRUbenv file is zero. Is that the problem?!

[root@server ~]# ls -al /boot/efi/EFI/centos/total 5364drwx------. 3 root root    4096 Feb 21 23:01 .drwx------. 6 root root    4096 May 11  2019 ..-rwx------. 1 root root     134 Jun  7  2019 BOOTX64.CSVdrwx------. 2 root root    4096 Feb  5 09:46 fonts-rwx------. 1 root root    9570 Feb 13 22:08 grub.cfg-rwx------. 1 root root       0 Feb 21 23:01 grubenv-rwx------. 1 root root 1876872 Feb  5 09:46 grubx64.efi-rwx------. 1 root root 1160136 Jun  7  2019 mmx64.efi-rwx------. 1 root root 1205152 Jun  7  2019 shimx64-centos.efi-rwx------. 1 root root 1211224 Jun  7  2019 shimx64.efi

then edits the grubenv file and adds the following.

# GRUB Environment Blocksaved_entry=16611cc1c45441e1a5aa9fa702a005ff-4.18.0-147.5.1.el8_1.x86_64kernelopts=root=UUID=5d5f3d63-4aed-45f1-85a9-e875c29c114a ro resume=UUID=ddeaf98e-c239-46be-95c3-d36156c1b0f6 rhgb quietboot_success=0boot_indeterminate=0################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################

main parameter description (do not write wrong! :

saved_entry:是默认的引导项kernelopts:root填写/分区的UUID,resume填写swap分区的UUID

restart, normal start, no more error. Problem solved!

============

Note: if you do not know how to edit this file, you can regenerate grub by executing the following:

[root@server EFI]# grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg Generating grub configuration file ...Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efiAdding boot menu entry for EFI firmware configurationdone

generates grubenv as follows, there will be some incomplete parameters oh.

# GRUB Environment Blockkernelopts=root=UUID=5d5f3d63-4aed-45f1-85a9-e875c29c114a ro resume=UUID=ddeaf98e-c239-46be-95c3-d36156c1b0f6 rhgb quiet################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################

summary:

  1. to calmly analyze problems, to learn to analyze and solve problems, this ability is very important.

  2. systematically study, master the knowledge of a field is very necessary. The idea and process of solving the problem depends on your understanding of the system!

note: this article is original and shall not be reproduced on any platform without permission. For reprint, contact the author ~

The title

Kafka connection abnormal org.apache.kafka . common.errors.TimeoutException : Failed to update metadata after 60000 ms.

Introduction: there are many problems about hosts on the Internet. After testing, I found out that it is not. After testing by myself, I introduced three solutions to most problems:

1. Firewall port not opened or closed

firewall generally local test will be closed, the line is generally open, it is recommended to add port

add port:

# --permanent 为永久添加,不指定此参数重启后失效
firewall-cmd --zone=public --add-port=9092/tcp --permanent

delete port:

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

view all ports:

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

view specified port:

firewall-cmd --zone= public --query-port=9092/tcp

view port status:

netstat -tunlp

overload:

firewall-cmd --reload

firewall command:

#开启防火墙 
service firewalld start
#启用防火墙 
service firewalld enable (永久生效)
#关闭防火墙 
service firewalld stop (重启后失效)
#禁用防火墙 
service firewalld disable (永久生效)
#重启防火墙 
service firewalld restart
#查看状态 
service firewalld status

2. Kafka service entry address not specified

edit the server.properties in the config directory of kafka, and add the address of the service entry to the external service:

注意:此ip为kafka所在主机的ip地址
listeners=PLAINTEXT://192.168.5.228:9092

3. The kafka version in the project is inconsistent with the kafka version installed on the server

modify maven pom. XML file, specify the corresponding kafka coordinates,
I installed kafka_2.12-2.1.0, the corresponding coordinates are:

<dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka_2.11</artifactId>
      <version>0.10.0.0</version>
</dependency>

NACOS error com.alibaba.nacos.api.exception.NacosException: failed to req API:/api//nacos/v1/ns/instance

service registry to nacos error: com. Alibaba. Nacos. API. Exception. NacosException: failed to the req API:/API// nacos/v1/ns/instance after all the servers ([192.168.175.100:1111]) tried: java.net.ConnectException: Refuse a Connection (Connection union)

after looking for a long time without finding the reason, it turns out that as long as you modify spring.application.name, it can be restored to normal:

so that it can start normally, which is very strange.

sometimes stops the service, restarts it and can’t be registered, and then changes the service name again.

Linux_ day07_ 05_ Configure common add, delete, modify and query commands in network

configuration network commonly used add, delete, change search command

modify the IP address
  1. modify the configuration file

    /etc/sysconfig/network-scripts/ifcfg-ens33

  2. ifconfig command
    ifconfig ens33:0 192.168.235.127/24
    

  3. IP command
    ip addr add 192.168.235.127/24 dev ens33 label ens33:1
    

  4. nmcli command
    nmcli connection modify ens33 ipv4.address 192.168.80.100/24 # 修改ip地址
    nmcli connection modify ens33 ipv4.gateway 192.168.80.2/24 #修改网关
    nmcli connection modify ens33 ipv4.dns1 114.114.114.114 # 修改dns信息
    nmcli connection modify ens33 ipv4.method mannual # 指定网络信息获取方式为手动指定
    
open/disable network card
  1. ifconfig command
    ifconfig ens33 up
    ifconfig ens33 down
    

  2. ifup/ifdown command
    ifup ens33
    ifdown ens33
    

  3. IP command
    ip link set ens33 up
    ip link set ens33 down
    

  4. nmcli command
    nmcli device connect ens33
    nmcli device disconnect ens33
    
add routing
  1. modify the configuration file

    /etc/sysconfig/network-scripts/route-ens33

    The

    • way

      target via gw
      220.181.38.148 via 192.168.80.2

    • each three lines defines a route
      ADDRESS0=TARGET
      NETMASK0=MASK
      GATEWAY0=GW

      Blockquote>

  2. route command
    route add -net 192.168.235.0 netmask 255.255.255.0 gw 192.168.235.2 dev ens33
    

  3. IP command
    ip route add 192.168.80.0/24 via 192.168.80.2 dev ens33 # 添加网络路由
    ip route add 192.168.80.100 via 192.168.80.0 dev ens33 #添加主机路由
    ip route add default via 192.168.80.2 dev ens33 # 添加默认路由
    
modify routing
  1. modify the configuration file

    /etc/sysconfig/network-scripts/route-ens33

    The

    • way

      target via gw
      220.181.38.148 via 192.168.80.2

    • each three lines defines a route
      ADDRESS0=TARGET
      NETMASK0=MASK
      GATEWAY0=GW

      Blockquote>

  2. IP command
    ip route change # 如果路由本身不存在则报错显示不存在
    ip route replace # 如果路由本身不存在则会直接创建该路由信息
    
delete route
  1. delete the configuration file

    /etc/sysconfig/network-scripts/route-ens33

  2. the route command
    route del -net 192.168.235.0 netmask 255.255.255.0 gw 192.168.235.2 dev ens33
    

  3. IP command
    ip route del 192.168.80.0/24 via 192.168.80.2 dev ens33
    
view routing table
  1. the route command
    route -n
    

  2. netstat command
    netstat -r # 显示内核路由表
    netstat -n # 数字格式(不进行反向解析)