当前位置: 首页 >> Tag标签为 'VPS'

为何我的yum不工作了?

现象:运行yum update后提示错误

[root@vps ~]# yum update nginx
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 229, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 104, in main
result, resultmsgs = base.doCommands()
File "/usr/share/yum-cli/cli.py", line 339, in doCommands
self._getTs(needTsRemove)
File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 101, in _getTs
self._getTsInfo(remove_only)
File "/usr/lib/python2.4/site-packages/yum/depsolve.py", line 112, in _getTsInfo
pkgSack = self.pkgSack
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 591, in <lambda>
pkgSack = property(fget=lambda self: self._getSacks(),
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 434, in _getSacks
self.repos.populateSack(which=repos)
File "/usr/lib/python2.4/site-packages/yum/repos.py", line 223, in populateSack
self.doSetup()
File "/usr/lib/python2.4/site-packages/yum/repos.py", line 71, in doSetup
self.ayum.plugins.run('postreposetup')
File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 176, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/fastestmirror.py", line 181, in postreposetup_hook
all_urls = FastestMirror(all_urls).get_mirrorlist()
File "/usr/lib/yum-plugins/fastestmirror.py", line 333, in get_mirrorlist
self._poll_mirrors()
File "/usr/lib/yum-plugins/fastestmirror.py", line 376, in _poll_mirrors
pollThread.start()
File "/usr/lib/python2.4/threading.py", line 416, in start
_start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

原因:系统内存不足,没有足够的内存来加载yum一些相关的插件,这种情况大多出现在vps上,一般vps内存512M,还不支持swap分区,启动mysql+php-fpm+nginx之后内存就剩下不多了。
解决办法,禁用yum的插件,命令如下:

yum --disableplugin=\* update nginx

OpenVZ中的VPS支持IPv6?

OpenVZ官方文档建议通过桥接方式来搞定IPv6,虽然也提供给VPS分配IPv6地址的方法,也提到需要通过修改sysctl.conf文件来处理邻居发现和路由发现等协议,但是文档并未提及如何修改sysctl.conf文件,详见:IPv6
Read the rest of this entry »

如何迁移OpenVZ中的VPS主机

OpenVZ中要迁移vps主机,只需停止vps,将vps主机文件及配置文件备份至其他主机即可。

cd /vz/private
vzctl stop 102
tar cf - 102/ | ssh -l root 10.255.7.251 "(cd /vz/private; tar xf -)"
cd /etc/vz/conf
scp 102.conf root@10.255.7.251:/etc/vz/conf/

在10.255.7.251主机执行

vzctl start 102

即可重新启动vps。

让VPS支持Tun/Tap?

要让VPS支持OpenVPN,让vps支tun/tap是第一步,如果在租用别人的vps,直接找客服要求增加tun/tap即可,要是自己搞的vps呢,那么该找谁要呢,参考OpenVZ官方文档就很容易搞定了:http://wiki.openvz.org/VPN_via_the_TUN/TAP_device
Read the rest of this entry »

OpenVZ的VPS里不支持nat表?

在vps里执行:

iptables -t nat -L

提示:

iptables v1.2.11: can’t initialize iptables table `nat’: Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

Read the rest of this entry »

让CentOS6提供基于OpenVZ的虚拟化服务

刚刚写了OpenVZ常用的几个参数,该文章基于OpenWall的LiveCD安装的,所以关于如何安装OpenVZ没有介绍,并且由于内核没有编译IPv6模块,所以虚拟机不支持IPv6协议,OpenVZ官方文档是支持IPv6的,所以在CentOS6下试验安装OpenVZ。
以下为具体步骤:
Read the rest of this entry »

OpenVZ常用的几个参数

上网下载了个Openwall-owl,试试OpenVZ虚拟环境,以下安装后需要做的事情:
1、下载template,一开始不知道如何制作template,就下载现成的吧,各个版本几乎都有,下载地 址:http://download.openvz.org/template/precreated/ 下载后的template放在:/vz/template/cache/ 目录即可。
Read the rest of this entry »

如何免费搭建自己的vps服务器?

首先在服务器上安装CENTOS5.X 确保能连上网络
一.准备工作
Read the rest of this entry »