Pasang vSphere CLI pada Ubuntu 14.04

Muaturun dan pasang vSphere CLI terbaharu

tar -xvf Downloads/VMware-vSphere-CLI-6.0.0-2503617.x86_64.tar.gz
cd vmware-vsphere-cli-distrib/
sudo ./vmware-install.pl

Jika berlaku ralat module SOAP Lite, muaturun dan pasang secara manual

tar -xvf Downloads/SOAP-Lite-1.19.tar.gz
SOAP-Lite-1.19/
perl Makefile.PL
make
make test
sudo make install

Jika ada masalah memasang modul perl, guna arahan berikut berdasarkan modul yang diperlukan

sudo cpan Nama::Modul

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

SSL Owncloud 8.0 pada Debian 7

Buatkan CSR dengan openssl dari PC anda.

openssl genrsa -des3 -out owncloud_domain_com.key 2048
openssl req -new -key owncloud_domain_com.key -out owncloud_domain_com.csr

Setelah memuatnaik CSR dan dapat zip file dari COMODO, unzip, kemudian buatkan chain certificate.

cat COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt >> bundle.crt

Uji self-sign ssl terlebih dahulu.

a2enmod ssl
a2ensite default-ssl
service apache2 restart

Jika OK, teruskan:

Muatnaik bundle.crt ke /etc/apache2/ssl.crt/

Muatnaik owncloud_domain_com.key ke /etc/ssl/private/

Muatnaik owncloud_domain_com.crt ke /etc/ssl/certs/

Contoh yang diubah pada /etc/sites-enabled/default-ssl

SSLCertificateFile /etc/ssl/certs/owncloud_domain_com.crt
SSLCertificateKeyFile /etc/ssl/private/owncloud_domain_com.key
SSLCertificateChainFile /etc/apache2/ssl.crt/bundle.crt

Tambah juga tetapan berikut untuk melumpuhkan POODLE

SSLProtocol All -SSLv2 -SSLv3

Mulakan semula apache2

service apache2 restart

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Menyelaraskan folder akaun emel zimbra

Untuk menyelaraskan folder akaun emel zimbra dari satu ZCS ke ZCS yang lain untuk tujuan migrasi:

Dapatkan senarai akaun yang hendak diselaraskan

su - zimbra
zmaccts | grep "@domain" | cut -d " " -f 1 > /tmp/accounts.txt

Contoh kod skrip imapsync

#!/bin/bash
while IFS= read file
do
imapsync –noauthmd5 –syncinternaldates –buffersize 65535000 –subscribe \
–host1 202.x.x.x –user1 $file –authuser1 [email protected] –password1 password1 –nofastio1 –authmech1 plain \
–host2 10.x.x.x –ssl2 –user2 $file –authuser2 [email protected] –password2 password2 –nofastio2 –authmech2 plain 2> zimbrasyncerror.txt
done < "accounts.txt"[/code] pada baris ke-6, kita menggunakan option --ssl2 kerana server destinasi hanya terdapat port 993 (IMAP4 ssl)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Apabila semua nod kluster Galera MariaDB shutdown

Tambah atau benarkan “enable_autorecovery=0” pada /etc/cmon.cnf pada nod ClusterControl.

Mulakan semula cmon

[email protected]:~$ sudo service cmon restart

Perhatikan perbezaan nombor “Recovered position” selepas tanda kolon.

[email protected]:~$ sudo mysqld_safe --wsrep-recover
150408 09:38:59 mysqld_safe Logging to '/var/log/mysql.log'.
150408 09:38:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150408 09:38:59 mysqld_safe WSREP: Running position recovery with --log_error='/var/lib/mysql/wsrep_recovery.x2Epct' --pid-file='/var/lib/mysql/db2-recover.pid'
150408 09:39:25 mysqld_safe WSREP: Recovered position 00000000-0000-0000-0000-000000000000:-1
150408 09:39:34 mysqld_safe mysqld from pid file /var/lib/mysql/mysqld.pid ended

[email protected]:~$ sudo mysqld_safe --wsrep-recover
150408 09:40:22 mysqld_safe Logging to '/var/log/mysql.log'.
150408 09:40:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
150408 09:40:22 mysqld_safe WSREP: Running position recovery with --log_error='/var/lib/mysql/wsrep_recovery.ISjnrN' --pid-file='/var/lib/mysql/db1-recover.pid'
150408 09:40:32 mysqld_safe WSREP: Recovered position 1f6e96d3-dd06-11e4-a086-1a4287304197:92216

Berdasarkan situasi diatas, data db1 lebih terkini, jadi kita bootstrap db1.

[email protected]:~$ sudo mysqld --wsrep_cluster_address=gcomm://

[email protected]:~$ sudo tailf /var/log/mysql.log

Tunggu sampai ada mesej berikut di dalam /var/log/mysql.log

[Note] mysqld: ready for connections.

[email protected]:~$ sudo service mysql start

Tunggu sampai ada mesej berikut di dalam /var/log/mysql.log

[Note] /usr/sbin/mysqld: ready for connections.

Buang tetapan “enable_autorecovery=0” pada /etc/cmon.cnf pada nod ClusterControl.

Mulakan semula cmon

Siap.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Tetapan untuk log haproxy

/etc/haproxy/haproxy.cfg

global
        log 127.0.0.1   local0
        log 127.0.0.1   local1 notice

/etc/rsyslog.conf

$ModLoad imuxsock # provides support for local system logging
$ModLoad imklog # provides kernel logging support
$ModLoad imudp
$UDPServerRun 514
$UDPServerAddress 127.0.0.1
$KLogPermitNonKernelFacility on
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$RepeatedMsgReduction on
$FileOwner syslog
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
$PrivDropToUser syslog
$PrivDropToGroup syslog
$WorkDirectory /var/spool/rsyslog
$IncludeConfig /etc/rsyslog.d/*.conf

/etc/rsyslog.d/haproxy.conf

if ($programname == 'haproxy') then -/var/log/haproxy.log

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Formula mengira pm.max_children untuk PHP FPM

Dapatkan jumlah RAM dalam MB dan /run/shm dalam MB

$ awk '/MemTotal/ {printf("%.2f\n",$2/1024)}' /proc/meminfo
128756.27

$ df -m
Filesystem                1M-blocks  Used Available Use% Mounted on
/dev/mapper/app1--vg-root    541986 42284    475016   9% /
none                              1     0         1   0% /sys/fs/cgroup
udev                          64368     1     64368   1% /dev
tmpfs                         12876     2     12875   1% /run
none                              5     0         5   0% /run/lock
none                          64379     0     64379   0% /run/shm
none                            100     0       100   0% /run/user
/dev/sda2                       237    45       180  20% /boot
/dev/sda1                       511     4       508   1% /boot/efi
/dev/dm-2                    307196 83294    223903  28% /var/www

Formula:

(((TotalMemoryinMB-TMPFSinMB)*.8)/75)

(((128756.27-64379)*.8)/75) = 686

Sumber: http://ispeakl33t.com/calculate-pm-max_children

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)