首页 文章 精选 留言 我的

精选列表

搜索[Linux版本],共10000篇文章
优秀的个人博客,低调大师

vsphere虚拟机下的Linux在线移除硬盘后的报错处理(基于LVM)

1)故障描述( vmware虚拟机,在线移除一块被设置为pv格式的硬盘后,提示unknown device错误): 说明:/dev/sdb1 /dev/sdc1 /dev/sdd1是组成/dev/vg_test/lvm_test的PV,这里我们模拟/dev/sdd1硬盘被直接断电了 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 [root@dockermnt] #pvdisplay /dev/sdd : read failedafter0of4096at0:Input /output error /dev/sdd : read failedafter0of4096at21474770944:Input /output error /dev/sdd : read failedafter0of4096at21474828288:Input /output error /dev/sdd : read failedafter0of4096at4096:Input /output error /dev/sdd1 : read failedafter0of512at21467824128:Input /output error /dev/sdd1 : read failedafter0of512at21467938816:Input /output error /dev/sdd1 : read failedafter0of512at0:Input /output error /dev/sdd1 : read failedafter0of512at4096:Input /output error /dev/sdd1 : read failedafter0of2048at0:Input /output error Couldn't find devicewithuuid166hLZ-2POl-GIsv-ELGh-8YVT-Zcoa-ZcLXzp. ---Physicalvolume--- PVName /dev/sdb1 VGNamevg_test PVSize19.99GiB/notusable1.43MiB Allocatable yes (butfull) PESize4.00MiB TotalPE5118 FreePE0 AllocatedPE5118 PVUUIDfuQdIY-qkJw-fZJB-AauO-Zqpj-91RI-S1GG0X ---Physicalvolume--- PVName /dev/sdc1 VGNamevg_test PVSize19.99GiB/notusable1.43MiB Allocatable yes PESize4.00MiB TotalPE5118 FreePE5116 AllocatedPE2 PVUUIDTRlpMQ-snM6-u24f-cMHa-oiVt-XJ3w-6fjAbp ---Physicalvolume--- PVNameunknowndevice VGNamevg_test PVSize19.99GiB/notusable1.43MiB Allocatable yes PESize4.00MiB TotalPE5118 FreePE5118 AllocatedPE0 PVUUID166hLZ-2POl-GIsv-ELGh-8YVT-Zcoa-ZcLXzp 2)处理步骤: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [root@dockermnt] #vgreduce--removemissingvg_test /dev/sdd : read failedafter0of4096at0:Input /output error /dev/sdd1 : read failedafter0of2048at0:Input /output error /dev/sdd : read failedafter0of4096at21474770944:Input /output error /dev/sdd : read failedafter0of4096at21474828288:Input /output error /dev/sdd : read failedafter0of4096at4096:Input /output error /dev/sdd1 : read failedafter0of512at21467824128:Input /output error /dev/sdd1 : read failedafter0of512at21467938816:Input /output error /dev/sdd1 : read failedafter0of512at0:Input /output error /dev/sdd1 : read failedafter0of512at4096:Input /output error Couldn't find devicewithuuid166hLZ-2POl-GIsv-ELGh-8YVT-Zcoa-ZcLXzp. Wroteoutconsistentvolumegroupvg_test [root@dockermnt] #vgchange-ay /dev/sdd : read failedafter0of4096at0:Input /output error /dev/sdd1 : read failedafter0of2048at0:Input /output error 1logicalvolume(s) in volumegroup "vg_test" nowactive [root@dockermnt] #df-h FilesystemSizeUsedAvailUse%Mountedon /dev/sda3 193G14G170G8%/ tmpfs1.9G228K1.9G1% /dev/shm /dev/sda1 190M80M100M45% /boot /dev/mapper/vg_test-lvm_test 20G28M19G1% /mnt 测试表明:整个过程都不会影响/mnt中的数据运行 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 [root@dockermnt] #pvdisplay /dev/sdd : read failedafter0of4096at0:Input /output error /dev/sdd : read failedafter0of4096at21474770944:Input /output error /dev/sdd : read failedafter0of4096at21474828288:Input /output error /dev/sdd : read failedafter0of4096at4096:Input /output error /dev/sdd1 : read failedafter0of512at21467824128:Input /output error /dev/sdd1 : read failedafter0of512at21467938816:Input /output error /dev/sdd1 : read failedafter0of512at0:Input /output error /dev/sdd1 : read failedafter0of512at4096:Input /output error /dev/sdd1 : read failedafter0of2048at0:Input /output error ---Physicalvolume--- PVName /dev/sdb1 VGNamevg_test PVSize19.99GiB/notusable1.43MiB Allocatable yes (butfull) PESize4.00MiB TotalPE5118 FreePE0 AllocatedPE5118 PVUUIDfuQdIY-qkJw-fZJB-AauO-Zqpj-91RI-S1GG0X ---Physicalvolume--- PVName /dev/sdc1 VGNamevg_test PVSize19.99GiB/notusable1.43MiB Allocatable yes PESize4.00MiB TotalPE5118 FreePE5116 AllocatedPE2 PVUUIDTRlpMQ-snM6-u24f-cMHa-oiVt-XJ3w-6fjAbp 发现仍旧有I/O的错误出现,找到合适停机窗口,重启了系统,故障得到解决(这里注意重启前检查fstab信息,看下mount -a是否有报错)。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 [root@docker~] #pvdisplay ---Physicalvolume--- PVName /dev/sdb1 VGNamevg_test PVSize19.99GiB/notusable1.43MiB Allocatable yes (butfull) PESize4.00MiB TotalPE5118 FreePE0 AllocatedPE5118 PVUUIDfuQdIY-qkJw-fZJB-AauO-Zqpj-91RI-S1GG0X ---Physicalvolume--- PVName /dev/sdc1 VGNamevg_test PVSize19.99GiB/notusable1.43MiB Allocatable yes PESize4.00MiB TotalPE5118 FreePE5116 AllocatedPE2 PVUUIDTRlpMQ-snM6-u24f-cMHa-oiVt-XJ3w-6fjAbp 这样,系统就已经没有报错信息了。 本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1900161,如需转载请自行联系原作者

