perl 安装Rex

通过SSH 协议推送到被管理端执行,执行完之后自动删除:


(R)?ex 部署&配置管理:

自动化一切,随时放松:


在你的运行环境中无缝集成


容易使用和extend

容易学习,它只是一个简单的perl



Get Rex:

$ curl -L https://get.rexify.org | perl - --sudo -n Rex

node2:/root#cpanm XML::Simple
--> Working on XML::Simple

yum install rex

cpanm Rex

安装rex 

root@StorageServer1 ~]# cpanm Rex
--> Working on Rex
Fetching http://www.cpan.org/authors/id/F/FE/FERKI/Rex-1.3.3.tar.gz ... OK
==> Found dependencies: ExtUtils::MakeMaker
安装过程中它自己会解决模块相关的依赖关系,可能会有一些底层的库需要手动去安装,比如我在安装过程中就失败了

! Installing the dependencies failed: Module 'XML::LibXML' is not installed, Module 'XML::Simple' is not installed

! Bailing out the installation for Rex-1.3.3.

提示有个XML::LibXML相关的模块安装不成功,这个和它依赖的相关的底层xml库有关系,所以我将libxml相关的底层库都安装一下就行了。

[root@StorageServer1 ~]# yum install libxml*
然后再安装rex


Building and testing XML-Parser-2.44 ... FAIL
! Installing XML::Parser failed. See /root/.cpanm/work/1493002034.18958/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'XML::Parser' is not installed
! Bailing out the installation for XML-SAX-Expat-0.51.
! Installing the dependencies failed: Module 'XML::SAX::Expat' is not installed
! Bailing out the installation for XML-Simple-2.24.
! Installing the dependencies failed: Module 'XML::Simple' is not installed
! Bailing out the installation for Rex-1.5.0.



alias cpanm='cpanm  --mirror http://mirrors.163.com/cpan --mirror-only'


yum install *xml*


[root@node01 ~]# cpanm XML::Simple
--> Working on XML::Simple
Fetching http://mirrors.163.com/cpan/authors/id/G/GR/GRANTM/XML-Simple-2.24.tar.gz ... OK
Configuring XML-Simple-2.24 ... OK
==> Found dependencies: XML::SAX::Expat
--> Working on XML::SAX::Expat
Fetching http://mirrors.163.com/cpan/authors/id/B/BJ/BJOERN/XML-SAX-Expat-0.51.tar.gz ... OK
Configuring XML-SAX-Expat-0.51 ... OK
==> Found dependencies: XML::Parser
--> Working on XML::Parser
Fetching http://mirrors.163.com/cpan/authors/id/T/TO/TODDR/XML-Parser-2.44.tar.gz ... OK
Configuring XML-Parser-2.44 ... OK
Building and testing XML-Parser-2.44 ... FAIL
! Installing XML::Parser failed. See /root/.cpanm/work/1493002278.19380/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'XML::Parser' is not installed
! Bailing out the installation for XML-SAX-Expat-0.51.
! Installing the dependencies failed: Module 'XML::SAX::Expat' is not installed
! Bailing out the installation for XML-Simple-2.24.


[root@node01 ~]# yum install  *expat*

[root@node01 ~]# cpanm XML::Simple
--> Working on XML::Simple
Fetching http://mirrors.163.com/cpan/authors/id/G/GR/GRANTM/XML-Simple-2.24.tar.gz ... OK
Configuring XML-Simple-2.24 ... OK
==> Found dependencies: XML::SAX::Expat
--> Working on XML::SAX::Expat
Fetching http://mirrors.163.com/cpan/authors/id/B/BJ/BJOERN/XML-SAX-Expat-0.51.tar.gz ... OK
Configuring XML-SAX-Expat-0.51 ... OK
==> Found dependencies: XML::Parser
--> Working on XML::Parser
Fetching http://mirrors.163.com/cpan/authors/id/T/TO/TODDR/XML-Parser-2.44.tar.gz ... OK
Configuring XML-Parser-2.44 ... OK
Building and testing XML-Parser-2.44 ... OK
Successfully installed XML-Parser-2.44
Building and testing XML-SAX-Expat-0.51 ... OK
Successfully installed XML-SAX-Expat-0.51
Building and testing XML-Simple-2.24 ... OK
Successfully installed XML-Simple-2.24
3 distributions installed

[root@node01 ~]# cpanm Rex


[root@node01 yum.repos.d]# rpm -qa | grep expat
expat-devel-2.0.1-13.el6_8.x86_64
compat-expat1-1.95.8-8.el6.x86_64
expat-2.0.1-13.el6_8.x86_64





原文地址:https://www.cnblogs.com/hzcya1995/p/13349758.html