понедельник, 6 февраля 2012 г.

Illumian is here...

Today I've tried the first Illumian version. This is illumos-based Nexenta OS. Just a few remarks.
What I liked:
1) VTs finally work in illumos installer, it's good to have a possibility of going to text console and checking installer's log.
2) It seems, the installer can install system on mirror pool. C'est beau.
3) APT... I finally shouldn't learn one more package system and apt is IMHO faster then IPS.
4) It's still Solaris: you have DTrace, ZFS, projects, fair share scheduler...
5) git change number in place of OS version looks cool :)

# uname -a
SunOS oi-test 5.11 4cece89cac3e i86pc i386 i86pc Solaris

What I disliked:
1) Zones don't work:

root@oi-test:~# zoneadm -z myzone install
sh[1]: exec: /usr/lib/brand/ipkg/pkgcreatezone: not found

And Solaris without zones is a very strange thing...
2) /usr/gnu/bin in front of path... How can you use GNU chmod with ZFS ACL?
3) Soft, soft, soft... Where are you?

root@oi-test:~# apt-cache pkgnames |grep postgres

4) apt-clone doesn't work

This is just a first glance on this OS. It is very raw and is still in development. I doubt that calling this release 1.0 was a good idea. It seems, we will have a production-ready OS not sooner then in half of year, but still... I wonder, what Illumos-based OS will be first to reach production quality: OI or Illumian? It seems OI is in better form nowadays, but the fact is that OI team has failed to create a stable release in about 1.5 years.

понедельник, 30 января 2012 г.

php-fpm status polling

Just a brief note...
If you wish to monitor php-fpm pool, it provides status page determined by status_path configuration parameter in pool config file.

pm.status_path = /statusfpm

Status page usually looks like this:

X-Powered-By: PHP/5.3.3-1ubuntu9.7
text/plain
Content-type: text/html

accepted conn: 253745
pool: mhouse
process manager: static
idle processes: 50
active processes: 0
total processes: 50

The problem is that it is not usually accessible by HTTP, and you should usually use web-server to communcate with php-fpm by FastCGI protocol. Now let's imagine that you have 10 php-fpm nodes and one nginx server. It seems justified to get status from each php-fpm node, you should talk directly to php-fpm. And you can use php FCGIClient (big thanks to its author, Pierrick Charron) for this task.
Using this library is straightforward. The only difficulty is to send necessary headers to php-fpm. These headers we can find out with tcpdump, monitoring nginx and php-fpm communications. So, the following script can be used to retrieve distinct php-fpm statistics:

<?php
require('fastcgi.php');

$client = new FCGIClient('192.168.0.1', '9000');
$answer=$client->request(
array(
'GATEWAY_INTERFACE' => 'FastCGI/1.0',
'REQUEST_METHOD' => 'GET',
'SCRIPT_FILENAME' => '/usr/local/nginx/html/statusfpm', //Nginx document root
'SCRIPT_NAME' => '/statusfpm', //our pm.status_path
),''
);
?>


Recieved file can be analyzed further and result may be fed to your monitoring system:

$lines=split("\n",$answer);
//Line 0 (4 - with headers) - Accepted connections
$cnum=strpos($lines[4],':');
$accepted=trim(substr($lines[4],$cnum+1));

//Line 3(7) - idle processes
$cnum=strpos($lines[7],':',1);
$idle=trim(substr($lines[7],$cnum+1));

//Line 4(8) - active processes
$cnum=strpos($lines[8],":");
$active=trim(substr($lines[8],$cnum+1));

//Line 5(9) - total processes
$cnum=strpos($lines[9],":");
$total=trim(substr($lines[9],$cnum+1));



The latest part depends on monitoring system you using. We have some service php functions to interact with zabbix (in particular, slightly modified zabbix_sender function).

пятница, 23 декабря 2011 г.

Ubuntu VZ container and lo interface

