Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7346082
  • 博文数量: 1763
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16217
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1763)

文章存档

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: 系统运维

2016-05-04 14:48:23

wget -P /etc/yum.repos.d/
rpm --import


cat >>/etc/sysctl.conf < # On Hardware Node we generally need
# packet forwarding enabled and proxy arp disabled
net.ipv4.ip_forward = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.all.forwarding = 1
net.ipv4.conf.default.proxy_arp = 0


# Enables source route verification
net.ipv4.conf.all.rp_filter = 1


# Enables the magic-sysrq key
kernel.sysrq = 1


# We do not want all our interfaces to send redirects
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
EOF


sysctl -p




yum install vzkernel vzctl vzquota ploop -y


reboot os...




/etc/init.d/vz status


//网络
sed -i '/NEIGHBOUR_DEVS/a NEIGHBOUR_DEVS=all' /etc/vz/vz.conf
//硬盘模式 生产中还是用ploop好,可以做磁盘限止
sed -i 's#VE_LAYOUT=ploop#VE_LAYOUT=simfs#g' /etc/vz/vz.conf
//磁盘空间
sed -i 's#DISK_QUOTA=yes#DISK_QUOTA=no#g' /etc/vz/vz.conf






下载模板
cd /vz/template/cache/
yum install epel-* -y
rpm -Uvh
yum install axel -y
axel -n 10




创建VM脚本
vi openvz.sh
#!/bin/bash
id=$1
ip=$2
hostname=test$id.vz.vm


vzlist -a
echo $id $ip $hostname
read -p "hehe"


vzctl create $id --ostemplate centos-6-x86_64 --ipadd $ip --hostname $hostname
vzctl start $id
vzctl set $id --nameserver 114.114.114.114 --save
vzctl set $id --onboot yes --save
vzctl set $id --ram 512M --swap 1024M --save
vzctl set $id --userpasswd root:123456
#vzctl exec $id echo '123456'|passwd root --stdin
vzctl restart $id


clear
echo "==============================================="
echo "ip=$ip "
echo "run:vzctl exec $id passwordd:123456 ,change you password!"
echo "==============================================="




阅读(1291) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~