寻觅生命中的那一片浅草......

每月存档 十一月, 2009

redhat的rpc.statd服务

共享和加载NFS文件系统需要什么服务?
解决方法:红帽企业Linux使用核心级的支持和守护进程的组合来提供NFS文件共享.NFS依靠远程过程调用(RPC)在客户端和服务器端路由请求。在Linux下RPC服务由portmap服务控制.

为了共享和加载NFS文件系统,下面的服务要一起工作:

* nfs – 启动相应RPC服务进程来服务对于NFS文件系统的请求.
* nfslock – 一个可选的服务,用于启动相应的RPC进程,允许NFS客户端在服务器上对文件加锁.
* portmap – Linux的RPC服务,它响应RPC服务的请求和与请求的RPC服务建立连接.

下面的RPC进程在后台一起工作服务于NFS服务:

* rpc.mountd – 这个进程接受来自NFS客户端的加载请求和验证请求的文件系统正在被输出.这个进程由NFS服务自动启动,不需要用户的配置.

* rpc.nfsd – 这个进程是NFS服务器.它和Linux核心一起工作来满足NFS客户端的动态需求,例如提供为每个NFS客户端的每次请求服务器线程.这个进程对应于nfs服务.

* rpc.lockd – 一个可选的进程,它允许NFS客户端在服务器上对文件加锁.这个进程对应于nfslock服务.

* rpc.statd – 这个进程实现了网络状态监控(NSM)RPC协议,通知NFS客户端什么时候一个NFS服务器非正常重启动.这个进程被nfslock服务自动启动,不需要用户的配置.

* rpc.rquotad – 这个进程对于远程用户提供用户配额信息. 这个进程被nfs服务自动启动,不需要用户的配置.

停用命令

service nfslock stop

chkconfig nfslock off

rpcbind服务停止命令

service portmap stop

转载自:http://falchion.javaeye.com/blog/400132

rsync error: error in rsync protocol data stream

今天去检查备份文件,发现有台服务器的文件没有同步过来
手动同步一下,报以下错误

rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(359)

试过以下方法,都不可以
重启rsync
重装rsync
查看rsync的密码文件,没有错

最后服务器上看
netstat -tlnp
发现监听873端口的变成了rpc.statd,而不是rsync
tcp        0      0 0.0.0.0:873                 0.0.0.0:*                   LISTEN      3659/rpc.statd

晚上搜索了,知道这是nfslock的进程,马上
service portmap stop
service nfs stop
service nfslock stop

chkconfig –level 2345 portmap off
chkconfig –level 2345 nfslock off
chkconfig –level 2345 nfs off

再开启
/usr/local/bin/rsync –daemon

此时同步,终于成功了

CentOS5.3_64位编译PHP出错

64位的系统给php添加curl的时候,
cd /usr/local/src/php-5.2.6/ext/curl/
/usr/local/php-fcgi/bin/phpize
./configure –with-php-config=/usr/local/php-fcgi/bin/php-config
居然出现一下错误!
checking for gnutls support in libcurl… no
checking for curl_easy_perform in -lcurl… no
configure: error: There is something wrong. Please check config.log for more information.

我赶紧检查有没有装curl的devel
rpm -qa |grep curl

全都有!
查了半天资料, 还是找到结果了, 只要以下包都安装了, 就可以完美通过!
curl-devel-7.15.5-2.el5
e2fsprogs-devel-1.39-15.el5
krb5-devel-1.6.1-25.el5
libidn-devel-0.6.5-1.1
openssl-devel-0.9.8b-10.el5
至于每个包的作用, 自己去查吧! 呵呵

转载自:

http://www.linuxquestions.org/questions/linux-software-2/install-php-on-a-64bit-centos-problem.-help.-673530/

SysAdmin to SysAdmin:bring out your inner xargs

xargs is your friend. Using xargs, you can pull off feats of greatness and not have to write a script to do it. xargs can take care of things right on the command line. Though I focus mainly on files in this article (it’s what I use it for almost exclusively), it’s important to remember that xargs acts on standard input, which could mean lines redirected from /var/log/messages or urls or whatever else you can manage to point in its direction.

One of the things I use xargs for in the course of my work is package management. My department standardized on Red Hat for all Linux boxes, which means I use RPM a lot. Sometimes, though, RPM isn’t the most wonderful tool in the world to deal with. One thing that makes RPM nice, though, is that it can take flags, file arguments and options in any order (for the things I’m using it for anyway). Let’s look at an example scenario you can use even if you’re not working with centralized software management in a mid-size network:

I’m a huge fan of Galeon. Back when they released 1.0.2, I had to have it. Unfortunately, my Ximian installation put packages tagged with their name on my system, and the Galeon RPM didn’t recognize them, which created dependency errors. <whine> “I can’t find mozilla-0.9.7″</whine>.

