| Subcribe via RSS

几个linux集群节点的辅助管理工具

8月 14th, 2008 | 3 Comments | Posted in 新知
集群节点监控: Ganglia

Ganglia is a scalable distributed monitoring system for high-performance computing systems such as clusters and Grids. It is based on a hierarchical design targeted at federations of clusters. Uses multicast and/or unicast to inject xml data into an rrdtool frontend. Makes it very easy to make custom graphs as it was originally written to handle stats data from HPC clusters http://ganglia.sourceforge.net/
SystemImager

节点统一自动安装部署: SystemImager

SystemImager is software which automates Linux installs, software distribution, and production deployment. SystemImager is a part of System Installation Suite. SystemImager makes it easy to do automated installs (clones), software distribution, content or data distribution, configuration changes, and operating system updates to your network of Linux machines. You can even update from one Linux release version to another! It can also be used to ensure safe production deployments. By saving your current production image before updating to your new production image, you have a highly reliable contingency mechanism. If the new production enviroment is found to be flawed, simply roll-back to the last production image with a simple update command! Some typical environments include: Internet server farms, database server farms, high performance clusters, computer labs, and corporate desktop environments. http://systemimager.org

使用subversion集中管理配置文件版本:ubcon

Subcon allows you to store your essential system configuration files in a subversion repository and easily deploy different configurations to machines in a cluster. It also features optional integration with SystemImager, enabling the deployment of system images and configuration in a single step. A flexible configuration file provides the ability to start, stop, or restart services or run arbitrary scripts when a change in a file or set of files is detected. http://code.google.com/p/subcon/

相关文章:
Tags: , ,

在CentOs中安装Memcached

7月 27th, 2008 | No Comments | Posted in 心得
准备安装:

需要先安装gcc,libevent

yum install gcc wget http://monkey.org/~provos/libevent-1.4.4-stable.tar.gz tar xvzf libevent-1.4.4-stable.tar.gz cd libevent-1.4.4-stable ./configure –prefix=/usr/local/libevent make make install

编译安装:

./configure –prefix=/usr/local/memcached –build=i686-pc-linux-gnu \ –with-libevent=/usr/local/libevent make make install

启动:

$ /usr/local/memcached/bin/memcached -p 11211 -m 64m -d -u root

 

使用memcached -h可以查看所有可用选项:

  • 选项     说明-p     使用的TCP端口。默认为11211

    -m     最大内存大小。默认为64M

    -vv     用very vrebose模式启动,调试信息和错误输出到控制台

    -d     作为daemon在后台启动

  • -u     运行Memcache的用户,默认不能用root启动,所以当前用户为root用户时,需要用-u参数来指定。
  • -l       监听的服务器的ip
  • -c      最大并发连接数,默认为1024
  • -P     指定pid文件
常见问题:

1. 编译memcached时出现下面错误:

./configure checking build system type… Invalid configuration `i686-pc-linux-’: machine `i686-pc-linux‘ not recognized configure: error: /bin/sh ./config.sub i686-pc-linux- failed

解决方法:

在./configure 时加入参数–build=i686-pc-linux-gnu

2.启动时找不到libevent库

memcached: error while loading shared libraries: libevent-1.3c.so.1: cannot open shared object file: No such file or directory 

解决办法:

将libevent库所在路径加入LIBRARY_PATH,在/etc/profile中加入

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/libevent/lib
相关文章:
Tags: , , ,

使用Groovy自动生成网站

10月 21st, 2007 | No Comments | Posted in 心得

周末忽然心血来潮,决定重建一下bestunix,为了不再出安全问题,这次决定完全使用静态页面。

基本思路是这样的:

  1. 使用crontab定期从space上面下载feed.rss
  2. 使用groovy脚本解析feed.rss,生成静态页面
  3. 每次生成的页面覆盖以前的页面。

看起来很简单,但是因为以前没有用过groovy,而且groovy又没有好的ide工具,完全使用ultraEdit来做的,大概花了一天半时间。

基本上写程序半天,做页面半天,配置服务器半天(jdk,groovy,apache)。

通过这个小东西,基本上理解groovy的闭包了,另外对groovy的优点也有了进一步认识,进行io操作非常方便,语法习惯了以后写起来也很爽,虽然使用ultraEdit,但因为基本上没有重复的代码,ide生成代码的功能也显得不那么重要。缺点也很明显,没有好用的ide,调试程序非常麻烦,比js难调多了。另外就是性能太差,慢得要死,当工具来使还行,大项目上这东西还是不敢用。

做页面本身不是我的长项,花半天也是可以理解的。

配置服务器之所以要这么长时间,主要是因为编码的问题。通过iconv转换程序代码,设置apache默认编码等若干次尝试后,终于不再出乱码了。另外一个要注意的地方是groovy在linux下必须设置classpath,否则会找不到类。

现在设好以后,每次我在msn space上写了东西,bestunix上就会生成相应的静态页面了,呵呵,还是很有成就感的。

10月22日更新:

今天整理了一下程序,主要做了下面几点

  1. 程序功能分工更清晰,文件由原来的两个急剧增加到6个
  2. 增加了配置文件,适应性更好
  3. 程序和模板,生成的网站可以分离了
  4. 增加了RSS输出
  5. 增加了自动生成sitemap
  6. 修改了原来日期显示的问题

今天用了一下groovy的eclipse插件,还不错,有部分的代码自动完成功能和部分的语法检查,可以进行很简单的调试。另外一个感觉就是非常慢。

11月6日更新

  1. 重构了代码,使功能分工更清晰
  2. 增加了一个DataFactory,所有磁盘资源都只需要读取一次,减少了因为重复读取数据造成的性能问题
  3. 增加了tag的功能,使得导航更方便
  4. 解决了非utf-8环境下测试的问题
  5. 其他地方的性能也做了一些优化
  6. 网页模板改用绝对链接,这样模板文件更容易管理
  7. 程序与模板,生成的完全分离,可以在Config中指定。

11月8日更新

  1. 增加了taglist页

11月11日更新

  1. 增加了站内搜索,使用google ajax api,折腾了半天,还算好用
  2. 对上面的一级栏目做了调整,不再放分类了
  3. 修改了rss中一个链接错误

11月12日更新

  1. 终于实现分页了,确实有点麻烦,自己写了个分页类。
  2. 对网站的整体样式做了一些调整,使用大字体了,这样看着不会那么费劲。
  3. 把源代码放到 google code 上了。

TODO:

  1. 合并rss.因为网站上的rss只输出最近的几十条。内容多了就会丢失以前的数据。需要写个程序来增量合并更新的内容。
  2. 自动生成对应的繁体中文网站
  3. 根据tag自动生成专题
  4. 生成pdf

相关文章:
Tags: ,