МЫ НЕ ВИТАЕМ В ОБЛАКАХ, МЫ ТУТ РАБОТАЕМ

Git rebase vs git push

19 Июнь, 2013

When several developers work on the same part of code there often could be conflicts. These conflicts have to be resolved manually while merging. It is very boring and useless procedure.

Most common way to avoid this — make branches. But what if our development process is stressed and we have to merge couple times a day to load testers with work? In this case we could avoid conflicts and merge mostly automatically with git rebase.

How it works?

Git rebase puts your local commits into temporary area and then resets to the last commit on upstrean (remote repository). Then it applies local commits one by one. This makes local changes to overwrite all differences in remote repository if any. This is dangerous part of such operation. so be careful and apply changes made by most experienced programmer last. 🙂  But if local changes in some file are wrong you could reset it to right commit very quickly.

Another problem is that your commit log history will be changed. But if you do merging once a day or more this is not a big problem from my point. That’s why I tell my programmers to make

git fetch; git rebase; git push

fetch updates your index with remote updates w/o merging.
rebase tries to apply local commits on top of remote ones
push writes the result to remote repo

instead of straightforward git push. Since using git push in concurrent development environment could lead to many merge conflicts.

P.S. To understand more about this read git man pages. (git rebase —help)

zfsday: ZFS Performance Analysis and Tools

16 Июнь, 2013

At zfsday 2012, I gave a talk on ZFS performance analysis and tools, discussing the role of old and new observability tools for investigating ZFS, including many based on DTrace.

Sergey Gitinsky‘s insight:
Post by Brendan Gregg — ZFS and DTrace guru about measuring performance of ZFS with his own tools.»ZFS can boil ocean» :)top 6 measuring tools
iostat
vfsstat
zfsslower.d
iosnoop
iostacks
metaslab_free.d45 minutes video and 66 slides. This is worth watching for specialists!

See on dtrace.org

My experience of installing AMP stack on Smartmachine

15 Июнь, 2013

After you’ve installed SmartOS on your server it’s time to make running services inside virtual machines which are SmartOS (exSolaris) zones. Thanks Joyent setup of virtual machine (VM) is quite simple.

vmadm -f newmachine.json

Here is an example of json manifest for new VM. Note that I used example names and simplified network settings. I will write a post re. network settings soon.

{
"zonename": "myvm",
"autoboot": true,
"brand": "joyent",
"cpu_shares": 100,
"image_uuid": "9eac5c0c-a941-11e2-a7dc-57a6b041988f", #this is Base 64bit Smartmachine image
"max_physical_memory": 768,
"hostname": "myhostname",
"quota": 30,
"zfs_io_priority": 100,
"resolvers": [
"8.8.8.8",
"8.8.4.4"
],
"nics": [
{
"interface": "net0",
"nic_tag": "admin",
"vlan_id": 0,
"gateway": "10.17.0.1",
"ip": "10.17.0.2",
"netmask": "255.255.255.0"
}
]
}

Vm creates in 1 minute and after that you get working copy of base SmartOS VM with basic software and services running. This is base64 image which is pretty minimalistic.

Login to your new VM:
zlogin myvm

We have to install apache (or nginx if you prefer), mysql (percona-server preferred) and php. You could choose between php5.3 and php5.4.

Thanks Joyent and Jonathan Perkin there is very convenient package tool called pkgin and rather large repository with thousands of packages. First we have to update pkg database:

pkgin -y up

Then we look for our packages:

pkgin av | grep "\(percona\|apache\|php\)"

I’ve chosen Apache 2.2 and php 5.4. Choose preferred versions of apache and php and install all packages with following or similar command:

pkgin in apache-2.2 php-5.4 ap22-php54 percona-server

Also you will need some shared libraries for php (at least mysql drivers). Let’s install mysql bindings and most common libraries:

pkgin in php54-mysql php54-mysqli php54-curl php54-gd php54-dom php54-iconv php54-mbstring

After that it’s time to configure the services:

1) Percona:
1.1) First start percona server:
svcadm enable percona-server
1.2) Then change mysql root password:
/opt/local/bin/mysqladmin -u root -p password 'your_new_password'
1.3) Next run script which will remove non-secure ingredients from fresh installation of mysql.
/opt/local/bin/mysql_secure_installation
1.4) Create your database and upload their your data if needed.

2) Apache:
2.1) Make changes in apache config:
vim /opt/local/etc/httpd/httpd.conf
Change followig sections:
Listen 'your ip here':80
in the end of long set of LoadModule … clauses add:
LoadModule php5_module lib/httpd/mod_php5.so
AddHandler application/x-httpd-php .php

Change ServerAdmin and ServerName clauses to appreciate values.
Change DocumentRoot to the location where your www documents will be stored:
DocumentRoot your/document/root/dir
Change in the <Directory «your/document/root/dir»> section the following:
Options 'consult http://httpd.apache.org/docs/2.2/mod/core.html#options for values here'
You could also change the logging options and other. Refer to httpd docs.
After configuring, start apache:
svcadm enable apache

3) Php
3.1) At least you have to enable php extensions:
vim /opt/local/etc/php.ini
Find «extension=php_bz2» keystring by pressing «/» in vim and entering the keystring.
you will find a lot of commented out extensions declarations. Note that they are for Windows format. So you have not simply to uncomment some of them, but rewrite:
extension=mysql.so
extension=mysqli.so
extension=curl.so
extension=iconv.so
extension=mbstring.so
extension=dom.so
extension=gd.so

You could more extensions or shared libraries here if you’ve installed them at the previous step with pkgin.

Refresh apache to make php-module reread the config:
svcadm refresh apache

Now put your php application into the document_root directory and enter your domain or ip in your browser. It has to show your site!

ZFS: Read Me 1st

14 Июнь, 2013

 

Sergey Gitinsky‘s insight:

Good artcle describing things which are not common wiith  ZFS. It has it’s own share of caveats, gotchya’s, hidden «features» etc.

17 rules for ZFS admins, dos and donts to take care of. Some of them obvious but anyway… Look, for example…

1) IOPS are factor of number of vdevs, not raw disks! If vdev contains 100 disks IOPS will be as only one. Think about it before designing your pools.
2) Deduplication is not free. It could eat a lot of RAM. If you turn on deduplication not carefully you could come to fast decreasing performance. So don’t turn it on without ful understanding of what you are doing!
3) Snapshots are not backups. And one ‘zfs destroy’ by a disgruntled employee, one fire in your datacenter, one random chance of bad luck that causes a whole backplane, JBOD, or a number of disks to die at once, one faulty HBA, etc, etc, etc — and poof, your pool is gone. So you have to MAKE BACKUPS.
4.
5.
.
17.

See on nex7.blogspot.ru

ZFS Intent Log

13 Июнь, 2013

The ZFS Intent Log gets a lot of attention, and unfortunately often the information being posted on various forums and blogs and so on is misinformed or makes assumptions about the knowledge level of the reader that if incorrect can lead to danger.

Sergey Gitinsky‘s insight:

Good reading for those who wants to understand what ZIL (ZFS Intent Log) is and how it works…

See on nex7.blogspot.com

Онлайн заявка

Отправляя данные этой формы, вы соглашаетесь с правилами обработки персональных данных