网上查到的:

解决办法可以升级glibc(可以安装比较新的linux版本),也可以试一下在你的/etc/hosts文件中添加一条主机记录(把你机器IP,完整域机器名或直接机器名加入)  

我自己解决方案:

在/etc/hosts  加入web连接机的ip解析和mysql本机的解析

我的是

192.168.0.139            192.168.0.139
192.168.0.140            192.168.0.140
Tags: , , , , , ,

Linux是老婆,Windows是妓女

[雪 2009/11/12 13:40 | by 井宿 ]

1.首先,linux是免费的,和老婆上床当然不用要钱,妓女和windows都是要money的啊。

2.linux入门比较难,就象你当初追你老婆的那些日子,痛并快乐着。windows?傻子都会用,就象妓女,给钱就可以了,即使你阳痿她还可以用嘴哦,当然你得多付钱才可以。

3.linux稳定,几乎不会传染病毒给你,windows么?还要带安全套--防毒软件才可以。

4.虽然linux可以帮你完成绝大部分事情,但偶尔你想happy一下的时候还得找windows。linux下的游戏似乎差一些,就象你偶尔想找点儿刺激的话,只好花钱找小姐了。 如果你实在不愿意找小姐,又想享受刺激的话可以用wine,酒精会让你老婆更激情,但感觉似乎还是不如职业小姐。让你老婆喝这么多酒也不是一件容易的事,wine的配置很麻烦哦。

5.一些新奇硬件软件都是最先支持windows的,但如果真的是好东东的话,最终linux也会支持。世面上比较新的器械和流行的体位都是妓女们的卖点,随着时代的发展,夫妻之间也会慢慢接受这些的。
Tags: , , ,

xen使用中遇到2个小问题

[多云 2009/09/24 11:00 | by 井宿 ]
1、我的xen运行在centos5.2上,已经可以安装vm了,但是安装5,6台后,就开始出现下面的错误信息:
       Failed to find an unused loop device
       很明显,因为使用的文件的方式,而不是分区的方式,loop设备已经不够了,loop设备默认是8个,可以lsmod|grep loop查看加载的模块,可以通过ls /dev/loop*查看loop块设备,这个是可以增加的,可以使用如下命令增加为16个:

rmmod loop
modprobe loop max_loop=16

如果需要开机自动加载loop模块并创建16个设备,可以修改/etc/modprobe.conf,增加一行:options loop max_loop=16,重启服务器,就可以看到生成16个loop了
       另外,据说mknod可以创建块设备或者字符设备,mknod -m660 /dev/loop b 7 8,但是我尝试使用这个设备的时候,可能哪里有点问题。

2、安装了8个vm以后,启动vm,但是总是有2个没有反应,可以启动,但是虚拟终端只显示:Console is not yet active for guest,cpu占用为0,而且还无法关闭,只能destroy掉。查看日志,发现如下线索:

domid: 23
qemu: the number of cpus is 2
Watching /local/domain/23/logdirty/next-active
xs_read(): vncpasswd get error. /vm/14c1d5ec-5473-7cd0-4732-d0ef810f98d5/vncpasswd.
bind() failed

于是,坚信我不是遇到这个问题的第一人,搜索,发现了http://www.firmotech.com/l...,是这么说的:

Auteur: Artur Linhart - Linux communication
Date:  2008-06-21 18:48  +800
À: 'Michael Jinks', xen-users
Sujet: RE: solved, Re: [Xen-users] Windows domU doesn't boot

Hello,

   I had the same problem. But I do not think, this is related to the
serial='pty'
setting... In my case this line was remmed out in the configuration, but the
error
bind() failed
was till there...

The real problem is (at least in my case was) in the specification of
"vnclisten" parameter - this specifies the address where the machine should
"hear" to incomig VNC connections for management of the HVM hosts. If there
is specified an invalid address, then the vnc "server" for that virtual
instance cannot be started, because there fails the bind of the service to
the specified port on specified address.

This is also consistent with the fact the qemu-dm starts, but then
everything stops and the TCP post is not allocated, what can be seen if
running
netstat -a -n

Michael, is it possible in Your case this was the same and You not only
remmed-out the "serial" oto, bu also repaired the IP address specified in
vnclisten parameter?

也就是说,是绑定vnc失败导致的问题,于是调整了vm的显示设备,果然一切正常了。
Tags:

实战mysql的安装与复制

