wget http://download.gna.org/wkhtmltopdf/0.12/0.12.3/wkhtmltox-0.12.3_linux-generic-amd64.tar.xz

tar Jxvf wkhtmltox-0.12.3_linux-generic-amd64.tar.xz

cp bin/wkhtmlto* /usr/local/bin/.

 

作ってみたが、文字が重なる・・・

http://dev.furoom.net/jsdoc3/jsdoc3/index.pdf

letter-spacingの問題っぽい。

オプションでも回避できなさそうな・・。残念。。

 

最新版入れてみる

1024 wget https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-centos6-amd64.rpm
1026 tar Jxvf wkhtmltox-0.13.0-alpha-7b36694_linux-centos6-amd64.rpm
1027 rpm -ivh wkhtmltox-0.13.0-alpha-7b36694_linux-centos6-amd64.rpm
1028 yum install icu
1029 yum install xorg-x11-fonts-Type1
1030 yum install xorg-x11-fonts-75dpi
1031 rpm -ivh wkhtmltox-0.13.0-alpha-7b36694_linux-centos6-amd64.rpm

 

動かない。

wkhtmltopdf index.html index.pdf
QXcbConnection: Could not connect to display
アボートしました

 

yum install xorg-x11-server-Xvfb

xvfb-run wkhtmltopdf index.html index.pdf

できれいに表示された!

 

でも複数表示できない。

export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb; xvfb-run wkhtmltopdf DomainSync.html DomainSync.js.ht
ml index.pdf
Error: This version of wkhtmltopdf is build against an unpatched version of QT, and does not support more then one input document.
Exit with code 1, due to unknown error.

 

stable 0.12.3 を使って、

letter-spacing を何とかするしかないのかも

 

–dpi 75 を着けると綺麗に表示された!

wkhtmltopdf –dpi 75 index.html  index.pdf

 

複数ファイル一気にかけようとするとエラーが発生する

wkhtmltopdf –dpi 75 *.html index.pdf
Loading pages (1/6)
Warning: Received createRequest signal on a disposed ResourceObject’s NetworkAccessManager. This might be an indication of an iframe taking too long to load.

 

–javascript-delay を付けると良いようだ

wkhtmltopdf –dpi 75 –javascript-delay 1000 *.html index.pdf

 

用紙幅が少なく感じるのは、

–page-size で調整すればよいのかな

http://stackoverflow.com/questions/6394905/wkhtmltopdf-what-paper-sizes-are-valid

 

A3 B3くらいがおさまりいい気がする

wkhtmltopdf –dpi 75 –javascript-delay 1000 –page-size B3 module-*.html index.pdf

 

–minimum-font-size

もあるけど、maxがない。文字大きくしたいのはそんなになさそう

 

jsdocの出力に対してかけたい。

.js.html はソースコードなのでとりあえず省く

index.htmlは最初におきたい

moduleは、moduleとclassで分けたい

wkhtmltopdf –dpi 75 –javascript-delay 1000 –page-size B3 index.html module*[^\.][^j][^s].html global.html index.pdf

 

classとmoduleがごちゃまぜなのでもう一息・・。

cd /usr/local/src/
wget “http://sourceforge.net/projects/s3tools/files/latest/download?source=files”
mv download\?source\=files s3cmd-1.6.0.tar.gz
tar xvzf s3cmd-1.6.0.tar.gz
cd s3cmd-1.6.0
yum install python-setuptools
python ./setup.py install
s3cmd

 

[nilesflow@tk2-234-26954 glusterfs]$ s3cmd –configure
Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.
Access Key: xxx
Secret Key: yyy
Default Region [US]: us-west-2

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password: zzz
Path to GPG program [/usr/bin/gpg]:

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP, and can only be proxied with Python 2.7 or newer
Use HTTPS protocol [Yes]:

New settings:
Access Key: xxx
Secret Key: yyy
Default Region: us-west-2
Encryption password: zzz
Path to GPG program: /usr/bin/gpg
Use HTTPS protocol: True
HTTP Proxy server name:
HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] Y
Please wait, attempting to list all buckets…
Success. Your access key and secret key worked fine 🙂

Now verifying that encryption works…
Success. Encryption and decryption worked fine 🙂

Save settings? [y/N] y
Configuration saved to ‘/home/nilesflow/.s3cfg’

 

★PUT

[nilesflow@tk2-234-26954 s3cmd]$ s3cmd put s3cmd.txt s3://nilesflowfirstbucket
‘s3cmd.txt’ -> ‘s3://nilesflowfirstbucket/s3cmd.txt’ [1 of 1]
6 of 6 100% in 0s 72.27 B/s done
‘s3cmd.txt’ -> ‘s3://nilesflowfirstbucket/s3cmd.txt’ [1 of 1]
6 of 6 100% in 0s 42.13 B/s done

 

★マルチパートアップロード 50MB

[nilesflow@tk2-234-26954 s3cmd]$ dd if=/dev/zero of=s3cmd-50MB bs=50MB count=1
1+0 records in
1+0 records out
50000000 bytes (50 MB) copied, 0.191449 s, 261 MB/s
[nilesflow@tk2-234-26954 s3cmd]$ ll

