急救模式安装手册

简介

首先,所有的蚂蚁蛋项目都需要安装在目录名为mydan下。如:/home/work/mydan。
如果仅是使用急救箱,可以不用单独编译perl。单独编译是在简单模式和全量模式中,以为需要在所有机器上方便的安装agent,才需要去编译。
在mac系统中perl的模块比较齐全,安装过程一般不会出现问题。在centos和ubuntu下安装会花一些时间使得模块都正常安装。

安装

以下以安装centos的/home/work/mydan目录下为例。安装在系统默认perl。
(如果系统中的perl版本太低,可能需要处理安装过程中的许多错误,可以直接下载编译好的perl,解压到mydan目录下,然后把下面perl相关的命令改成/home/work/mydan/perl/bin/perl)

mkdir -p /home/work/mydan
cd /home/work/mydan
git clone https://github.com/mydan/mayi.git
cd mayi
perl Makefile.PL
make
make install box=1 def=1

错误:
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 4.
BEGIN failed--compilation aborted at Makefile.PL line 4.

解决办法:
cd /tmp
wget https://cpan.metacpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.30.tar.gz
tar -zxvf ExtUtils-MakeMaker-7.30.tar.gz
cd ExtUtils-MakeMaker-7.30
perl Makefile.PL
make
make install
错误:
"/usr/bin/perl" "-Iblib/arch" "-Iblib/lib" INSTALL.PL INSTALL
Use of uninitialized value $cpan in -f at INSTALL.PL line 18.
no find cpan at INSTALL.PL line 18.
make: *** [INSTALL] Error 2

解决办法:
cd /tmp
wget https://cpan.metacpan.org/authors/id/A/AN/ANDK/CPAN-2.16.tar.gz
tar -zxvf CPAN-2.16.tar.gz
cd CPAN-2.16
perl Makefile.PL
make
make install
错误:
Warning: prerequisite Test::Simple 0.90 not found.
ExtUtils::MM_Unix::tool_xsubpp : Can't find xsubpp at /usr/share/perl5/ExtUtils/MM_Unix.pm line 3769.
Warning: No success on command[/usr/bin/perl Makefile.PL]    TIMB/DBI-1.636.tar.gz
   /usr/bin/perl Makefile.PL -- NOT OK
/usr/bin/cpan install DBI fail: at INSTALL.PL line 23.
make: *** [INSTALL] Error 1

解决办法:
yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

简单使用

修改 /home/work/mydan/etc/util/conf/pass 写入密码:

如:
10.10.10.1:
   mydan: "123456"

./vssh -r 10.10.12.12 -u nices #测试批量操作工具
./go 10.10.12.12 #测试密码应答登陆