Having had some issues on my workstation at the office (it works fine on two other machines), I decided to uninstall any trace of Mozilla, and get standard Mozilla packages. But I don’t have a lot of time to do this stuff, so here’s what I did:

$ > rpm -qa | grep mozilla | xargs -n1 -p rpm -e –nodeps

What this says in English, is “Using RPM, query all (-qa) packages, look for mozilla in the package name, and send the results one at a time (-n1), to RPM’s uninstall command, and I don’t care about dependencies, thank you very much (“rpm -e –nodeps”). Also, in case there’s something that contains the word “mozilla” that I DON’T want erased, prompt me (-p) before uninstalling.”

The above command saves you from having to manually list the packages containing the string “mozilla,” then manually running separate “rpm -e” commands against them one at a time.

How about something REALLY useful! I rip CDs constantly using grip. Inevitably, I’ll reinstall and forget to not format the /mp3 partition, or I’ll upgrade grip and forget to change the directories it uses to store stuff… whatever. Eventually, I have MP3s all over my hard drive. What I do then is this:

$ > find / -name *.mp3 -type f -print | xargs tar -cvzf mp3z.tar.gz

This finds all the mp3z on my entire drive and puts ’em all in a tar file, and then I can untar them wherever I want :) I actually could’ve piped that xargs “tar” line into a “tar xvzf” line to automatically untar them. I also could’ve left out the “-type f” if I had grip set up to use a custom directory structure that I wanted to preserve. You get the idea :) PS – this works for other types of files, too, like finding all the files that belong to you, tarring them and sending the tar to a backup somewhere, so it does have legitimate use.

Ok, so this is good for stuff that takes the file name or other argument as the last thing on the line – but what about things like “cp,” that take an argument, and then another piece of input like a directory to copy to or a file to copy over or something? That’s where the ‘-i’ flag comes in. This flag allows you to specify some string that will then be replaced with the arguments you send to xargs in place. Expanding on the “cp” example:

$> ls *.mp3 | xargs -n1 -i cp {} backup/.

This command takes all of the MP3 files in the current directory, and feeds them one at a time (-n1) to the cp command, where the file argument coming in from ls will replace the curly braces. Notice I didn’t specify a string with “-i.” I don’t think I’ve ever had to. The default string that xargs will look to replace when using the -i flag is the curly braces.

As your command lines get a little more complex, or you start using xargs in scripts, there are a couple of useful troubleshooting flags you may find helpful if you run into issues. One, the -p flag, will prompt you for a yes or no before executing a command on anything. The other, which is a real life saver, is “-t,” and it does NOT prompt you for a yes or no (unless you use it with -p), but it will output the command it’s trying to execute, so if something isn’t quite right, you’ll be able to spot it right away.

转载自:http://www.linux.com/archive/feature/113662

傻瓜式搭建Nginx+PHP+Mysql服务器

1.下载 一键安装包LNMP

wget http://licess.googlecode.com/files/LNMP.zip

2. 64位机器

yum -y install libjpeg-devel

yum -y install libpng-devel

3.

unzip LNMP.zip

cd LNMP

chmod +x install.sh down.sh

./down.sh
./install.sh

4.安装Google的TCMalloc库
64位系统安装libunwind库

wget http://download.savannah.gnu.org … d-0.99-alpha.tar.gz
tar zxvf libunwind-0.99-alpha.tar.gz
cd libunwind-0.99-alpha/
CFLAGS=-fPIC ./configure
make CFLAGS=-fPIC
make CFLAGS=-fPIC install

wget http://google-perftools.googleco … erftools-1.1.tar.gz
tar zxvf google-perftools-1.1.tar.gz
cd google-perftools-1.1/
./configure
make && make install

echo “/usr/local/lib” > /etc/ld.so.conf.d/usr_local_lib.conf
/sbin/ldconfig

vi /usr/local/mysql/bin/mysqld_safe

在# executing mysqld_safe的下一行,加上:

代码:

export LD_PRELOAD=/usr/local/lib/libtcmalloc.so

保存后退出,然后重启MySQL服务器。

/etc/init.d/mysql restart

使用lsof命令查看tcmalloc是否起效:
代码:

/usr/sbin/lsof -n | grep tcmalloc

如果发现以下信息,说明tcmalloc已经起效:

mysqld 6074 mysql mem REG 8,3 1650572 11506841 /usr/local/lib/libtcmalloc.so.0.0.0

程序安装路径:
MySQL : /usr/local/mysql
PHP : /usr/local/php
Nginx : /usr/local/nginx
PHPMyAdmin /web/www/phpmyadmin
Web目录 /web/www

让Nginx开机后手动执行 /root/run.sh 后Nginx会运行 ,开机自动运行可以运行 LNMP目录下面的 startup.sh 文件即可。

转载自:http://www.mghost.cn/redirect.php?tid=1743&goto=lastpost

2009年十一月
« 10月   12月 »
 1
2345678
9101112131415
16171819202122
23242526272829
30