系统初始化
1、sudo su � 切换到root用户
2、卸载openjdk1.6和jdk1.7
yum remove java-1.6.0-openjdk*java-1.7.0-openjdk* //centos6.7
root@az-aacdb01:~# apt-get purge openjdk* //ubuntu12.04
root@az-aacdb01:~# mv jdk1.8.0_51 /usr/local/
root@az-aacdb01:~# cd /usr/local/
root@az-aacdb01:/usr/local# vim /etc/profile
JAVA_HOME=/usr/local/jdk1.8.0_51/
JAVA_BIN=/usr/local/jdk1.8.0_51/bin
JRE_HOME=/usr/local/jdk1.8.0_51/jre
PATH=$PATH:/usr/local/jdk1.8.0_51/bin:/usr/local/jdk1.8.0_51/jre/bin
CLASSPATH=/usr/local/jdk1.8.0_51/jre/lib:/usr/local/jdk1.8.0_51/lib:/usr/local/jdk1.8.0_51/jre/lib/charsets.jar
root@az-aacdb01:/usr/local# source /etc/profile
root@az-aacdb01:/usr/local# which java
/usr/local/jdk1.8.0_51/bin/java
root@az-aacdb01:/usr/local# java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)
3、在安装python的时候报错,原因是没有gcc编译器
解决方法:yum install gcc make
4、初始化系统的脚本,参考附件:
./syscfg.sh
5、安装Python
[root@AAC-DMP-01 Python-2.7.11]# chmod +x update.sh
[root@AAC-DMP-01 Python-2.7.11]# vim update.sh
#!/bin/bash
./configure --prefix=/usr/local/python2.7
make
make install
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/python2.7/bin/python/usr/bin/python
/usr/bin/python -V
cd ..
rm -rf Python-2.7.11
[root@daixuan ~]# python -V
Python 2.6.6
当安装完成了Python2.7.11
[root@daixuan ~]# vim /usr/bin/yum
#!/usr/bin/python
改为原来系统自带的版本,否则yum工具不能使用:
#!/usr/bin/python2.6.6
6、LVM创建
第一步:
fdisk /dev/sdc ##创建sdc1
n 新建分区,p 主分区sdc1
mkfs.ext4 /dev/sdc1
pvcreate /dev/sdc1 // pvcreate指令:创建物理卷,pvremove指令:删除指定物理卷
df -h
vgcreate vgspace01 /dev/sdc1 // vgcreate指令:创建卷组
vgdisplay // vgdisplay指令:显示卷组属性
lvcreate --name lv01_ext -L 1022G vgspace01 // lvcreate指令用于创建LVM的逻辑卷,逻辑卷是创建在卷组vgspace01之上的,逻辑卷对应的设备文件保存在卷组目录下,例如:在卷组" vgspace01"上创建一个逻辑卷"lv0l_ext ",则此逻辑卷对应的设备文件为"/dev/ vgspace01/lv0l_ext "
第二步、添加第二块磁盘
fdisk /dev/sde
n p
mkfs.ext4 /dev/sde1 //先格式化成ext4
pvcreate /dev/sde1
Physical volume "/dev/sde1" successfully created
vgextend vgspace01 /dev/sde1
Volume group "vgspace01" successfully extended
lvextend /dev/vgspace01/lv01_ext/dev/sde1
Size of logical volume vgspace01/lv01_ext changed from 2.00 TiB (523519extents) to 3.00 TiB (785406 extents).
mkfs.ext4/dev/vgspace01/lv01_ext //前面磁盘如果都已经格式化了,这里就不需要格式化了
vi/etc/fstab //如果是挂在磁盘,一般使用blkid找到uuid然后挂载
/dev/vgspace01/lv01_ext /opt ext4 defaults 0 0
mount �a //让挂在的LVM立即生效