首页 文章 精选 留言 我的

精选列表

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

Magic Leap基于Linux推出开发者门户和SDK

12月20日晚10点,神秘的增强现实公司Magic Leap公布了其第一款产品——AR眼镜Magic Leap One。据悉,近日Magic Leap表示会在游戏开发者大会GDC上公布其创作门户Creator Portal和 Magic Leap One的软件开发工具包 LuminSDK。 作为为Magic Leap开发者提供工具、文档、学习资源和技术支持的平台, Magic Leap表示Creator Portal的这些工具和资源有利于开发者深入进行Magic Leap空间计算,并创作下一代人机交互产品。 Lumin SDK目前还属于技术预览版,感兴趣的开发者可前往Magic Leap网站下载UE4或 Unity版。同时,Magic Leap One搭载了英伟达Tegra处理器,为开发者提供了一款定制化的图形调试工具“Tegra Graphics debugger”。

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

01.Java基础(多线程回顾,对比Linux多线程)

两个线程间通信,实现交替打印 public class Thread1 { public static void main(String[] args) { final Printer printer = new Printer(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print1(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print2(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); } } /** * 等待唤醒机制,两个线程间通信 * @author renzhenming * */ class Printer{ private int flag = 1; public void print1() throws InterruptedException{ synchronized(this){ if (flag !=1) { /** * obj.wait():该方法的调用,使得调用该方法的执行线程(T1)放弃obj的对象锁并阻塞, * 直到别的线程调用了obj的notifyAll方法、或者别的线程调用了obj的notify方法且JVM选择唤醒(T1), * 被唤醒的线程(T1)依旧阻塞在wait方法中,与其它的线程一起争夺obj的对象锁, * 直到它再次获得了obj的对象锁之后,才能从wait方法中返回。 * (除了notify方法,wait还有带有时间参数的版本,在等待了超过所设时间之后, * T1线程一样会被唤醒,进入到争夺obj对象锁的行列;另外中断可以直接跳出wait方法) * * 1.在同步代码块中,用哪个对象锁就用哪个对象调用wait方法, * 2.为什么wait和notify这些方法要定义在Object类中?因为锁对象可以是任意对象,那么任意对象的类都是Object的子类,Object是任意类的基类,所以将方法定义在Object这个类中就会让任意对象对其进行调用 * sleep和wait方法的区别:a.sleep在同步代码块或同步函数中,不释放锁,(睡着了也会抱着锁睡),wait相反会释放锁 b.sleep方法必须传入参数,参数就是时间,时间到了自动醒来,wait方法可以传入时间参数,也可以不传入时间参数,如果给wait方法传入时间参数,用法与sleep相似,时间到了就停止等待(通常都是用没有参数的wait方法) */ this.wait(); } System.out.print("y"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("z"); System.out.print("i"); System.out.print("\r\n"); flag = 2; /** * obj.notify():该方法的调用,会从所有正在等待obj对象锁的线程中,唤醒其中的一个(选择算法依赖于不同实现), * 被唤醒的线程此时加入到了obj对象锁的争夺之中,然而该notify方法的执行线程此时并未释放obj的对象锁, * 而是离开synchronized代码块时释放。因此在notify方法之后,synchronized代码块结束之前, * 所有其他被唤醒的,等待obj对象锁的线程依旧被阻塞。 */ this.notify(); } } public void print2() throws InterruptedException{ synchronized (this) { if (flag != 2) { wait(); } System.out.print("z"); System.out.print("h"); System.out.print("e"); System.out.print("n"); System.out.print("m"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("\r\n"); flag = 1; notify(); } } } 打印结果 yingzi zhenming yingzi zhenming yingzi zhenming yingzi zhenming yingzi zhenming yingzi zhenming yingzi zhenming yingzi zhenming yingzi zhenming ... 三个线程或三个以上通信(试错,期待的结果是逐条打印,实际结果看下边) 按照上边的方式,代码如下: public class Thread1 { public static void main(String[] args) { final Printer printer = new Printer(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print1(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print2(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print3(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); } } /** * 等待唤醒机制,两个线程间通信 * @author renzhenming * */ class Printer{ private int flag = 1; public void print1() throws InterruptedException{ synchronized(this){ if (flag !=1) { /** * obj.wait():该方法的调用,使得调用该方法的执行线程(T1)放弃obj的对象锁并阻塞, * 直到别的线程调用了obj的notifyAll方法、或者别的线程调用了obj的notify方法且JVM选择唤醒(T1), * 被唤醒的线程(T1)依旧阻塞在wait方法中,与其它的线程一起争夺obj的对象锁, * 直到它再次获得了obj的对象锁之后,才能从wait方法中返回。 * (除了notify方法,wait还有带有时间参数的版本,在等待了超过所设时间之后, * T1线程一样会被唤醒,进入到争夺obj对象锁的行列;另外中断可以直接跳出wait方法) */ this.wait(); } System.out.print("y"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("z"); System.out.print("i"); System.out.print("\r\n"); flag = 2; /** * obj.notify():该方法的调用,会从所有正在等待obj对象锁的线程中,唤醒其中的一个(选择算法依赖于不同实现), * 被唤醒的线程此时加入到了obj对象锁的争夺之中,然而该notify方法的执行线程此时并未释放obj的对象锁, * 而是离开synchronized代码块时释放。因此在notify方法之后,synchronized代码块结束之前, * 所有其他被唤醒的,等待obj对象锁的线程依旧被阻塞。 */ this.notify(); } } public void print2() throws InterruptedException{ synchronized (this) { if (flag != 2) { wait(); } System.out.print("z"); System.out.print("h"); System.out.print("e"); System.out.print("n"); System.out.print("m"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("\r\n"); flag = 3; notify(); } } public void print3() throws InterruptedException{ synchronized (this) { if (flag != 3) { wait(); } System.out.print("f"); System.out.print("a"); System.out.print("l"); System.out.print("l"); System.out.print("i"); System.out.print("n"); System.out.print("l"); System.out.print("o"); System.out.print("v"); System.out.print("e"); System.out.print("\r\n"); flag = 1; notify(); } } } 结果: zhenming yingzi zhenming yingzi zhenming yingzi zhenming yingzi zhenming yingzi zhenming yingzi zhenming fallinlove zhenming ... 为什么会出现上边的情况?我们极端分析一下,假设,第一个回合中,首先执行的是第2和第3个线程,也就是print2 print3方法,此时,由于flag不满足执行条件,两个线程都进入了等待状态,然后执行print1打印了一条,设置flag=2,然后notify,此时通常疏忽的开发人员可能会想当然的认为,flag=2 了,那么理所当然应该唤醒线程2了,应该打印print2了,事实上并非如此,由于notify是随机唤醒一个线程,那么它可能唤醒2 也可能唤醒3,假设此时被唤醒的线程是3,由于if语句的特性,不会重新判断执行条件,而是在哪里等待,在哪里醒来,于是直接跳过了判断语句执行了print3的打印内容,所以就出现了这种情况 针对这种问题,我们尝试用while代替if做条件判断,while是循环判断,每次判断都会判断标记,我们对程序做修改后如下: public class Thread1 { public static void main(String[] args) { final Printer printer = new Printer(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print1(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print2(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print3(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); } } /** * 等待唤醒机制,两个线程间通信 * @author renzhenming * */ class Printer{ private int flag = 1; public void print1() throws InterruptedException{ synchronized(this){ while (flag !=1) { /** * obj.wait():该方法的调用,使得调用该方法的执行线程(T1)放弃obj的对象锁并阻塞, * 直到别的线程调用了obj的notifyAll方法、或者别的线程调用了obj的notify方法且JVM选择唤醒(T1), * 被唤醒的线程(T1)依旧阻塞在wait方法中,与其它的线程一起争夺obj的对象锁, * 直到它再次获得了obj的对象锁之后,才能从wait方法中返回。 * (除了notify方法,wait还有带有时间参数的版本,在等待了超过所设时间之后, * T1线程一样会被唤醒,进入到争夺obj对象锁的行列;另外中断可以直接跳出wait方法) */ this.wait(); } System.out.print("y"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("z"); System.out.print("i"); System.out.print("\r\n"); flag = 2; /** * obj.notify():该方法的调用,会从所有正在等待obj对象锁的线程中,唤醒其中的一个(选择算法依赖于不同实现), * 被唤醒的线程此时加入到了obj对象锁的争夺之中,然而该notify方法的执行线程此时并未释放obj的对象锁, * 而是离开synchronized代码块时释放。因此在notify方法之后,synchronized代码块结束之前, * 所有其他被唤醒的,等待obj对象锁的线程依旧被阻塞。 */ this.notify(); } } public void print2() throws InterruptedException{ synchronized (this) { while (flag != 2) { wait(); } System.out.print("z"); System.out.print("h"); System.out.print("e"); System.out.print("n"); System.out.print("m"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("\r\n"); flag = 3; notify(); } } public void print3() throws InterruptedException{ synchronized (this) { while (flag != 3) { wait(); } System.out.print("f"); System.out.print("a"); System.out.print("l"); System.out.print("l"); System.out.print("i"); System.out.print("n"); System.out.print("l"); System.out.print("o"); System.out.print("v"); System.out.print("e"); System.out.print("\r\n"); flag = 1; notify(); } } } 更离谱的问题出现,打印结果: yingzi zhenming fallinlove 三个线程在执行一次之后就全部停了,或者说全部进入了等待状态,为什么会出现这一现象? 假设程序执行开始,先执行了线程2线程3,由于flag条件不满足,两个线程都进入等待状态,此时线程1开始执行,设置flag=2,执行完毕notify唤醒一个线程,并且由于自身条件也陷入等待状态,假设先唤醒的是线程3,由于flag值不对,线程3仍然处于等待状态,这种情况下,三个线程全部陷入等待状态 notify随机唤醒一个线程,是导致这一问题出现的原因,那么可否唤醒全部线程呢, notifyall就出现了,notifyAll可以唤醒全部线程,然后根据条件的判断执行相应的线程,但是这样做是由弊端的,那就是每次都要将所有线程唤醒,这是JDK1.5之前的处理办法,JDK1.5有新的方法解决这一问题 public class Thread1 { public static void main(String[] args) { final Printer printer = new Printer(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print1(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print2(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); new Thread(new Runnable() { @Override public void run() { while(true){ try { printer.print3(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); } } /** * 等待唤醒机制,两个线程间通信 * @author renzhenming * */ class Printer{ private int flag = 1; public void print1() throws InterruptedException{ synchronized(this){ while (flag !=1) { /** * obj.wait():该方法的调用,使得调用该方法的执行线程(T1)放弃obj的对象锁并阻塞, * 直到别的线程调用了obj的notifyAll方法、或者别的线程调用了obj的notify方法且JVM选择唤醒(T1), * 被唤醒的线程(T1)依旧阻塞在wait方法中,与其它的线程一起争夺obj的对象锁, * 直到它再次获得了obj的对象锁之后,才能从wait方法中返回。 * (除了notify方法,wait还有带有时间参数的版本,在等待了超过所设时间之后, * T1线程一样会被唤醒,进入到争夺obj对象锁的行列;另外中断可以直接跳出wait方法) */ this.wait(); } System.out.print("y"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("z"); System.out.print("i"); System.out.print("\r\n"); flag = 2; /** * obj.notify():该方法的调用,会从所有正在等待obj对象锁的线程中,唤醒其中的一个(选择算法依赖于不同实现), * 被唤醒的线程此时加入到了obj对象锁的争夺之中,然而该notify方法的执行线程此时并未释放obj的对象锁, * 而是离开synchronized代码块时释放。因此在notify方法之后,synchronized代码块结束之前, * 所有其他被唤醒的,等待obj对象锁的线程依旧被阻塞。 */ this.notifyAll(); } } public void print2() throws InterruptedException{ synchronized (this) { while (flag != 2) { wait(); } System.out.print("z"); System.out.print("h"); System.out.print("e"); System.out.print("n"); System.out.print("m"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("\r\n"); flag = 3; notifyAll(); } } public void print3() throws InterruptedException{ synchronized (this) { while (flag != 3) { wait(); } System.out.print("f"); System.out.print("a"); System.out.print("l"); System.out.print("l"); System.out.print("i"); System.out.print("n"); System.out.print("l"); System.out.print("o"); System.out.print("v"); System.out.print("e"); System.out.print("\r\n"); flag = 1; notifyAll(); } } } 结果: yingzi zhenming fallinlove yingzi zhenming fallinlove yingzi zhenming fallinlove yingzi zhenming fallinlove yingzi zhenming fallinlove ... JDK1.5互斥锁 所谓互斥锁, 指的是一次最多只能有一个线程持有的锁. 在jdk1.5之前, 我们通常使用synchronized机制控制多个线程对共享资源的访问. 而现在, Lock提供了比synchronized机制更广泛的锁定操作, Lock和synchronized机制的主要区别: synchronized机制提供了对与每个对象相关的隐式监视器锁的访问, 并强制所有锁获取和释放均要出现在一个块结构中, 当获取了多个锁时, 它们必须以相反的顺序释放. synchronized机制对锁的释放是隐式的, 只要线程运行的代码超出了synchronized语句块范围, 锁就会被释放. 而Lock机制必须显式的调用Lock对象的unlock()方法才能释放锁, 这为获取锁和释放锁不出现在同一个块结构中, 以及以更自由的顺序释放锁提供了可能。 import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; public class Thread1 { public static void main(String[] args) { final Printer printer = new Printer(); new Thread(new Runnable() { @Override public void run() { while (true) { try { printer.print1(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); new Thread(new Runnable() { @Override public void run() { while (true) { try { printer.print2(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); new Thread(new Runnable() { @Override public void run() { while (true) { try { printer.print3(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }).start(); } } /** * 等待唤醒机制,互斥锁 * * @author renzhenming * */ class Printer { ReentrantLock r = new ReentrantLock(); Condition c1 = r.newCondition(); Condition c2 = r.newCondition(); Condition c3 = r.newCondition(); private int flag = 1; public void print1() throws InterruptedException { r.lock(); if (flag != 1) { c1.await(); } System.out.print("y"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("z"); System.out.print("i"); System.out.print("\r\n"); flag = 2; c2.signal(); r.unlock(); } public void print2() throws InterruptedException { r.lock(); if (flag != 2) { c2.await(); } System.out.print("z"); System.out.print("h"); System.out.print("e"); System.out.print("n"); System.out.print("m"); System.out.print("i"); System.out.print("n"); System.out.print("g"); System.out.print("\r\n"); flag = 3; c3.signal(); r.unlock(); } public void print3() throws InterruptedException { r.lock(); if (flag != 3) { c3.await(); } System.out.print("f"); System.out.print("a"); System.out.print("l"); System.out.print("l"); System.out.print("i"); System.out.print("n"); System.out.print("l"); System.out.print("o"); System.out.print("v"); System.out.print("e"); System.out.print("\r\n"); flag = 1; c1.signal(); r.unlock(); } } 结果,按照唤醒顺序执行线程,不再需要使用while判断,if即可 fallinlove yingzi zhenming fallinlove yingzi zhenming fallinlove yingzi zhenming fallinlove yingzi zhenming fallinlove yingzi zhenming fallinlove yingzi zhenming fallinlove yingzi zhenming ...

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

winscp Window自动上传文件到LINUX批处理脚本

转载:http://www.jb51.net/article/59075.htm 1.下载winscp 大家可以去网上自己找,我把winscp安装在c:下的 2.把要执行的命令保存到文件winscp.bat里,这个winscp.bat可以自己创建,我是放在d:下的. winscp.bat脚本内容: 复制代码代码如下: option confirm off open user:pwd@192.168.10.150:22 cd /root/backup put d:\*.php close exit pause 3.执行命令 复制代码代码如下: C:\winscp>WinSCP.com /script=d:\winscp.bat /log=d:\winscp.log

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

阿里云服务器ECS安装linux CentOS 6.8教程

一、先登录你的阿里云账号。前提是你要有云服务器,怎么购买我们这里就不写教程了。登录进去以后点击管理控制台,点击云服务器ECS 二、然后点击实例 三、找到需要修改装系统的实例 点击管理 四、如果服务器还在运行,先停止掉,然后点击更换系统盘。 五、选择公共镜像-->选择CentOS 版本这里我们选择的是6.8 64位.登录名默认root。设置登录密码点击确定更换。如果你的阿里云账号绑定了手机,这里需要手机验证码。 输入验证码以后更换成功 点击查看,他正在启动中,等待一会... 六。大概30秒以后启动成功一会点击远程连接,我们先登录进去 连上以后,输入root 登录密码 然后我们输入命令 cd / 进入到根目录 然后输入命令ll 显示出如下所有目录 系统更换成功!下一篇讲怎么给阿里云服务器安装图形界面以及安装VNC Viewer 实现远程界面控制! 码农不容易,码文章更不容易啊,喜欢小编多多支持请点击关注哦,小编会更加努力每天给大家分享技术文章。

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

ECS Linux 服务器公钥秘钥SSH登录

Ubuntu 14.04.1为例,设置步骤如下: 一. 生成密钥的公钥和私钥 # ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): #输入密码 Enter same passphrase again: #输入密码 Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 1c:37:a8:a3:65:a2:4a:89:ab:46:30:ad:54:d1:40:eb root@iZ28vo50eu5Z 二. 将生成的私钥(id_rsa)下载到本地的windows机器上,并把公钥导入到.ssh/authorized_keys 文件中去 # cd /root/.ssh/ #cat id_rsa.pub >authorized_keys 三. 设置sshd 服务器服务,打开以下设置: RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile /root/.ssh/authorized_keys 修改以下设置: ChallengeResponseAuthentication no PasswordAuthentication no UsePAM no 四. 重启ssh服务 #service ssh restart 五. 导入私钥到远程工具中,比如xshell。 新建连接,点击左边用户身份验证: http://help.aliyun.com/knowledge_detail/6502152.html?spm=5176.7114037.1996646101.29.mSdCu4&pos=15 本文转自毒逆天博客园博客,原文链接:http://www.cnblogs.com/dunitian/p/4970813.html,如需转载请自行联系原作者

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

Linux下“read failed after 0 of 4096 at 0: Input/output error”

1、故障描述( 在线移除一块被设置为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 1 [root@dockermnt] #vgreduce--removemissingvg_test 1 2 3 4 5 6 7 8 9 10 11 /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 1 [root@dockermnt] #vgchange-ay 1 2 3 /dev/sdd : read failedafter0of4096at0:Input /output error /dev/sdd1 : read failedafter0of2048at0:Input /output error 1logicalvolume(s) in volumegroup "vg_test" nowactive 1 [root@dockermnt] #df-h 1 2 3 4 5 6 FilesystemSizeUsedAvailUse%Mountedon /dev/sda3 193G14G170G8%/ tmpfs1.9G228K1.9G1% /dev/shm /dev/sda1 190M80M100M45% /boot /dev/mapper/vg_test-lvm_test 20G28M19G1% /mnt 1 [root@dockermnt] #pvdisplay 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 /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的错误出现,跳过重启系统,故障得到解决(这里注意重启前检查fatab信息,看下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/1748466,如需转载请自行联系原作者

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

谢烟客---------Linux之DNS服务系统的基础知识

DNS Domain Name Server 1)C/S架构:SOCKET通信IP + PORT 2)应用层协议:资源子网 BIND Berkerley Information Name Domain DNS由来 1)统一名字,自己维护 <自己查询> 解析: 基于key查找value: 查询数据库(二维关系的表: raw, column) 根据主机名找到对应的行, 找到对应的column 2)统一维护,定时下载 <自己查询> 3)统一查询,Glibc库作为客户端,基于UDP请求解析 3.1 查询速度慢 3.2hash主机(域)名, 放于内存中, 查询速度快 3.3划片.基于hash数字,分布式:一个主机管理不了,基于授权将功能分散出去,让多个主机分别处理。 4)基于域名后缀,分布式:基于授权将功能分散出去,让多个主机分别处理。 namespace: 所有名称所在范围: 根 域是无形的。真实存在的是主机 域的大小是非恒定的: 由域内的主机数量决定 DNS树状结构图 名称解析过程 递归和迭代的区别 DNS服务器的作用 1、为所有人解析自己所负责的域 2、《递归》为部分人或所有人提供解析 DNS解析 本文转自 lccnx 51CTO博客,原文链接:http://blog.51cto.com/sonlich/1965708,如需转载请自行联系原作者

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Spring

Spring

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

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册