Archive for 05月, 2008

May 27 2008

The table is full mysql 错误号: 1114处理方法

Published by David under 数据库管理|DBA

运行vbb登陆后台admincp时,mysql返回 #1114 - The table ‘xxxx’ is full
由于内存表的大小超过了规定的范围
网上提到的有两种解决方法,
一种是修改tmp_table_size参数,另外一种是修改max_heap_table_size参数。。。
[root@localhost etc]# vi /etc/rc.d/init.d/mysql
找到
$bindir/mysqld_safe –datadir=$datadir –pid-file=$pid_file >/dev/null 2>&1 &
修改为
$bindir/mysqld_safe –datadir=$datadir –pid-file=$pid_file -O tmp_table_size=64M -O max_heap_table_size=32M >/dev/null 2>&1 &
-
重启mysql
[root@localhost etc]# /usr/bin/mysqladmin -u root -p shutdown
Enter password:
[root@localhost etc]# /etc/init.d/mysql start
[root@localhost etc]# mysql
-
查看是否己修改
mysql> show variables like ‘%max_heap_table_size%’;
+———————+———-+
| Variable_name | Value |
+———————+———-+
| max_heap_table_size | 33553408 |
+———————+———-+
1 row in set (0.00 sec)
mysql> show variables like ‘%tmp_table_size%’;
+—————-+———-+
| Variable_name | Value |
+—————-+———-+
| tmp_table_size | 67108864 |
+—————-+———-+
1 row in set (0.00 sec)
己经修改成功!

No responses yet

May 16 2008

[转帖]Clock in a Linux Guest Runs More Slowly or Quickly Than Real Time Products

Published by David under Unix|Linux

VMware ACE

VMware ESX Server

VMware GSX Server

VMware Server

VMware Workstation

Details

Why does the clock in my Linux guest consistently run more slowly or more quickly than real world time?

Solution

Linux guest operating systems keep time by counting timer interrupts. Unpatched 2.4 and earlier kernels program the virtual system timer to request clock interrupts at 100Hz (100 interrupts per second). 2.6 kernels, on the other hand, request interrupts at 1000Hz — ten times as often. Some 2.4 kernels modified by distribution vendors to contain 2.6 features also request 1000Hz interrupts, or in some cases, interrupts at other rates, such as 512Hz.
Furthermore, an SMP-capable Linux kernel requests additional timer interrupts from the virtual local APIC timer. An SMP-capable kernel running on a one-CPU system generates twice as many total timer interrupts as the corresponding UP kernel, while such a kernel running on a two-CPU system requests three times as many. In general, an SMP-capable kernel running on CPUs requests times as many interrupts per second as a UP kernel. For example, an unmodified 2.6 Linux kernel running on a two-CPU virtual machine requests a total of 3000 clock interrupts per second.
When a guest asks for more than 1000 clock interrupts per second, it can be difficult for the virtual machine to keep up, especially if other applications are running on the host at the same time. This can cause the clock in the guest operating system to fall so far behind real time that it is unable to catch up. The overhead of delivering so many virtual clock interrupts can also hurt guest performance and increase host CPU consumption.
It can also be difficult for the guest operating system to field 1000 clock interrupts per second. Even on real hardware, clock interrupts are sometimes lost because the operating system is busy for more than 1 millisecond and another clock interrupt comes in before the previous one was handled. Linux 2.6 contains code to detect such “lost ticks” and correct for them. Unfortunately, this code can trigger the correction spuriously in some cases, resulting in the Linux clock running more quickly than real time. This problem happens more often in a virtual machine than on real hardware, and can cause noticeable time gains. In some cases, the guest clock has been observed to run more than 10% more quickly than real time.
Continue Reading »

No responses yet

May 16 2008

ESX NTP 虚拟机时间同步

Published by David under Unix|Linux

我在esx3.02的操作过程,大家需要做的是打开防火墙的端口161。
[root@esx02 root]#esxcfg-firewall –enableService ntpClient

[root@esx02 root]# vi /etc/ntp.conf
# Prohibit general access to this service.
restrict default ignore

# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1
restrict 127.0.0.1
restrict default kod nomodify notrap
server 0.vmware.pool.ntp.org
server 1.vmware.pool.ntp.org
server 2.vmware.pool.ntp.org
driftfile /var/lib/ntp/drift

# — CLIENT NETWORK ——-
# Permit systems on this network to synchronize with this
# time service. Do not permit those systems to modify the
# configuration of this service. Also, do not use those
# systems as peers for synchronization.
# restrict 192.168.1.0 mask 255.255.255.0 notrust nomodify notrap

“/etc/ntp.conf” 83L, 2970C written
[root@esx02 root]# vi /etc/ntp/step-tickers
re.pool.ntp.org
1.vmware.pool.ntp.org
2.vmware.pool.ntp.org
~

~

“/etc/ntp/step-tickers” 4L, 61C written
[root@esx02 root]# vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
172.16.1.130 esx02.vmware.cn
0.vmware.pool.ntp.org
1.vmware.pool.ntp.org
2.vmware.pool.ntp.org