If you look at VZ image of Ubuntu 11.04 , you'll see that udev is excluded from startup. It seems to be incorrect, because without udev "net-device-added INTERFACE=lo" event is not emitted and loopback interface remains unconfigured... At least, this behavior appeared after updating this image to 11.10. I don't remember if lo interface was present in original 11.04 image.

четверг, 22 декабря 2011 г.

How can you use PocketBook?

I received a PocketBook 612 reader as New Year present... I haven't seen slower device. It seems that my phone is faster and even my 13-year old computer was faster... I just want to read books. However, when I navigate through pages in a PDF file, this thing starts thinking,,, I can't even scroll through several pages per minute. The screen sometimes shows artifacts (is not cleared completely). The book has 44 dictionaries... It's good. It has even Ukrainian-Russian dictionary and French-English one but not French-Russian... And this device is supposed to be sold in Russia... Cool.
I didn't manage to connect it to my home Wi-Fi WPA2/PSK network with hidden AP.
However, it can pronounce words and read text aloud. But I don't need this, all I need is a reader and a vocabulary. I thought I could get it for about 250$. I was wrong... I wouldn't count this amount of money if the thing worked... But it lags worse than 10-year's old PC.
Possibly I should read books from my phone and don't use such incomprehensible device... It seems the best solution is to return this device to a seller and to buy some cheap netbook or tablet pc...

воскресенье, 4 декабря 2011 г.

One thing I hate in FreeBSD...

One thing I hate in FreeBSD - is the speed of maintainence operations.
To install (or upgrade) one port you have to wait half an hour...
To update system with custom kernel/userland parameters, you should wait several hours... Then you call mergemaster, which asks you a dozen questions about config files (and most of changes doesn't impact on the current system, but just in case there is something important, you have to review them).
Comparing to "do-release-upgrade" on ubuntu, the speed of operation is unberable. And binary updates just don't do everithing you need (e.g. dtrace world, necessary ports options...)

среда, 9 ноября 2011 г.

VSS strange error on Windows 2008 x64

Today I spent 2 hours trying to make bacula fd work on Win2008 Server.
I got permanent error in event viewer:

Volume Shadow Copy Service error: A critical component required by
the Volume Shadow Copy service is not registered. This might
happened if an error occurred during Windows setup or during installation
of a Shadow Copy provider. The error returned from CoCreateInstance on
class with CLSID {e579ab5f-1cc4-44b4-bed9-de0991ff0623} and Name
IVssCoordinatorEx2 is [0x80040154, Class not registered].

Operation:
Instantiating VSS server


After googling for some time I found an answer: I had installed 32-bit bacula version by mistake... After installing 64-bit version, everything started working...

вторник, 1 ноября 2011 г.

Yandex Server: Start indexing... Aborted

I know, that unix style is to avoid writing anything unnecessary.
Issue "dd if=/dev/sda1 of=/dev/sda2 bs=32M" and wait for 40 minutes without any diagnostics. In FreeBSD it is sometimes better - at least, you can hit Ctr^T.
But Yandex server is awsome:

# yandex-server --indexer -r /usr/local/etc/yandex/yandex.cfg
Yandex.DsIndexer
This program is a part of Yandex.Software 2010.9.0
Copyright (c) 1996-2009 OOO "Yandex". All rights reserved.
Call software@yandex-team.ru for support.
Product ID: ENT-030-2010.9.0
Config file '/usr/local/etc/yandex/yandex.cfg' was parsed with the message(s):
Processing of '/usr/local/etc/yandex/yandex.cfg':
Warning at line 5, col 2: section 'Server' not allowed here and will be ignored.

Start indexing...

Start indexing...
Aborted

WTF? Logs contain:

Working with "webds" data source...
Mon Oct 31 16:56:33 2011 [Webds] [INFO] - Indexing: datasource webds opened successfully
Indexing was finished at Mon Oct 31 16:56:33 2011
It has been indexed 0 documents.
Index contains 0 documents.
Error: std::bad_alloc
Indexing was started at Mon Oct 31 16:57:08 2011


It turned out that container with Yandex Server just had not enough allocated memory... After increasing it from 128 to 512 MB the server started creating indexes...