- 浏览: 2491556 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
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 270I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 434NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 318Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 330Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 297Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 383Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 380Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 335Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 405VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 341Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 422NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 369Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 296Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 214GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 397GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 282GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 272Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 268Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 256Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 243Serverless with NodeJS and Tenc ...
相关推荐
官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装
可使用程序进行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完整包名] 进行安装
离线安装包,亲测可用
主要介绍了Perl学习笔记之CPAN使用介绍,本文讲解了什么是CPAN、CPAN的目录作用介绍、CPAN安装Perl Module的两种方法等内容,需要的朋友可以参考下
Writing Perl Modules for CPAN offers Perl developers a comprehensive guide to using and contributing to the Comprehensive Perl Archive Network (CPAN). Starting with a general overview of CPAN’s ...
Perl Module from CPAN, bugzilla essential perl modules 公司内部不能用FTP下载perl包,所以家里下好之后,上传到这里,公司再从这里down来安装,唉,真麻烦啊
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
Writing.Perl.Modules.For.CPAN Writing.Perl.Modules.For.CPAN Writing.Perl.Modules.For.CPAN Writing.Perl.Modules.For.CPAN
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
离线安装包,亲测可用
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 ...
离线安装包,亲测可用
brian d foy is a prolific Perl trainer and writer, and runs The Perl Review to ... He maintains the perlfaq portions of the core Perl documentation, several modules on CPAN, and some stand-alone scripts.
离线安装包,亲测可用
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
ActivePerl from ActiveState and all other modern implementations of Perl. To use this book, you just need to be familiar with the material in Learning Perl and have the ambition to go further. ...
Perl 一般被称为“实用报表提取语言”(Practical Extraction and Report Language),你也可能看到“perl”,所有的字母都是小写的。一般,“Perl”,有大写的 P,是指语言本身,而“perl”,小写的 p,是指程序...
毕竟,ActivePerl的PPM包,更新得太慢了,如果需要自己手动编译CPAN的包,还不如用strawberry Perl来得放心呢! Strawberry Perl其实就是windows下的the core Windows distribution of Perl的一个版本。它尽可能地在...
Command Interpreter Program (Shell) Conventions Installing Perl Modules How to Contact Us Acknowledgments Part I: mod_perl Administration Chapter 1. Introducing CGI and ...