http://code.google.com/p/mogilefs/wiki/InstallHowTo
ps:
注意:安装过程中会遇到一些需要perl module在运行环境中未找到的,这时候可以利用CPAN追加,在cpan shell中用“i /XXX/”,查找到需要的module然后用“install XXX”,安装module。
如:安装AIO perl module
把MogileFS用于生产环境该支持是必须的,否则MogileFS只能运行在开发模式,性能差别很大。该特性需要perl 5.8.8以上版本的支持。
shell> perl -MCPAN -e shell
cpan>i /AIO/ (找到IO-AIO字样的分发包或者模块)
cpan>install M/ML/MLEHMANN/IO-AIO-3.261.tar.gz
ps: 在make test 是总是出错Can't locate DBD/mysql.pm in @INC
发现是数据库的驱动没装安装Perl访问Mysql的接口和驱动 DBD
使用CPAN安装DBI和DBD:
shell> unset LANG (若os的默认字符编码为UTF8,例如FCX)
shell> perl -MCPAN -e shell
cpan> install DBI
cpan> force install DBD::mysql (忽略make test结果,强行安装)
ps: 安装DBD时'imp_dbh_t' has no member named 'mysql'错误
mysql-devel 没装
yum install -y mysql-devel
ps:mysql.so' for module DBD::mysql: libmysqlclient.so.16
上面错误一看是找不到libmysqlclient.so.15 ,先find吧
# find /usr/ -name "libmysqlclient.so*"
/usr/local/mysql/lib/mysql/libmysqlclient.so.15.0.0
/usr/local/mysql/lib/mysql/libmysqlclient.so.15
/usr/local/mysql/lib/mysql/libmysqlclient.so
解决方法:
echo "/usr/local/mysql/lib/mysql/" >> /etc/ld.so.conf
ldconfig
完成
===========================================================
另外,最后发现一个比较简单的安装方法
#perl -MCPAN -e shell
cpan> i /mogilefs-server/
cpan>install ***
CPAN工具会自动解析安装依赖模块。
==================================================================
The database is empty and will need a schema applied. The 'trunk/server' directory has a utility named 'mogdbsetup' to make this process simple. By default it assumes the database is located on localhost, so if you are running it from a different host you will need to provide the host name on the command line.
# ./mogdbsetup --dbhost=mogiledb.yourdomain.com --dbname=mogilefs --dbuser=mogile --dbpassword=sekrit
出错:failed: Can't connect to local MySQL server through socket '/var/lib/mysql /mysql.sock' (2)
解决:在connect时用TCP socket不要用Unix socket咯。
把host=localhost改成host=127.0.0.1或者host=12.34.56.78(服务器的IP)
1. mysql -h 127.0.0.1 的时候,使用TCP/IP连接,
mysql server 认为该连接来自于127.0.0.1或者是"localhost.localdomain"
2. mysql -h localhost 的时候,是不使用TCP/IP连接的,而使用Unix socket;
此时,mysql server则认为该client是来自"localhost"
3. mysql权限管理中的"localhost"有特定含义:
—— MySQL手册 5.6.4 ..... A Host value may be a hostname or an IP number, or 'localhost' to indicate the local host.