~
~
~
~
~
~
~
~
~
“/etc/hosts” 8L, 244C written
[root@esx02 root]# service ntpd restart
Shutting down ntpd: [ OK ]
ntpd: Synchronizing with time server: [ OK ]
Starting ntpd: [ OK ]
[root@esx02 root]#
设置ESX开机, NTP服务自启动:

chkconfig –level 345 ntpd on

指定ESX关机时, 硬件时钟与系统时钟同步:

hwclock –systohc

关于vmware 客户机的配置
VM时间同步十分重要. 普通计算机一般都可以通过硬件所提供的时钟中断(CLOCK INTERRUPT)或时钟标记(CLOCK TICK), 来计算出系统时间. 对于运行在ESX上的VM来说, 它们并不直接使用ESX硬件, 时钟中断或时钟标记是由ESX的虚拟提供的. 在ESX繁忙的时候, 常常无法准时准确的为所有VM提供时钟中断和.时钟标记. 这样VM就很根据这些信号计算出准确的时间. 所以需要与时间源同步.

VM可以选择与ESX服务器做时间同步, 或是采用惯常的同步方式与其他时间源同步.

VM与ESX时间同步. 是由ESX直接提供时间给VM(而不是上述的时钟中断, 标记, 由VM自己计算出时间). VM必需安装VMWARE TOOLS. 然后在VMWARE TOOLS的配置中选择: 与ESX HOST同步. 如果是WINDOWS VM, 必需关闭WINDOWS TIME SERVICE, 否则WINDOWS TIME SERVICE将霸占UDP 123口, 使与ESX的时间同步无法正常进行.

VM与ESX时间同步, 只有当VM的时间>>落后<<于ESX时才能起到校正的作用!

如果不采用VM与ESX进行时间同步. VM可以与其他NTP时间源同步. 加入了WINDOWS AD的WINDOWS PC/服务器, 一般莫认与PD同步. 其他的需要手动设置.

1、windows os关闭时钟同步功能,安装vmware-tools,设置同步为开。
2、linux os 关闭ntpd服务,安装vmware-tools ,设置同步为开,或者直接编辑vmx文件,并加入:
tools.syncTime = “TRUE”。

No responses yet

May 12 2008

linux下安装及配置snmp服务

Published by David under Unix|Linux

1、确保本机已经安装了snmp服务

[root@idc ~]# rpm -qa |grep snmp

net-snmp-libs-5.1.2-11.EL4.7

net-snmp-5.1.2-11.EL4.7

如果没有,那么放入linux安装盘找到snmp的rpm包进行安装,或者到网上搜索适合自己linux发行版本的rpm包进行安装
在新版本的centos及redhat es版本中可能在安装时会提示依赖性错误,这时需要安装lm_sensors-2.8.7-2.40.3.i386.rpm,再安装netsnmp软件。

2、snmpd.conf文件配置

按照如下方式修改snmpd.conf文件

A、修改默认的community string

com2sec notConfigUser default public

将public修改为你才知道的字符串

B、把下面的#号去掉

#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc

C、把下面的语句

access notConfigGroup “” any noauth exact systemview none none

改成:

access notConfigGroup “” any noauth exact mib2 none none

3、重启snmpd服务

#/etc/rc.d/init.d/snmpd restart

完成snmpd的配置

4、确保linux的iptables防火墙对我们的流量监控服务器开放了udp 161端口的访问权限

可使用iptables –L –n 查看当前iptables规则

可编辑/etc/sysconfig/iptables文件来修改iptables规则。

把snmpd服务添加为自启动

chkconfig snmpd on

可以用chkconfig –list |grep on 来查看是否已经是自启组

如果chkconfig –list |grep snmpd 没有的话可以先用以下命令增加

chkconfig –add snmpd

No responses yet

May 12 2008

各种系统下配置snmp方法

Published by David under 网络|Network

在Windows XP/2000 系统中配置 SNMP 代理

关于如何在Windows系统上安装SNMP代理,可参见在Windows系统中安装SNMP代理。

在Windows XP/2000 系统中配置 SNMP 代理的具体步骤如下:

点击开始,指向设置,然后点击控制面板。双击管理工具,然后双击计算机管理。

在控制台树中,点击服务和应用程序,然后点击服务。

下滚明细表窗格,并点击 SNMP service。

点击操作菜单上的属性。

如果您想在身份验证失败的时候有陷阱信息发出,那么请在安全分页中选择发送身份验证陷阱。

在接收的团体名称下点击添加。

在团体权利下,为主机选择一个许可的级别以处理从被选团体接收的请求。

在社区名称中输入名称(区分大小写),然后点击添加。

指定是否从主机接收SNMP 数据包:

要想从网络上的任何主机接收SNMP 请求,且无论其身份,请点击接收来自任何主机 SNMP 数据包。

要想限制接收 SNMP 数据包,请点击接收来自这些主机的 SNMP 数据包,点击添加,输入适当的主机名、IP或IPX 地址, 然后再次点击添加。