优秀的个人博客,低调大师

linux学习:持续集成篇--Maven私有库和本地库的安装与配置-03

如果构建的Maven 项目本地仓库没有对应的依赖包,那么就会去Nexus 私服去下载,那么如果Nexus 私服也没有此依赖包,就回去远程中央仓库下载依赖,Nexus 私服下载成功后再下载至本地Maven 库供项目引用。 maven私服器Sonatype Nexus的安装与配置 1、安装 1.1下载 Nexus(这里使用的是:nexus-2.11.2-03-bundle.tar.gz) http://www.sonatype.org/nexus/go/ 1.2解压:因为解压后有两个文件夹,所以这里新建了一个nexus文件夹 [root@localhostopt]#mkdirnexus [root@localhostopt]#tar-zxvf/opt/tar/nexus-2.11.2-03-bundle.tar.gz-C/opt/nexus/ [root@localhostopt]#cdnexus/ [root@localhostnexus]#ls nexus-2.11.2-03sonatype-work [root@localhostnexus]# (一个 nexus 服务,一个私有库目录) 1.3编辑 Nexus 的 nexus.properties 文件,配置端口和 work 目录信息(保留默认) [root@localhost conf]# cat nexus.properties #Jettysection application-port=8081 application-host=0.0.0.0 nexus-webapp=${bundleBasedir}/nexus nexus-webapp-context-path=/nexus #Nexussection nexus-work=${bundleBasedir}/../sonatype-work/nexus runtime=${bundleBasedir}/nexus/WEB-INF 1.4编辑 nexus 脚本 vi/opt/nexus/nexus-2.11.2-03/bin/nexus #改成root RUN_AS_USER=root 1.5启动 /opt/nexus/nexus-2.11.2-03/bin/nexusstart 1.6访问:http://192.168.175.9:8081/nexus 1.7登录,默认用户名 admin,默认密码 admin123 到此,Nexus 已安装完成,接下来是 Nexus 的配置 2、配置(登录后) 2.1 菜单 Administration/Server 配置邮箱服务地址(如果忘记密码,可以通过该邮箱找回密码) 测试邮箱: 给用户配置邮箱地址,方便忘记密码时找回: 2.2 修改密码 2.3 仓库 group仓库组: Nexus 通过仓库组的概念统一管理多个仓库,这样我们在项目中直接请求仓库组即可请求到仓库组管理的多个仓库 hosted宿主仓库: 主要用于发布内部项目构件或第三方的项目构件(如购买商业的构件)以及无法从公共仓库获取的构件(如 oracle 的 JDBC 驱动) proxy代理仓库: 代理公共的远程仓库; virtual虚拟仓库: 用于适配 Maven 1; 一般用到的仓库种类是 hosted、proxy。 Hosted仓库常用类型说明: releases:内部的模块中 release 模块的发布仓库 snapshots:发布内部的 SNAPSHOT 模块的仓库 3rd party:第三方依赖的仓库,这个数据通常是由内部人员自行下载之后发布上去 如果构建的Maven项目本地仓库没有对应的依赖包,那么就会去Nexus私服去下载,如果Nexus私服也没有此依赖包,就回去远程中央仓库下载依赖,这些中央仓库就是proxy 。Nexus私服下载成功后再下载至本地Maven库供项目引用。 设置proxy代理仓库(Apache Snapshots/Central/Codehaus Snapshots)准许远程下载: 注意:这里3个proxy都设置 setting.xml配置: <?xmlversion="1.0"encoding="UTF-8"?> <settingsxmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>G:\workspace\maven_space</localRepository> <interactiveMode>true</interactiveMode> <offline>false</offline> <pluginGroups> </pluginGroups> <!--配置权限,使用默认用户--> <servers> <server> <id>nexus-releases</id> <username>deployment</username> <password>deployment123</password> </server> <server> <id>nexus-snapshots</id> <username>deployment</username> <password>deployment123</password> </server> </servers> <mirrors> </mirrors> <profiles> <profile> <id>edu</id> <activation> <activeByDefault>false</activeByDefault> <jdk>1.6</jdk> </activation> <repositories> <!--私有库地址 仓库组 --> <repository> <id>nexus</id> <url>http://192.168.175.9:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <!--插件库地址--> <pluginRepository> <id>nexus</id> <url>http://192.168.175.9:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <!--激活profile--> <activeProfiles> <activeProfile>edu</activeProfile> </activeProfiles> </settings> 项目的构建与发布:pom.xml <distributionManagement> <repository> <id>nexus-releases</id> <name>NexusReleaseRepository</name> <url>http://192.168.175.9:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <name>NexusSnapshotRepository</name> <url>http://192.168.175.9:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> 发布到私有库: pom:<version>1.0-SNAPSHOT</version> pom:<version>1.0-RELEASES</version> 4、上传第三方jar,如:demo.jar 配置其开机启动 1、负责nexus到/etc/init.d下 cp/opt/nexus/nexus-2.11.2-03/bin/nexus/etc/init.d/nexus 2、修改nexus [root@localhost~]#vi/etc/init.d/nexus NEXUS_HOME="/opt/nexus/nexus-2.11.2-03/" 3、修改wrapper.conf [root@localhost~]#vi/opt/nexus/nexus-2.11.2-03/bin/jsw/conf/wrapper.conf wrapper.java.command=/home/jdk1.7.0_71/bin/java 4、添加脚本的可执行权限 chmod755/etc/init.d/nexus 5、添加为系统服务 chkconfig--addnexus

资源下载

更多资源
Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册
修改密码
忘记密码