- 浏览: 2539081 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Perl Project Improvement(1) Perl Installation and CPAN
> perl -v
This is perl 5, version 16, subversion 0 (v5.16.0) built for darwin-2level
CPAN installation
Log::Log4perl
YAML::XS
Data::Dumper
DBI
IOC
Redis
Time::Piece
Path::Class
autodie
Thread::Queue
DBD::mysql
threads
If CPAN install is not working, you may need force install.
1 Install DBI on MAC
>cpan App::cpanminus
> cpanm DBI
> perl -MCPAN -e 'shell'
cpan> get DBD::mysql
>cd /usr/local/lib
> sudo ln -s /usr/local/mysql/lib/*.dylib .
> cd ~/.cpan/build/DBD*/
> sudo perl Makefile.PL --testuser='test'
sudo make and sudo make install
> sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib
> export DLYD_LIBRARY_PATH=/usr/local/mysql/lib
Show the Perl Directory:
> perl -e 'print join ("\n", @INC) . "\n";'
/home/ec2-user/perl5/lib/perl5/x86_64-linux-thread-multi
/home/ec2-user/perl5/lib/perl5
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.
Run the Perl test cases
> prove t/*
2 Manually Install Perl
http://perldoc.perl.org/perlmacosx.html
http://www.cpan.org/src/
> curl -O http://www.cpan.org/src/perl-5.22.0.tar.gz
> ./Configure -des -Dprefix=/Users/carl/tool/perl-5.22.0
Make and Make Install
Build with supporting for threads
> ./Configure -des -Dusethreads -Dprefix=/Users/carl/tool/perl-5.22.0
threads and forks
http://stackoverflow.com/questions/22036985/error-using-thread-module-this-perl-not-built-to-support-threads
I checked the version on all the servers, I am using this old version.
> perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 25 registered patches, see perl -V for more detail)
So I will manually install the version on CentOS Docker Image
3 Manually Install Perl on CentOS Docker Image
> wget http://www.cpan.org/src/5.0/perl-5.16.3.tar.gz
> ./Configure -des -Dprefix=/tool/perl-5.16.3
Error Message:
I can't find make or gmake, and my life depends on it.
Go find a public domain implementation or fix your PATH setting!
Solution:
yum install -y gcc
yum install -y make
https://github.com/luohuazju/sillycat-docker/blob/master/centos7-nginx/Dockerfile
> make
> make install
If we install that on docker image, we can ignore the -Dprefix, because we do not want to set up PATH.
This can by pass the CPAN command confirmation.
export PERL_MM_USE_DEFAULT=1
cpan -fi Log::Log4perl YAML::XS
cpan -fi Log::Log4perl YAML::XS Data::Dumper DBI IOC Redis Time::Piece Path::Class autodie Thread::Queue DBD::mysql threads
cpan DBIx::Connector
or
cpan DBIx::Connector Log::Log4perl
cpan -fi autodie Thread::Queue threads
Install cpanm
> curl -L https://cpanmin.us | perl - App::cpanminus
Or
cpan App::cpanminus
Even this does not work
> cpanm --notest DBD::mysql
Error Message:
Can't exec "mysql_config": No such file or directory at Makefile.PL line 73.
Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
not contain the path to mysql_config. Resorting to guessed values!
Solution:
yum install mysql-devel
The docker file configurations are as follow
Dockerfile
#Prepre the OS
FROM centos:7
MAINTAINER Carl Luo <luohuazju@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
ENV PERL_MM_USE_DEFAULT 1
RUN yum install -y gcc make wget
RUN yum install -y mysql-devel
RUN mkdir /install/
WORKDIR /install/
#install perl
RUN wget http://www.cpan.org/src/5.0/perl-5.16.3.tar.gz
RUN tar zxvf perl-5.16.3.tar.gz
WORKDIR /install/perl-5.16.3
RUN ./Configure -des -Dusethreads
RUN make && make install
RUN cpan -fi Log::Log4perl YAML::XS Data::Dumper DBI IOC Redis Time::Piece Path::Class
RUN cpan -fi autodie Thread::Queue threads
RUN cpan -fi DBIx::Connector
RUN cpan DBD::mysql
#Install the Application
RUN mkdir /share/
WORKDIR /share/
ADD dist/jobs-producer-1.0.tgz /share/
RUN mkdir -p /mnt/ad_feed
RUN mkdir -p /mnt5/ad_feed
#Start the Application
RUN mkdir -p /app/
ADD start.sh /app/
WORKDIR /app
CMD [ "./start.sh" ]
Makefile
IMAGE=sillycat/jobs-producer
TAG=1.0
NAME=jobs-producer
REPOSITORY=registry.sillycat.com
push-local:
docker push $(REPOSITORY)/$(IMAGE):$(TAG)
app-clean:
rm -fr dist
rm -fr $(NAME)-$(TAG)
app-init:
curl -sS https://getcomposer.org/installer | php
php composer.phar install
app-build:
mkdir -p ./$(NAME)-$(TAG)/logs
mkdir -p ./dist
cp -r ./conf ./$(NAME)-$(TAG)/
cp -r ./lib ./$(NAME)-$(TAG)/
cp -r ./src ./$(NAME)-$(TAG)/
cp -r ./vendor ./$(NAME)-$(TAG)/
cp *.pl ./$(NAME)-$(TAG)/
tar -cvzf ./dist/$(NAME)-$(TAG).tgz ./$(NAME)-$(TAG)
docker-context:
build: docker-context
sudo docker build -t $(REPOSITORY)/$(IMAGE):$(TAG) .
run-stage:
sudo docker run -v /opt/jobs-producer/logs:/share/$(NAME)-$(TAG)/logs -v /mnt/ad_feed:/mnt/ad_feed -v /mnt5/ad_feed:/mnt5/ad_feed -d -e RUNNING_ENV=stage --name $(NAME) $(REPOSITORY)/$(IMAGE):$(TAG)
debug:
sudo docker run -v /opt/jobs-producer/logs:/share/$(NAME)-$(TAG)/logs -v /mnt/ad_feed:/mnt/ad_feed -v /mnt5/ad_feed:/mnt5/ad_feed -ti -e RUNNING_ENV=stage --name $(NAME) $(REPOSITORY)/$(IMAGE):$(TAG) /bin/bash
clean:
sudo docker stop ${NAME}
sudo docker rm ${NAME}
logs:
sudo docker logs ${NAME}
publish:
sudo docker push ${IMAGE}
start.sh
#!/bin/sh -ex
cd /share/jobs-producer-1.0
perl JobProducerApp.pl
References:
log4perl
http://unmi.cc/perl-log4perl-user-guide/
IOC
http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/TPJ/2005/0501/0501a/0501a.html
http://perlalchemy.blogspot.com/2011/01/dependency-injection-or-removing.html
http://www.drdobbs.com/web-development/inversion-of-control-in-perl/184416179#l1
http://search.cpan.org/~stevan/IOC-0.29/lib/IOC.pm
Configuration File
http://perltricks.com/article/29/2013/9/17/How-to-Load-YAML-Config-Files
Mysql Connection
http://search.cpan.org/~capttofu/DBD-mysql-4.033/lib/DBD/mysql.pm
upgrade version and re-install
http://sillycat.iteye.com/blog/2193773
install DBI on mac
http://stackoverflow.com/questions/19565553/problems-with-perl-dbi-dbd-on-osx-10-9-mavericks
tap::harness test suite
http://www.4byte.cn/question/1518155/tap-harness-perl-tests-tee-output.html
> perl -v
This is perl 5, version 16, subversion 0 (v5.16.0) built for darwin-2level
CPAN installation
Log::Log4perl
YAML::XS
Data::Dumper
DBI
IOC
Redis
Time::Piece
Path::Class
autodie
Thread::Queue
DBD::mysql
threads
If CPAN install is not working, you may need force install.
1 Install DBI on MAC
>cpan App::cpanminus
> cpanm DBI
> perl -MCPAN -e 'shell'
cpan> get DBD::mysql
>cd /usr/local/lib
> sudo ln -s /usr/local/mysql/lib/*.dylib .
> cd ~/.cpan/build/DBD*/
> sudo perl Makefile.PL --testuser='test'
sudo make and sudo make install
> sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib
> export DLYD_LIBRARY_PATH=/usr/local/mysql/lib
Show the Perl Directory:
> perl -e 'print join ("\n", @INC) . "\n";'
/home/ec2-user/perl5/lib/perl5/x86_64-linux-thread-multi
/home/ec2-user/perl5/lib/perl5
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
.
Run the Perl test cases
> prove t/*
2 Manually Install Perl
http://perldoc.perl.org/perlmacosx.html
http://www.cpan.org/src/
> curl -O http://www.cpan.org/src/perl-5.22.0.tar.gz
> ./Configure -des -Dprefix=/Users/carl/tool/perl-5.22.0
Make and Make Install
Build with supporting for threads
> ./Configure -des -Dusethreads -Dprefix=/Users/carl/tool/perl-5.22.0
threads and forks
http://stackoverflow.com/questions/22036985/error-using-thread-module-this-perl-not-built-to-support-threads
I checked the version on all the servers, I am using this old version.
> perl -v
This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi
(with 25 registered patches, see perl -V for more detail)
So I will manually install the version on CentOS Docker Image
3 Manually Install Perl on CentOS Docker Image
> wget http://www.cpan.org/src/5.0/perl-5.16.3.tar.gz
> ./Configure -des -Dprefix=/tool/perl-5.16.3
Error Message:
I can't find make or gmake, and my life depends on it.
Go find a public domain implementation or fix your PATH setting!
Solution:
yum install -y gcc
yum install -y make
https://github.com/luohuazju/sillycat-docker/blob/master/centos7-nginx/Dockerfile
> make
> make install
If we install that on docker image, we can ignore the -Dprefix, because we do not want to set up PATH.
This can by pass the CPAN command confirmation.
export PERL_MM_USE_DEFAULT=1
cpan -fi Log::Log4perl YAML::XS
cpan -fi Log::Log4perl YAML::XS Data::Dumper DBI IOC Redis Time::Piece Path::Class autodie Thread::Queue DBD::mysql threads
cpan DBIx::Connector
or
cpan DBIx::Connector Log::Log4perl
cpan -fi autodie Thread::Queue threads
Install cpanm
> curl -L https://cpanmin.us | perl - App::cpanminus
Or
cpan App::cpanminus
Even this does not work
> cpanm --notest DBD::mysql
Error Message:
Can't exec "mysql_config": No such file or directory at Makefile.PL line 73.
Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
not contain the path to mysql_config. Resorting to guessed values!
Solution:
yum install mysql-devel
The docker file configurations are as follow
Dockerfile
#Prepre the OS
FROM centos:7
MAINTAINER Carl Luo <luohuazju@gmail.com>
ENV DEBIAN_FRONTEND noninteractive
ENV PERL_MM_USE_DEFAULT 1
RUN yum install -y gcc make wget
RUN yum install -y mysql-devel
RUN mkdir /install/
WORKDIR /install/
#install perl
RUN wget http://www.cpan.org/src/5.0/perl-5.16.3.tar.gz
RUN tar zxvf perl-5.16.3.tar.gz
WORKDIR /install/perl-5.16.3
RUN ./Configure -des -Dusethreads
RUN make && make install
RUN cpan -fi Log::Log4perl YAML::XS Data::Dumper DBI IOC Redis Time::Piece Path::Class
RUN cpan -fi autodie Thread::Queue threads
RUN cpan -fi DBIx::Connector
RUN cpan DBD::mysql
#Install the Application
RUN mkdir /share/
WORKDIR /share/
ADD dist/jobs-producer-1.0.tgz /share/
RUN mkdir -p /mnt/ad_feed
RUN mkdir -p /mnt5/ad_feed
#Start the Application
RUN mkdir -p /app/
ADD start.sh /app/
WORKDIR /app
CMD [ "./start.sh" ]
Makefile
IMAGE=sillycat/jobs-producer
TAG=1.0
NAME=jobs-producer
REPOSITORY=registry.sillycat.com
push-local:
docker push $(REPOSITORY)/$(IMAGE):$(TAG)
app-clean:
rm -fr dist
rm -fr $(NAME)-$(TAG)
app-init:
curl -sS https://getcomposer.org/installer | php
php composer.phar install
app-build:
mkdir -p ./$(NAME)-$(TAG)/logs
mkdir -p ./dist
cp -r ./conf ./$(NAME)-$(TAG)/
cp -r ./lib ./$(NAME)-$(TAG)/
cp -r ./src ./$(NAME)-$(TAG)/
cp -r ./vendor ./$(NAME)-$(TAG)/
cp *.pl ./$(NAME)-$(TAG)/
tar -cvzf ./dist/$(NAME)-$(TAG).tgz ./$(NAME)-$(TAG)
docker-context:
build: docker-context
sudo docker build -t $(REPOSITORY)/$(IMAGE):$(TAG) .
run-stage:
sudo docker run -v /opt/jobs-producer/logs:/share/$(NAME)-$(TAG)/logs -v /mnt/ad_feed:/mnt/ad_feed -v /mnt5/ad_feed:/mnt5/ad_feed -d -e RUNNING_ENV=stage --name $(NAME) $(REPOSITORY)/$(IMAGE):$(TAG)
debug:
sudo docker run -v /opt/jobs-producer/logs:/share/$(NAME)-$(TAG)/logs -v /mnt/ad_feed:/mnt/ad_feed -v /mnt5/ad_feed:/mnt5/ad_feed -ti -e RUNNING_ENV=stage --name $(NAME) $(REPOSITORY)/$(IMAGE):$(TAG) /bin/bash
clean:
sudo docker stop ${NAME}
sudo docker rm ${NAME}
logs:
sudo docker logs ${NAME}
publish:
sudo docker push ${IMAGE}
start.sh
#!/bin/sh -ex
cd /share/jobs-producer-1.0
perl JobProducerApp.pl
References:
log4perl
http://unmi.cc/perl-log4perl-user-guide/
IOC
http://collaboration.cmc.ec.gc.ca/science/rpn/biblio/ddj/Website/articles/TPJ/2005/0501/0501a/0501a.html
http://perlalchemy.blogspot.com/2011/01/dependency-injection-or-removing.html
http://www.drdobbs.com/web-development/inversion-of-control-in-perl/184416179#l1
http://search.cpan.org/~stevan/IOC-0.29/lib/IOC.pm
Configuration File
http://perltricks.com/article/29/2013/9/17/How-to-Load-YAML-Config-Files
Mysql Connection
http://search.cpan.org/~capttofu/DBD-mysql-4.033/lib/DBD/mysql.pm
upgrade version and re-install
http://sillycat.iteye.com/blog/2193773
install DBI on mac
http://stackoverflow.com/questions/19565553/problems-with-perl-dbi-dbd-on-osx-10-9-mavericks
tap::harness test suite
http://www.4byte.cn/question/1518155/tap-harness-perl-tests-tee-output.html
发表评论
-
Stop Update Here
2020-04-28 09:00 310I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 465NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 361Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 362Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 328Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 419Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 364Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 444VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 376Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 462NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 413Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 330Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 242GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 443GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 320GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 306Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 284Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 302Serverless with NodeJS and Tenc ...
相关推荐
1. **perl-CPAN-1.9800-299.el7_9.noarch.rpm**: 这个包是Perl的 Comprehensive Perl Archive Network (CPAN) 客户端,它是一个自动化的工具,用于下载、构建、测试和安装Perl模块。CPAN包含了超过20万个Perl模块,...
可使用程序进行CPAN批量下载 _inst( \%pkg ); inst('par'); my @par = ( q{PAR}, q{PAR::Packer}, ); my @xml = ( q{XML::Simple}, q{XML::SAX}, q{XML::SAX::Expat}, ); my %pkg = ( par => \@par, ...
官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装
官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装
离线安装包,亲测可用
CPAN,全称为 Comprehensive Perl Archive Network,是Perl生态系统的核心组成部分,它是一个庞大的资源库,包含了数以千计的Perl模块、文档、源代码以及Perl相关的工具。CPAN不仅提供了方便的模块下载和安装方式,...
Perl Module from CPAN, bugzilla essential perl modules 公司内部不能用FTP下载perl包,所以家里下好之后,上传到这里,公司再从这里down来安装,唉,真麻烦啊
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
在离线环境中,安装额外的Perl模块可能会比较复杂,因为通常这些模块依赖于CPAN(Comprehensive Perl Archive Network)。不过,你可以将所需的模块下载到本地,然后使用`cpanm`(CPAN Minus)或手动编译来安装。...
1. **检查已安装模块**:使用`cpan -l`或`perl -MCPAN -e 'print join("\n", map { $_->dist } CPAN::Distribution->installed)'`命令查看已安装的Perl模块列表,找到你要卸载的模块名。 2. **确定模块位置**:找到...
Perl是一种高级的、通用的、解释型的、动态的编程语言,它的全称是 Practical Extraction and Reporting Language,即“实用提取和报告语言”。标题中的"perl-5.24.1.tar.gz"指的是Perl的一个特定版本,5.24.1,这个...
Writing.Perl.Modules.For.CPAN Writing.Perl.Modules.For.CPAN Writing.Perl.Modules.For.CPAN Writing.Perl.Modules.For.CPAN
Perl是一种高级的、通用的、解释型、动态的编程语言,它的全称是“ Practical Extraction and Reporting Language”,中文常被译为“实用提取和报告语言”。这个“perl-5.32.1.tar.gz”文件是Perl编程语言的源代码包...
1. **获取Perl RPM包**:在有网络的环境中,你可以通过`yum download`命令或访问官方或第三方RPM存储库下载Perl的RPM包。确保下载与你的CentOS版本兼容的版本。 2. **传输RPM包**:将下载的Perl RPM包通过USB驱动器...
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
4. cpan:CPAN(Comprehensive Perl Archive Network)是Perl的一个重要资源库,包含了数万种Perl模块。此目录可能指向一个本地的CPAN镜像,便于用户快速安装和更新Perl模块。 5. win32:这个目录可能包含了专门针对...
离线安装包,亲测可用
Learn how the language works, how to take advantage of the CPAN's immense trove of time-tested solutions, and how to write clear, concise, powerful code that runs everywhere. Specific coverage ...
它提供了一个易于安装的包,包含了Perl解释器和许多常用的Perl模块,使得开发者无需从CPAN(Comprehensive Perl Archive Network)手动下载和安装每个模块。ActivePerl还包括了编译器支持,使用户可以将Perl脚本编译...
Strawberry Perl还包括了CPAN(Comprehensive Perl Archive Network)客户端,这是一个庞大的Perl模块仓库,开发者可以通过它轻松查找并安装各种扩展功能。这意味着在Windows环境下,Perl开发者也能享受到与Unix/...