[不指定 2009/09/13 00:11 | by 井宿 ]
当前已经有一台linux(均为redhat)服务器,ip10.1.3.106运行mysql4.1.9,现在需要构建一个mysql的复制系统,当前的106作为主服务器,另外需要搭建一台复制服务器做从服务器.新服务器的ip为10.1.3.107

1.安装mysql
安装包为mysql-4.1.9.tar.gz(为了保证兼容性,采用的是与106相同的安装包)
按照安装文档的方法,按照如下顺序进行安装
The basic commands you must execute to install a MySQL source
distribution are:
增加用户
    shell> groupadd mysql
    shell> useradd -g mysql mysql
    shell> tar –zxvf mysql-4.1.9.tar.gz
    shell> cd mysql-4.1.9
编译安装,安装路径为/usr/local/mysql
    shell> ./configure --prefix=/usr/local/mysql
    shell> make
    shell> make install
    shell> cp support-files/my-medium.cnf /etc/my.cnf
    shell> cd /usr/local/mysql
安装初始的表
    shell> bin/mysql_install_db --user=mysql
信息如下
[root@localhost mysql]# bin/mysql_install_db --user=mysql
Installing all prepared tables
Fill help tables

To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/mysql/bin/mysqladmin -u root password 'new-password'
/usr/local/mysql/bin/mysqladmin -u root -h 机器名 password 'new-password'
See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr/local/mysql ; /usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/local/mysql/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
更改权限
    shell> chown -R root  .
    shell> chown -R mysql var
    shell> chgrp -R mysql .
启动服务
    shell> bin/mysqld_safe --user=mysql &  
信息如下
[root@localhost mysql]# bin/mysqld_safe --user=mysql &
[1] 25772
[root@localhost mysql]# Starting mysqld daemon with databases from /usr/local/mysql/var

修改MYSQL密码,默认安装密码为空,为了安全你必须马上为root设置密码例如设为abc
/usr/local/mysql/bin/mysqladmin -u root password abc

通过命令行登陆
/usr/local/mysql/bin/mysql –uroot –p
按提示输入密码即可

让它随系统启动时自动启动,在/etc/rc.d/rc.local中加入以下一行
/usr/local/mysql/bin/mysqld_safe --user=mysql &

停止mysql
/usr/local/mysql/bin/mysqladmin -uroot -p shutdown
按提示输入密码即可

这样mysql的安装就完成了.


2.配置复制
我按照我之前那篇文章配置好了之后,在从上面查看mysql> show slave status\G发现Slave_IO_State:这一项的内容一直都是connecting.在主上面查看root的权限,发现只能从本机登陆.为了安全起见,在主上面建了一个专门用于复制的账户允许它远程登陆
mysql > GRANT FILE,SELECT,REPLICATION SLAVE ON *.* TO 'repl'@'%' IDENTIFIED BY 'slavepass';
可是问题变得更加严重,在从上面查看复制状态
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 10.1.3.106
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: ifi-db01-bin.000019
Read_Master_Log_Pos: 4653237
Relay_Log_File: ifi-db02-relay-bin.000006
Relay_Log_Pos: 10072
Relay_Master_Log_File: ifi-db01-bin.000019
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB:
      …..
可以看到IO进程并没有运行,查看进程列表.(准确的说应该是线程,此处为了方便理解写为进程)
mysql> show processlist\G
*************************** 1. row ***************************
    Id: 2
  User: system user
  Host:
    db: NULL
Command: Connect
  Time: 14
 State: Has read all relay log; waiting for the slave I/O thread to update it
  Info: NULL
*************************** 2. row ***************************
    Id: 8
  User: root
  Host: localhost
    db: NULL
Command: Query
  Time: 0
 State: NULL
  Info: show processlist
3 rows in set (0.00 sec)
也并没有I/0进程.
通过查看文档的FAQ,上面说要看MYSQL的错误日志.即数据目录下的"机器名.err"文件
[root@localhost var]# less xxx.err
070806  2:19:12 [Note] Slave I/O thread: connected to master 'repl@10.1.3.106:3306',  replication started in log 'ifi-db01-bi
n.000019' at position 4540467
070806  2:19:12 [ERROR] While trying to obtain the list of slaves from the master '10.1.3.106:3306', user 'repl' got the foll
owing error: 'Access denied; you need the REPLICATION SLAVE privilege for this operation'
070806  2:19:12 [ERROR] Slave I/O thread exiting, read up to log 'ifi-db01-bin.000019', position 4540467
可见是repl用户的权限不足.明明增加了权限为什么还报这样的错误??刷新权限!!
在主上面执行
mysql > FLUSH PRIVILEGES;
然后在从上面执行
mysql > STOP SLAVE;
等一会让它完全停止
mysql > CHANGE MASTER TO
->MASTER_HOST='10.1.3.106',
->MASTER_USER='repl',
->MASTER_PASSWORD='slavepass',
->MASTER_LOG_FILE='ifi-db01-bin.000019',
->MASTER_LOG_POS=4540467;
启动复制
mysql > START SLAVE

