Solaris10 x86下安装memcached

Posted on 2008-09-18 19:07 puras 阅读(1391) 评论(1)  编辑  收藏 所属分类: Other
项目中需要用到Memcached,前期的测试,都是在Win上做的.而我们的服务器却是Solaris的.为了测试在Solaris上的性能.则需要在服务器上安装Memcached.因为之前没有弄过这个东西,所以安装的过程也遇到了很多的问题.
    
还好在Solaris下,有一个专门的工具Cool Stack,它是一个Apache,PHP,MySql的简易安装包.现在的版本是1.3.1.很庆幸,在这个安装包中,同样也包含Memcached.

http://cooltools.sunsource.net/coolstack/下载Cool Stack的运行环境和Memcached的安装包.
分别是:CSKruntime_1.3.1_i386.pkg.bz2和CSKmemcached_1.3.1_i386.pkg.bz2.
下载后上传到Solaris上.
之后进行解压.
bunzip2 CSKruntime_1.3.1_i386.pkg.bz2
bunzip2 CSKmemcached_1.3.1_i386.pkg.bz2
解压后,
使用Root账号登录.
之后使用pkgadd来安装两个包,记住要加-d.
pkgadd -d CSKruntime_1.3.1_i386.pkg
pkgadd -d CSKmemcached_1.3.1_i386.pkg

很容易的就安装成功了.

之后进入到目录:/opt/coolstack/bin中.
你就会看到目录里有一个memcached了.

执行./memcached -h
如果你能看到像下面的内容一样,就证明你安装成功了.
 1memcached 1.2.5
 2-<num>      TCP port number to listen on (default: 11211)
 3-<num>      UDP port number to listen on (default: 0, off)
 4-<file>     unix socket path to listen on (disables network support)
 5-<mask>     access mask for unix socket, in octal (default 0700)
 6-<ip_addr>  interface to listen on, default is INDRR_ANY
 7-d            run as a daemon
 8-r            maximize core file limit
 9-<username> assume identity of <username> (only when run as root)
10-<num>      max memory to use for items in megabytes, default is 64 MB
11-M            return error on memory exhausted (rather than removing items)
12-<num>      max simultaneous connections, default is 1024
13-k            lock down all paged memory.  Note that there is a
14              limit on how much memory you may lock.  Trying to
15              allocate more than that would fail, so be sure you
16              set the limit correctly for the user you started
17              the daemon with (not for -<username> user;
18              under sh this is done with 'ulimit -S -l NUM_KB').
19-v            verbose (print errors/warnings while in event loop)
20-vv           very verbose (also print client commands/reponses)
21-h            print this help and exit
22-i            print memcached and libevent license
23-b            run a managed instanced (mnemonic: buckets)
24-<file>     save PID in <file>, only used with -d option
25-<factor>   chunk size growth factor, default 1.25
26-<bytes>    minimum space allocated for key+value+flags, default 48
27-L            Try to use large memory pages (if available). Increasing
28              the memory page size could reduce the number of TLB misses
29              and improve the performance. In order to get large pages
30              from the OS, memcached will allocate the total item-cache
31              in one large chunk.
32-<num>      number of threads to use, default 4

哈.现在你可以将Memcached启动起来进行测试啦.

./memcached -d -m 2048 -l 10.10.13.240 -P 11211   

关于Memcached的使用.网上有很多教程.
可以参见.

PS:这两天被这个问题给郁闷坏了.
新装的Solaris服务器.
要安装Memcached,首先要安装libevent.
网上提供的都是需要自己编译,安装的.
这就需要在系统中安装gcc和make.
装这两个东西倒没有什么问题.
可是在安装libevent的时候,遇到了好多的问题.
做C的同事也帮着弄了好久,才勉强将它安装上,其间还改了源代码....
可是Memcached却始终提示找不到libevent.
无论你是否指定libevent的路径.都不行.
我在自己的Ubuntu上装了一下,一点问题也没有.
快要放弃的时候,在Sun的网站上看到了可以使用Cool Stack来安装Memcached.
才让自己看了希望.

还好,功夫不负有心人.
现在已经开始进行Memcached的测试了.

终于把这个狗屎问题解决了.

Feedback

# re: Solaris10 x86下安装memcached  回复  更多评论   

2009-10-09 15:30 by 元石
您好!我也通过CSKmemcached安装的 memcache ,请问安装过后还需要修改php.ini文件吗,我直接安装完过后任然无法使用

只有注册用户登录后才能发表评论。


网站导航:
 

posts - 47, comments - 124, trackbacks - 0, articles - 0

Copyright © puras