点击应用。

页首

配置SNMP陷阱的步骤如下:

点击开始,指向设置,然后点击控制面板。双击管理工具,然后双击计算机管理。

在控制台树中,点击服务和应用程序,然后点击服务。

下滚明细表窗格,并点击 SNMP service。

点击操作菜单上的属性。

打开陷阱分页窗格,在社区名称下输入计算机将把陷阱发至的社区名称(区分大小写),然后点击添加到列表。

在陷阱目标中点击添加。

在主机名,IP或 IPX地址中输入主机的相关信息并点击添加。

重复第5步到第7步,直到添加完您要添加的所有团体和陷阱目标。

点击确定。

在 Windows NT 系统配置SNMP 代理

关于如何在WindowsNT系统上安装SNMP代理,可参见在Windows系统中安装SNMP代理。

在 Windows NT 系统中配置SNMP 代理的步骤如下:

右击桌面上的网上邻居图标。

点击属性。

点击服务。

点击 SNMP 服务,然后点击属性。

点击安全分页按钮。

要想为错误的验证发送陷阱,请选择发送验证陷阱复选框。

在接收的团体名称下点击添加。

在团体名称框中,输入共同体名称(从该团体接收请求)。

点击添加,将该名称移入接收的团体名称列表中。

重复第 9 步添加任何团体名称。

点击以下选项之一,指定是从任何主机接收 SNMP 数据包,还是仅从指定的主机接收SNMP 数据包:

如果不依据源计算机 ID 来拒绝 SNMP 数据包,可选择接收来自任何主机的 SNMP 数据包。

如果仅从列出的计算机接收SNMP 数据包,请选择仅接收来自这些主机的SNMP 数据包。 要想指定特定的主机,请点击添加,在IP 主机或IPX 地址框中输入主机的名称和地址(从该主机接收请求),然后点击添加,将该名称移入仅接收来自这些主机的SNMP 数据包列表。

重复第 11 步添加任何主机。

在代理分页中指定适当的信息(如有关用户位置和服务的注释)。

点击确定。

配置 SNMP 陷阱的步骤如下:

右击桌面上的网上邻居图标。

点击属性。

点击服务。

点击 SNMP 服务,然后点击属性。

点击陷阱分页按钮。

在团体名称框中输入名称,以识别您想要该计算机将陷阱发送到的每个团体。团体名称是区分大小写的。

输入每个名称后,点击添加,将这些名称添加到列表。

添加了团体之后,在其仍是高亮时,点击陷阱目标下的添加,为陷阱要发送到的每个团体指定主机。

在IP主机/地址或IPX地址框中输入主机名,然后点击添加,为所选团体将名称和地址移入陷阱目标列表。

重复第10步,添加任何主机。

点击确定。

在 Linux 8.0以前的版本配置代理

关于如何在Linux系统上安装SNMP代理,可参见 在Linux系统中安装SNMP代理。

如果代理已运行,请使用以下命令将其停止:
/etc/rc.d/init.d/snmpd stop

在/etc/rc.d/init.d/snmpd 文件中做以下修改:


daemon /usr/sbin/snmpd $OPTIONS
改为
daemon /root/ucd_agent/sbin/snmpd $OPTIONS


killproc /usr/sbin/snmpd
改为
killproc /root/ucd_agent/sbin/snmpd

这是用于在启动和停止SNMP 代理时选择当前安装的版本。

使用命令 /etc/rc.d/init.d/snmpd start来启动代理。

在 Linux 8.0版本及8.0 以上版本配置代理

在Linux 8.0版本及8.0 以上版本,可以使用 SNMP 的最新版本,只需在 snmpd.conf 文件中做以下修改:


# name incl/excl subtree mask(optional)
行后插入
view allview included .1.3.6


# group context sec.modelsec.level prefix read write notif
以后的行
lineaccess notConfigGroup “” any noauth exact systemview none none
改为
access notConfigGroup “” any noauth exact allview none none

然后使用以下命令重启 snmp 代理:
/etc/rc.d/init.d/snmpd restart


在 Solaris 机器中配置代理

关于如何在Windows系统上安装SNMP代理,可参见在Solaris系统中安装SNMP代理。

如果代理已运行,请使用以下命令将其停止:
/etc/init.d/init.snmpdx stop

在/etc/init.d/init.snmpdx 文件中做以下修改:

将 if [ -f /etc/snmp/conf/snmpdx.rsrc -a -x /usr/lib/snmp/snmpdx ]; then
/usr/lib/snmp/snmpdx -y -c /etc/snmp/conf -d 3 -f 0
fi

改为
/sbin/snmpd

将 /usr/bin/pkill -9 -x -u 0 ‘(snmpdx|snmpv2d|mibiisa)’

改为
/usr/bin/pkill -9 -x -u 0 ‘(snmpd)’

使用命令 /etc/init.d/init.snmpdx start 重启代理。

No responses yet

Next »

Close
E-mail It