这样就正常了,查看它们的信息如下
主上面的
mysql > SHOW PROCESSLIST\G
*************************** 22. row ***************************
    Id: 4274
  User: repl
  Host: 10.1.3.107:32770
    db: NULL
Command: Binlog Dump
  Time: 1629
 State: Has sent all binlog to slave; waiting for binlog to be updated
  Info: NULL
22 rows in set (0.00 sec)

从上面的
[root@ifi-db02 var]# less xxx.err
070806  3:28:51 [Note] Slave SQL thread initialized, starting replication in log 'ifi-db01-bin.000019' at position 4677741, r
elay log './ifi-db02-relay-bin.000006' position: 34576
070806  3:28:56 [Note] Slave I/O thread: connected to master 'repl@10.1.3.106:3306',  replication started in log 'ifi-db01-bi
n.000019' at position 4677741
没有报错误了

mysql> show slave status\G
*************************** 1. row ***************************
            Slave_IO_State: Waiting for master to send event
               Master_Host: 10.1.3.106
               Master_User: repl
               Master_Port: 3306
             Connect_Retry: 60
           Master_Log_File: ifi-db01-bin.000019
       Read_Master_Log_Pos: 4677185
            Relay_Log_File: ifi-db02-relay-bin.000006
             Relay_Log_Pos: 34020
     Relay_Master_Log_File: ifi-db01-bin.000019
          Slave_IO_Running: Yes
         Slave_SQL_Running: Yes
           Replicate_Do_DB:
…..
mysql> show processlist\G
*************************** 1. row ***************************
    Id: 1
  User: system user
  Host:
    db: NULL
Command: Connect
  Time: 1709
 State: Waiting for master to send event
  Info: NULL
*************************** 2. row ***************************
    Id: 2
  User: system user
  Host:
    db: NULL
Command: Connect
  Time: 24
 State: Has read all relay log; waiting for the slave I/O thread to update it
  Info: NULL
*************************** 3. row ***************************
    Id: 33
  User: root
  Host: localhost
    db: NULL
Command: Query
  Time: 0
 State: NULL
  Info: show processlist
3 rows in set (0.00 sec)
可见所有进程都已经正常启动了.

windows下自动ftp脚本下载

[不指定 2009/09/10 13:17 | by 井宿 ]
从ftp定时下载按日期生成的文件

1、下载脚本get.bat如下

f:
cd f:/beifen (脚本所在目录)
set cicdate=%date:~0,4%%date:~5,2%%date:~8,2%
(echo open ftp地址
echo 用户名
echo 密码
echo prompt
echo get %cicdate%.txt
echo bye) > ftp_beifen.src

ftp -s:ftp_beifen.src
echo %date%导出数据库备份结束,时间:%time% >> getftp_beifen.log

2、在xp上定时自动运行批处理文件
  AT命令是Windows XP中内置的命令,它也可以媲美Windows中的“计划任务”,而且在计划的安排、任务的管理、工作事务的处理方面,
   AT命令具有更强大更神通的功能。AT命令可在指定时间和日期、在指定计算机上运行命令和程序。
   
   查看所有安排的计划   at
   取消已经安排的计划   at 5 /Delete
 
在dos下运行一下命令,系统就会在每天的16:46分自动运行批处理文件get.bat
net stop schedule
net start schedule
at 16:46 /every:Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday F:\beifen\get.bat
这天,白云酒楼里来了两位客人,一男一女,四十岁上下,穿着不俗,男的还拎着一个旅行包,看样子是一对出来旅游的夫妻。

服务员笑吟吟地送上菜单。男的接过菜单直接递女的,说:“你点吧,想吃什么点什么。”女的连看也不看一眼,抬头对服务员说:“给我们来碗馄饨就行了。”

服务员一怔,哪有到白云酒楼吃馄饨的?再说,酒楼里也没有馄饨卖啊。她以为自己没听清楚,不安的望着那个女顾客。女人又把自己的话重复了一遍,旁边的男人这时候发话了:“吃什么馄饨,又不是没钱。”

