今天用 KVM 挂载了一个 CentOS 7 的 iso 进行远程安装,
发现虽然 iso 挂载成功且进到引导界面,但是随后一直会卡在

dracut-initqueue[*]: Warning: Could not boot

后来找了下,发现 http://unix.stackexchange.com/questions/141515/centos-7-installation-failed
中间有一楼碰到的情况和我一样,解法是在开机前把挂载的硬盘位置手动改成/dev/sr0

具体方法也就是:你启动后看到 Install CentOS 7 这个界面的时候
先按下tab,然后把

inst.stage2=hd:LABEL=CentOS\x207\x20x86_64

改成

inst.stage2=hd:/dev/sr0

然后回车,即可接着正常进行安装。

评论

以下命令适用于CentOS 6/7环境

1
2
3
4
5
6
7
8
9
10
11
cd /tmp
yum install java -y
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.1.zip
unzip elasticsearch-1.4.1.zip
rm -rf elasticsearch-1.4.1.zip
mv elasticsearch-1.4.1 /usr/local/elasticsearch
curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
mv elasticsearch-elasticsearch-servicewrapper-*/service /usr/local/elasticsearch/bin/
rm -rf elasticsearch-elasticsearch-servicewrapper-*
/usr/local/elasticsearch/bin/service/elasticsearch install
service elasticsearch start

评论

最近几天一直在搬VPS,有时候搬的时候把SSH客户端缩小,网页打开超多,结果机器死机,这时候在电脑上执行的SSH客户端也因此遭殃,后来学聪明了,用screen命令来直接使SSH进程建立在服务器上来执行命令了.
那么,如何使用呢,首先

1
yum -y install screen

安装完screen之后,创建窗口.

1
screen -S window1

然后执行的命令都在服务器上的这个子窗口中进行了,如何在断线重连的时候恢复这个窗口呢.

1
screen -r window1

就OK了

补充,查看当前在服务器上挂着的窗口列表:

1
screen -ls

在窗口的状态下使用exit即可结束该窗口
在以观看模式进入某窗口

1
screen -x window1

附赠快捷键列表:
Ctrl+a c :在当前screen会话中创建窗口
Ctrl+a w :窗口列表
Ctrl+a n :下一个窗口
Ctrl+a p :上一个窗口
Ctrl+a 0-9 :在第0个窗口和第9个窗口之间切换

评论

曾经就T2的机器没办法做上LVM的问题纠结了N天,最后打单子问T2,他们给出了解决的办法,经过测试成功,在这里分享给大家.

LVM on CentOS Install Instructions

You can use our standard CentOS “RAID 0” install to create the base install and then convert the “RAID 0” slice to LVM.
Reinstall the CentOS OS with RAID 0 and once the OS install has completed log in to the system and run the following commands (choose which setup you prefer - LVM on RAID 1 [RECOMMENDED], LVM on RAID 0, LVM without RAID):

LVM on RAID 1

1
2
3
4
5
6
7
8
9
10
11
umount /raid0 
/bin/sed -i -e '/^\/.*\/raid0/d' /etc/fstab
/sbin/mdadm --manage /dev/md2 --stop
/sbin/mdadm --zero-superblock /dev/sda3 /dev/sdb3
sed -i -e '/^ARRAY/d' /etc/mdadm.conf
/sbin/mdadm --examine --scan >> /etc/mdadm.conf
/sbin/mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3
pvcreate /dev/md2
vgcreate lvmRaid /dev/md2
sed -i -e '/^ARRAY/d' /etc/mdadm.conf
/sbin/mdadm --examine --scan >> /etc/mdadm.conf

Note that you can name your Volume Group whatever you like, I just chose to name it “lvmRaid” (you see that in the last vgcreate command).
At this point you have an empty LVM space running on RAID 1.

LVM on RAID 0

1
2
3
4
5
6
7
8
9
10
11
umount /raid0 
/bin/sed -i -e '/^\/.*\/raid0/d' /etc/fstab
/sbin/mdadm --manage /dev/md2 --stop
/sbin/mdadm --zero-superblock /dev/sda3 /dev/sdb3
sed -i -e '/^ARRAY/d' /etc/mdadm.conf
/sbin/mdadm --examine --scan >> /etc/mdadm.conf
/sbin/mdadm --create /dev/md2 --level=0 --raid-devices=2 /dev/sda3 /dev/sdb3
pvcreate /dev/md2
vgcreate lvmRaid /dev/md2
sed -i -e '/^ARRAY/d' /etc/mdadm.conf
/sbin/mdadm --examine --scan >> /etc/mdadm.conf

Note that you can name your Volume Group whatever you like, I just chose to name it “lvmRaid” (you see that in the last vgcreate > command).
At this point you have an empty LVM space running on RAID 0.

LVM with no RAID

1
2
3
4
5
6
7
8
umount /raid0 
/bin/sed -i -e '/^\/.*\/raid0/d' /etc/fstab
/sbin/mdadm --manage /dev/md2 --stop
/sbin/mdadm --zero-superblock /dev/sda3 /dev/sdb3
sed -i -e '/^ARRAY/d' /etc/mdadm.conf
/sbin/mdadm --examine --scan >> /etc/mdadm.conf
pvcreate /dev/sda3 /dev/sdb3
vgcreate lvmSet /dev/sda3 /dev/sdb3

Note that you can name your Volume Group whatever you like, I just chose to name it “lvmSet” (you see that in the last vgcreate command).
At this point you have an empty LVM space running without RAID.
You may also want to create a “storage” partition to store your templates and ISO images. You can do that with commands like these:

1
2
3
4
5
6
7
lvcreate -L 50g lvmRaid -n storage 
mkfs.ext3 /dev/lvmRaid/storage
mkdir /storage
printf "/dev/lvmRaid/storage\t/storage\text3\tdefaults,noatime\t0\t2\n" >> /etc/fstab
mount /storage
mkdir /storage/iso
mkdir /storage/templates

Note that if you used the “LVM No RAID” commands then your volume group may be named lvmSet instead of lvmRaid. Adjust the commands accordingly.

评论

  • 第 1 页 共 1 页

BranchZero

一只向全栈不断努力的 Web 开发者、运维、与眼镜娘控,面向 Google 和爆栈编程,继承了大部分理科宅的特性(除了审美),可惜是个 Acer


Web Developer


HangZhou