[nilesflow@tk2-234-26954 s3cmd]$ s3cmd put –multipart-chunk-size-mb=5 s3cmd-50MB s3://nilesflowfirstbucket
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 1 of 10, 5MB]
5242880 of 5242880 100% in 0s 14.18 MB/s done
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 2 of 10, 5MB]
5242880 of 5242880 100% in 0s 14.37 MB/s done
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 3 of 10, 5MB]
5242880 of 5242880 100% in 0s 15.60 MB/s done
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 4 of 10, 5MB]
5242880 of 5242880 100% in 0s 12.77 MB/s done
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 5 of 10, 5MB]
5242880 of 5242880 100% in 0s 15.85 MB/s done
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 6 of 10, 5MB]
5242880 of 5242880 100% in 0s 15.12 MB/s done
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 7 of 10, 5MB]
5242880 of 5242880 100% in 0s 18.30 MB/s done
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 8 of 10, 5MB]
5242880 of 5242880 100% in 0s 10.19 MB/s done
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 9 of 10, 5MB]
5242880 of 5242880 100% in 0s 15.32 MB/s done
‘s3cmd-50MB’ -> ‘s3://nilesflowfirstbucket/s3cmd-50MB’ [part 10 of 10, 2MB]
2814080 of 2814080 100% in 0s 5.10 MB/s done

以前触ったけど、残してなかったので今の状態だけ。

 

yum install glusterfs glusterfs-fuse

yum install glusterfs glusterfs-server

 

service glusterd start

 

 

[root@tk2-234-26954 glusterfs]# gluster volume info

Volume Name: gfs
Type: Replicate
Volume ID: 6ae6cc45-59df-4d12-9307-35410214324d
Status: Started
Number of Bricks: 1 x 2 = 2
Transport-type: tcp
Bricks:
Brick1: primary.gfs.local:/root/glusterfs/primary
Brick2: secondary.gfs.local:/root/glusterfs/secondary
Options Reconfigured:
performance.readdir-ahead: on
[root@tk2-234-26954 glusterfs]# gluster volume status
Status of volume: gfs
Gluster process TCP Port RDMA Port Online Pid
——————————————————————————
Brick primary.gfs.local:/root/glusterfs/pri
mary 49156 0 Y 11647
Brick secondary.gfs.local:/root/glusterfs/s
econdary 49157 0 Y 11665
NFS Server on localhost N/A N/A N N/A
Self-heal Daemon on localhost N/A N/A Y 11697

Task Status of Volume gfs
——————————————————————————
There are no active volume tasks

 

mount

 

[root@tk2-234-26954 glusterfs]# df | grep -E “gfs|glusterfs”
primary.gfs.local:/gfs
18193792 8224512 9038464 48% /root/glusterfs/mount

 

touch /root/glusterfs/mount/7

#primary, secondary 両方にコピー

Amazon SESへのProxyで確認

「サーバ名がサーバが期待しているものと違っている」旨のエラーになったので、

メーラで「証明書を検証しない」設定が必要だった。

 

stream {

#SMTP
upstream smtp {
server email-smtp.us-west-2.amazonaws.com:587 weight=5 max_fails=3 fail_timeout=30s;
}

server {
listen 587;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass smtp;
}

upstream smtps {
server email-smtp.us-west-2.amazonaws.com:465 weight=5 max_fails=3 fail_timeout=30s;
}

server {
listen 465;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass smtps;
}

stream {
#FTP
upstream ftp {
server 127.0.0.1:21 weight=5 max_fails=3 fail_timeout=30s;
server 127.0.0.1:10021 weight=5 max_fails=3 fail_timeout=30s;
}

server {
listen 20021;
proxy_connect_timeout 1s;
proxy_timeout 3s;
proxy_pass ftp;
}

 

と思ったら、vsftpd/pureftpd共に、Passiveコマンドで失敗している

227 Entering Passive Mode (160,16,117,208,47,254)
421 Service not available, remote server has closed connection

 

vsftpdは以下設定で回避できたが、

pasv_promiscuous=yes

 

pure-ftpdは回避できるオプションがなさそう。

 

 

同一サーバ、単一PHPから、

ログイン、chdir後、異なる5000ファイルをアップロード

 

vsftpd 3.0.3 from source

pure-ftpd v1.0.30 from yum install

 

pure-ftpdの方が早いみたい。。

 

vsftpd
num : 5000
total : 2.30912 s
one : 0.00046s/req

pure-ftpd
num : 5000
total : 2.0004 s
one : 0.0004s/req

#ファイルとDatabaseの書き込みの差

 

#filesystem read→write

10000ファイル

1.24ms

0.00012ms/req

 

#filesystem append

10000ファイル

0.26852 ms
3.0E-5ms/req

 

#psql insert

1000 insert

0.52306 ms
0.00052ms/req

※ ×10レコードでも大差無い

 

#psql insert

10000 insert

4.29751 ms
0.00043ms/req

vi /etc/exports

# 共有ボリュームのパス, 接続許可ホスト, エクスポートプション (rw) = Read Write
/root/nfs 127.0.0.1(rw,no_root_squash)
/root/nfs 160.16.117.208(rw,no_root_squash)

 

service rpcbind start

service nfslock start

service nfs start