女人摇摇头说:“我就是要吃馄饨!”男人愣了愣,看到服务员惊讶的目光,很难为情地说:“好吧。请给我们来两碗馄饨。”

“不!”女人赶紧补充道,“只要一碗!”男人又一怔,一碗怎么吃?女人看男人皱起了眉头,就说:“你不是答应的,一路上都听我的吗?”

男人不吭声了,抱着手靠在椅子上。旁边的服务员露着了一丝鄙夷的笑意,心想:这女人抠门抠到家了。上酒楼光吃馄饨不说,两个人还只要一碗。她冲女人撇了撇嘴:“对不起,我们这里没有馄饨卖,两位想吃还是到外面大排挡去吧!”

女人一听,感到很意外,想了想才说:“怎么会没有馄饨卖呢?你是嫌生意小不愿做吧?” 这会儿,酒楼老板张先锋恰好经过,他听到女人的话,便冲服务员招招手,服务员走过去埋怨道:“老板,你看这两个人,上这只点馄饨吃,这不是存心捣乱吗?”

无题

[不指定 2009/09/03 14:38 | by 井宿 ]
看了看第一个网恋女友的blog ,她孩子今年估计都快该上小学了吧, 正在操心买房子的事情, 看了看我就烦了

房子,房子,妈的, 小时候从来不操心的事情,长大后也不想操心的事情,没想到最后还是得操心,然后随之而来的是无尽的后续一想起来就满脑子大便的事情

工作也越来越无聊了, 公司的业务基本上和系统没有什么太大的关系, 我操我又开始混了.

cnet mysql php apache 安装文档

[不指定 2009/09/01 15:05 | by 井宿 ]
groupadd mysql
useradd -d /export/home/db/mysql -g mysql mysql
解压mysql
tar zxvf mysql-max-5.0.18-linux-i686.tar.gz
mv mysql-max-5.0.18-linux-i686/* /export/home/db/mysql
cd /export/home/db/mysql
cp support-files/my-large.cnf /etc/my.cnf
vi /etc/my.cnf
加入datadir = /export/home/db/mysql/var
scripts/mysql_install_db
cd /export/home/db
chown -R mysql.mysql mysql
cd mysql
./bin/mysqld_safe &
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
chkconfig --add mysqld
service mysqld start
解压apache2
./configure --prefix=/export/home/cms/servers/apache2 --enable-so --enable-modules=all \
--enable-mods-shared=all  --with-config-file-path=/export/home/cms/servers/apache2/conf

####--with-mpm=worker

xen在centos5上发现一个bug

[晴 2009/09/01 15:03 | by 井宿 ]
在centos5上使用xen开虚拟机,开始运行还一切正常,但是当进行大量的下载的时候,就会出现当机的情况,而且会报
xen_net: Memory squeeze in netback driver (32bit PAE)

在网上找到的原因好像是xen的net driver的原因,解决方法如下

1. In your grub.conf (or other bootloader) set the Dom0 to a fixed size: dom0_mem=1024.

2. In /etc/xen/xend-config.sxp set dom0-min-mem to the same size as above.

目前测试一切恢复了正常。
Tags: ,

::XEN and Bonded Interfaces::  

[不指定 2009/08/28 01:33 | by 井宿 ]

This is a howto make bonded interfaces available from the hostos to the guest os.  You will need to create your two bonded device ( as usual ) then create a script in /etc/xen/scripts eg : mynetwork
  #!/bin/sh
  dir=$(dirname "$0")
  "$dir/network-bridge" "$@" vifnum=0 netdev=bond0
  "$dir/network-bridge" "$@" vifnum=1 netdev=bond1

Make sure to make the script executable
  chmod +x /etc/xen/scripts/mynetwork

You will also need to modify the /etc/xen/xend-config.sxp, look for the line :
  (network-script network-bridge)

  modify it to be
  (network-script mynetwork)

Restart network / restart xend / restart xen network ( or reboot )
  service network restart
  service xend restart
  /etc/xen/scripts/mynetwork stop
  /etc/xen/scripts/mynetwork start

To check that everything is working
[root@uscobrmfa-lt-99 scripts]# brctl show
bridge name     bridge id               STP enabled     interfaces
xenbr0          8000.feffffffffff       no              vif1.0
                                                       pbond0
                                                       vif0.0
xenbr1          8000.feffffffffff       no              vif1.1
                                                       pbond1
                                                       vif0.1
Tags: ,
分页: 9/114 第一页 上页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下页 最后页 [ 显示模式: 摘要 | 列表 ]