пятница, 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...

среда, 19 октября 2011 г.

PostgreSQL: server closed connection

Today I got a ton of messages

DBI connect('dbname=xxx;host=yyy','username',...) failed: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request. at....


from our network statistic collector.
I spent some time trying to understand what had happened (besides yesterdays power fail). I looked at PostgreSQL server debug log (it honestly told that client just closed connection). There were no traces of dying postgres backend. I rolled back some minor configuration changes which I made yesterday... And later it downed upon me: it was just one old server which was supposed to have its network interface shut down waked after power failure... It was seen in dmesg:

arp: x.y.z.w moved from AA:AA:AA:AA:AA:AA to BB:BB:BB:BB:BB:BB on em0
arp: x.y.z.w moved from BB:BB:BB:BB:BB:BB to AA:AA:AA:AA:AA:AA on em0


Really, power cycling is neccessary sometimes to ascertain that all your services are configured properly :)

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

OpenVZ and Java

Today we encountered interesting bug in Proxmox 1.9. Java works in container very slow and randomly fails. There are two possible workarounds: provide at least two CPUs to container or downgrade kernel to 2.6.32-4-pve. I've opted for the first way.

суббота, 24 сентября 2011 г.

Adding vdev to raidz pool

There is one fundamental flaw in raidz ZFS pools: you can't add devices to raidz (as opposed to usual raid5). So, could we do anything to expand our pool without full rebuilding? Yes, if we are ready to sacrifice one more disk.
From zpool man page:

A pool can have any number of virtual devices at the top of the config‐
uration (known as "root vdevs"). Data is dynamically distributed across
all top-level devices to balance data among devices. As new virtual
devices are added, ZFS automatically places data on the newly available
devices.

So, to add some capacity to our pool, we can add one more raidz to it. Let's look at this process. Firstly, let's create test pool from three "disks":

freebsd# foreach i ( 1 2 3 4 5 6)
foreach? dd if=/dev/zero of=/tmp/disk$i bs=100M count=1
foreach? end
freebsd# zpool create testpool raidz /tmp/disk1 /tmp/disk2 /tmp/disk3

Now, let's see what we have:

freebsd# zpool status testpool
pool: testpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
testpool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
/tmp/disk1 ONLINE 0 0 0
/tmp/disk2 ONLINE 0 0 0
/tmp/disk3 ONLINE 0 0 0

errors: No known data errors
freebsd# zpool list testpool
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
testpool 286M 156K 286M 0% ONLINE -
freebsd# zfs list testpool
NAME USED AVAIL REFER MOUNTPOINT
testpool 95.9K 158M 28.0K /testpool

Now let's expand this pool:

freebsd# zpool add testpool raidz /tmp/disk4 /tmp/disk5 /tmp/disk6

So, we recieved the following configuration:

freebsd# zpool status testpool
pool: testpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
testpool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
/tmp/disk1 ONLINE 0 0 0
/tmp/disk2 ONLINE 0 0 0
/tmp/disk3 ONLINE 0 0 0
raidz1 ONLINE 0 0 0
/tmp/disk4 ONLINE 0 0 0
/tmp/disk5 ONLINE 0 0 0
/tmp/disk6 ONLINE 0 0 0

errors: No known data errors
freebsd# zpool list testpool
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
testpool 572M 210K 572M 0% ONLINE -
freebsd# zfs list testpool
NAME USED AVAIL REFER MOUNTPOINT
testpool 114K 349M 28.0K /testpool

Let's compare this to raidz from 6 disks:

freebsd# zpool create testpool raidz /tmp/disk1 /tmp/disk2 /tmp/disk3 /tmp/disk4 /tmp/disk5 /tmp/disk6
freebsd# zpool status testpool
pool: testpool
state: ONLINE
scrub: none requested
config:

NAME STATE READ WRITE CKSUM
testpool ONLINE 0 0 0
raidz1 ONLINE 0 0 0
/tmp/disk1 ONLINE 0 0 0
/tmp/disk2 ONLINE 0 0 0
/tmp/disk3 ONLINE 0 0 0
/tmp/disk4 ONLINE 0 0 0
/tmp/disk5 ONLINE 0 0 0
/tmp/disk6 ONLINE 0 0 0

errors: No known data errors
freebsd# zpool list testpool
NAME SIZE USED AVAIL CAP HEALTH ALTROOT
testpool 572M 147K 572M 0% ONLINE -
freebsd# zfs list testpool
NAME USED AVAIL REFER MOUNTPOINT
testpool 112K 443M 34.9K /testpool

So, we lost more then 21% of space, but expanded our pool without downtime. Firstly, the lost of more then 20% space suprised me, but 20% was expectable (in second case only 5 disks, in first - 4, so 20% is the difference).
Let's see, where did 1 percent go. 443 MB is useful in second case, it means about 11.4 MB (100 /*disk size*/ - 443/*useful space*/ / 5 /*useful disks*/) metadata per disk. In first case we have 349 MB. It is provided by two pools with 2 useful disks in each. So, wasted space per disk is 12.75 MB (100 - 349/2/2). It seems, in this configuration we have a bit more metadata.

среда, 21 сентября 2011 г.

PostgreSQL 9.1 create extension and database upgrade

Yesterday I was eager to try some new 9.1 features, in particular to experiment with exclude constraints (I've read they were improved since 9.0). So, I decided to upgrade my test 9.0 installation. It worth mentioning that it was 8.4 installation, previously upgraded to 9.0.
Everything went as expected, even my C functions were successfully recompiled without any warnings.
So, I decided to try extensions. I had hstore module installed in my db, so I issued "create extension" and received the following error:


db=# CREATE EXTENSION hstore WITH SCHEMA public FROM unpackaged;
ERROR: function hstore_recv(internal) does not exist


I looked at hstore definition in /usr/local/share/postgresql/extension/hstore--1.0.sql, copied definition of this function, created it, but received error saying that some other function doesn't exist.
So I run full script to create unpackaged extension:

# sed -e 's|MODULE_PATHNAME|$libdir/hstore|' < /usr/local/share/postgresql/extension/hstore--1.0.sql | su pgsql -c 'psql -d db '

After that it was possible to create extension:

db=# CREATE EXTENSION hstore WITH SCHEMA public FROM unpackaged;


It seems that the reason for this behavior is that I didn't upgrade hstore module after upgrading database from 8.4 to 9.0...

воскресенье, 18 сентября 2011 г.

Extracting domain name from uri with SQL

I don't know if it is effective, but this ugly SQL (in PostgreSQL dialect) extracts domain name part from uri (i.e. translates protocol://something/page into "something"):

SELECT uri, substring (uri from position('//' in uri)+2 for ( char_length(uri) - char_length(substring (uri from position ('/' in substring ( uri from position('//' in uri)+2 )) ) ))) from proxy_data

It seems, it would look better with regexp:
 
select uri, substring ( substring (uri from '//[[:alnum:]\._\-]+') from 3) from proxy_data

However, in later case we should list all possible symbols in domain name in our regexp.

воскресенье, 28 августа 2011 г.

Change user password in script on FreeBSD host

Changing user password in script on FreeBSD host turned out to be very simpe. Use "pw" for this purpose:

echo "user_password" | pw usermod -V /jails/myjail/etc -h 0 username

понедельник, 15 августа 2011 г.

среда, 6 июля 2011 г.

SMS notifications in OpenNMS

We just got a lot of problems when our air conditioning system controller in data center went mad and didn't notice the failure of two air conditioners. The 60 Celsius degrees is not the best temperature for servers operations...
After dealing with this situation we decided to setup SMS-notification service at least for temperature in server room and several other parameters. We already had OpenNMS monitoring system configured, so we had to add SMS-notification to our setup.
This task was done in several steps. First of all, we created a script which would send SMS. We used Google Calendar for this purpose. One dedicated user (let's say opennms) was created for our monitoring system and all system administrators imported his calendar with the following notification settings:

  • Events reminders - By default remind me via sms 1 minutes before each event

  • New Invitations - SMS


Of course, system administrators had to register their phone numbers in Google Calendar.
When we want to send SMS notification, we create new event in opennms's calendar using gcalcli for this purpose.
We used the following script to create a new event (sleep was inserted to prevent mass event creation in case when everything is bad):

#!/bin/sh
H=$(/bin/date "+%H")
M=$(/bin/date "+%M")
sleep 1
event_text="$H:$M $@"
/usr/local/bin/gcalcli --user opennms --pw OurPassword --cals=owner quick "$event_text"


Then, we described a notification command in /usr/local/opennms/etc/notificationCommands.xml:

<command binary="true">
<name>SendSMS</name>
<execute>/root/bin/send_sms.sh</execute>
<comment>Send SMS by gcalcli</comment>
<argument streamed="false">
<switch>-subject</switch>
</argument>
<argument streamed="false">
<switch>-tm</switch>
</argument>
</command>

Argument elements describe script parameters, here we pass it notice subject and notice body (full list of possible parameters may be found here).

Later we created a destinationPath in /usr/local/opennms/etc/destinationPaths.xml:

<path name="SMS-Admins" initial-delay="0s">
<target interval="0s">
<name xmlns="">admin</name>
<autoNotify xmlns="">auto</autoNotify>
<command xmlns="">SendSMS</command>
</target>
</path>

You have to set some legal OpenNMS user or group here (in name target's sub-element).

Now you can create some notifications using OpenNMS Web UI. To control outstanding characteristics of certain parameters you should set trigger event to uei.opennms.org/threshold/highThresholdExceeded and set destinationPath for it to "SMS-Admins". You can do it by hand, adding the following entry to /usr/local/opennms/etc/notifications.xml:

<notification name="High Threshold" status="on" writeable="yes">
<uei xmlns="">uei.opennms.org/threshold/highThresholdExceeded</uei>
<description xmlns="">High threshold exceeded</description>
<!-- some filter -->
<rule xmlns="">(NODELABEL = 'our label')</rule>
<destinationPath xmlns="">SMS-Admins</destinationPath>
<text-message xmlns="">The parameter %parm[ds]% is high on node: %nodelabel%, interface:%interface%. The parameter %parm[ds]% reached a value of %parm[value]% while the threshold is %parm[threshold]%. This threshold for this alert was %parm[threshold]%.</text-message>
<subject xmlns="">Notice #%noticeid%</subject>
<numeric-message xmlns="">111-%noticeid%</numeric-message>
</notification>


The only interesting question I have now is how to do notification only for several thresholds. Just for now I deleted all unimportant (for me) thresholds. It would be cool, however, to specify instead in notification description only thresholds you are interested in...

среда, 15 июня 2011 г.

среда, 1 июня 2011 г.

A little joke: Oracle donates openoffice.org code to Apache Foundation...

I've just had something like little orgasm on reading this piece of news... Oracle managers are genii, you can't underestimate this joke. We are goody-goody, we support open source, and you (Document Foundation) are in deep arse: try to compete with ASF, if you can :)

вторник, 24 мая 2011 г.

Never get involved with Coral Travel or Odeon Tours

I dislike complaining. But Russian and Turkish travel agencies Coral Travel and Odeon Tours made everything to spoil my holidays. Their attempt was unsuccessful, but very serious...
At first, Coral played with flight time table: while buying a tour I was promised to have a flight at 6.00. In fact we left at about 18.00. We were notified that flight would be postponed till 16.00 , but after arriving to our airport, we found out that the flight was postponed till 17.30 or something like that. In fact, we left about 18.00.
Further worries were connected with work of hotel guide (from Odeon Tours). First of all, we didn't get his contacts and were informed that he could be found at hotel reception the next day at 9 o'clock. Luckily, we didn't need his service...
When we met the guide, he suggested us to go to different excursions. Later we found out that suggested prices were at least twice higher than prices of other tour operators. For example, we liked prices and excursions suggested by Maxwell travel agency, their office could be found accross the road from our hotel (Sea Gull Hotel). The hotel guide talked out of renting a car or a bike. In my opinion, he didn't want his company to be responsible in case of car accident. More on that - he significantly overstated the price of bus ticket to Kemer (it seems, for the same reason)... He even stated that if we would have some accidents during our excursions with other travel agency, nor Odeon Tours, nor Coral Travel would be responsible.
But that's not all. There was an evident deal between our travel agency and the hotel administration. We were told that hotel wouldn't provide us packed lunch when we visit excursions held by another tour operator (but the hotel would provide it if went to Coral/Odeon excursions).

To summarize, I liked my holidays in Turkey, but it was despite the behavior of my tour operator.

P.S. I read a lot of negative reviews on Sea Gull Hotel. Don't believe them! Our room was cleaned regularly (thanks to Fatima, who decorated our room with flowers), staff was responsive (and most of them spoke Russian) and food was good. It would be good to have free sport inventory (such as tennis rackets), but what do you want - it is not a 5-star hotel. At least there was rather normal fitness center: not super, but it had enough inventory for you to keep shape.

четверг, 5 мая 2011 г.

Two useful illumos-related links

I've just found two interesting resources:

  • planet.illumos.org site - it's always interesting to know what is happening in opensource Solaris. I'm still looking at this project. We'll hardly make something like OpenIndiana our main platform, but for me it's a preferrable alternative to Linux where FreeBSD is not the best sollution (e.g. I'd prefer to use something Solaris-based for hardly loaded file server because of some stability issues with ZFS in FreeBSD and we still should decide what to do with our existing SXCE-based terminal servers). And planet.opensolaris.org became very quiet now..

  • src.illumos.org - sometimes you just have to look at some subsystem to understand what has gone wrong. Web access to code is useful thing to have for such cases.



And I would like to play with stable OpenIndiana release. In particular it's interesting to see how do it deal with multipath on our EMC Clarion storage.

среда, 20 апреля 2011 г.

вторник, 19 апреля 2011 г.

вторник, 12 апреля 2011 г.

Russian game in Democracy...

AFAIK, our university is to participate in conference with Mironov (speaker of the Council of the Federation). I've already seen all planned questions.... I feel there are prepared answers for these questions already. Are they crazy? Why should anyone make a conference (and why should anyone spend money on this conference), when this conference is a pure farce? I know, in Soviet time there were elections with one surname in ballot papers. Is anything changing?
I hate such games in democratic country and hate these clowns who parasitizes on usual people...

суббота, 9 апреля 2011 г.

Shit happens (serious bug in PostgreSQL pg_upgrade)

I've just found out the following info: due to bug in pg_upgrade all users of pg_upgrade MAY LOOSE DATA.. Fix and details are available here.

четверг, 7 апреля 2011 г.

Vacation Plasmoid

I've just created a plasmoid which shows time remaining till vacation... Now it shows 35 days. However, I'll have some holidays sooner. I'll publish code as soon as plasmoid is rather functional :)

пятница, 1 апреля 2011 г.

Weird boot0 behavior


It seems I've found one interesting bug in FreeBSD boot0. The long story is the following. We deploy new systems on IBM blade servers. After some local fixes made by Oleg we made FreeBSD gmultipath work with our EMC Clarion storage. However, we observed strange behavior. Periodically systems refused to boot. We could see only black screen and no usual "F1: FreeBSD" boot0 prompt. This was healed by some tricks - in particular we were able to make two servers boot in all cases by some BIOS and FC adapter settings. However, all these tricks (particular FC adapter settings, disabling Planar SAS and unnecessary boot methods in BIOS) didn't help in last case. It took about a week to make last server boot. At last I've found the certain bug in boot0.


I cassually stepped on this. I've tried to install boot2 loader from current and instead of "bsdlabel -e " executed "bsdlabel -w". And system booted 10 times in a row (to a point before mounting local filesystems). Luckily, "/" filesystem was on the first BSD partition. "bsdlabel -w" rewrote partition table and made one partition on whole slice. Root ("/") could be mounted, other filesystems were lost. So, OS was able to boot to a certain stage. There could be two reasons which influenced boot0 behavior: existence of several partitions and their labels. So I recreated partition table and labeled all BSD partitions as "unused" (instead of "4.4BSD"). This helped. System boots now without any random failures (at least it boots 12 times in a row).
I've created a bug entry for this boot0 failure and started to setup a new FreeBSD server... Why do partition labels influence boot0? I don't know, maybe it's related to OS probing (when boot0 writes "F1: FreeBSD" and not "F1: Disk1"). At least, I'm rather happy: we inclined to install Linux on our blades in case if we wouldn't be able to make FreeBSD booting robust. So I shouldn't learn OpenVZ peculiarities and bugs and can use familiar jail infrastructure (we are going to deploy vnet jails). And ZFS for storing jail images and applications' data. This is a killer feature of FreeBSD which made me struggle for a week :)

пятница, 18 марта 2011 г.

Normal ping in Solaris

I always disliked default behavior of Solaris ping:

me@host$ ping example.org
example.org is alive

Luckily, ping has "-s" parameter.

me@host$ ping -s example.org
PING example.org: 56 data bytes
64 bytes from example.org (192.168.1.1): icmp_seq=0. time=0.214 ms
64 bytes from example.org (192.168.1.1): icmp_seq=1. time=0.317 ms
64 bytes from example.org (192.168.1.1): icmp_seq=2. time=0.222 ms
64 bytes from example.org (192.168.1.1): icmp_seq=3. time=0.202 ms
^C
----example.org PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.202/0.239/0.317/0.053


Less known feature is MACHINE_THAT_GOES_PING environment variable, available at least in all recent OpenSolaris versions and derivatives. When it set, '-s' key is set by default.

me@host$ export MACHINE_THAT_GOES_PING=1
me@host$ ping example.org
PING example.org: 56 data bytes
64 bytes from example.org (192.168.1.1): icmp_seq=0. time=0.218 ms
64 bytes from example.org (192.168.1.1): icmp_seq=1. time=0.218 ms
64 bytes from example.org (192.168.1.1): icmp_seq=2. time=0.193 ms
^C
----example.org PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.193/0.210/0.218/0.014


Now I'm going to add this variable to my .profile :)

вторник, 15 марта 2011 г.

PostrgreSQL pgarch_ArchiverCopyLoop

Today I had an interesting experiment while tuning our new PostgreSQL server. I powered it off during operation. PostgreSQL restored after reboot and was rather happy after restoring from log files in pg_xlog, but later it began to swear:

Mar 15 17:36:01 pgsql pgsql[1579]: [10-2] db , client , user LOCATION: pgarch_ArchiverCopyLoop, pgarch.c:466
Mar 15 17:37:03 pgsql pgsql[1579]: [14-1] db , client , user WARNING: 01000: transaction log file "00000001000000170000007E" could not be archived: too many failures

It seems that during power failure one log was archiving and as result file "00000001000000170000007E.bz2" existed in archive. So, PostgreSQL refused to overwrite it (test -f returned not 0). So, I moved that file to other directory and postgresql created new archive copy of this wal file. I compared md5 sums of original log file in pg_xlog and archived one, they matched and I deleted old copy. It seems that bzip2 process was interrupted during power failure. It's a good expirience: it confirms that my archive_command

/bin/test ! -f /path/to/archived/logs/%f.bz2 && /bin/cat %p | /usr/bin/bzip2 -c > /path/to/archived/logs/%f.bz2'
is right.

понедельник, 14 марта 2011 г.

POSIX rules, bashism sux, and shell is a great tool...

Just one link. Here I found a lot of useful advices and tricks concerning writing scripts in POSIX shell. As I'm really fond of shell, I'd like to share this link...

FreeBSD, Java plugin and Firefox 3.6

I've just found out, that java plugin is working on FreeBSD with Firefox 3.6 and OpenJDK (openjdk6-b21_3). You just need to compile openjdk port with WEB option and later do

ln -s /usr/local/openjdk6/jre/lib/IcedTeaPlugin.so ~/.mozilla/plugins/

I can't determine the quality of plugin - all my admin applications work strange (don't work seems right expression), but it may be caused by SSH tunneling...

суббота, 5 марта 2011 г.

I like people filling oracle.com with info

Once you could see SPARK processors in Oracle portfolio, now we have Doc: Trace User's Guide. It seems that men filling these pages either have never listened about Sun or just sleep at work :)

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

Read UPDATING, Luck...

I spent weekend updating my desktop system. I've built 8.2, updated Xorg, KDE and different trifles. Finally I reinstalled autoconf,automake,libltdl,libtool, because portmaster couldn't update them (ports moved). Periodically I had to kill grep during port install, because I forgot to update portmaster. These two problems could be solved if I had read "UPDATING"... But the last one was interesting: I didn't manage to make xf86-video-ati work, system hanged with "radeon" driver and performance dropped significantly with "radeonhd". At last, I rolled back to using x11-drivers/xf86-video-ati613. I have to update other major ports (OpenJDK, Chromium, Firefox), but this can wait. I'm going to wait for Chromium 9 (which was promised to land in ports tree in March-April) and to replace OpenOffice with LibreOffice on this week...

среда, 16 февраля 2011 г.

Finally wine is fixed...

Finally one irritating wine bug was fixed. Now I've just updated my wine to 1.3.3 (I had this in my port tree) with applied suggested patch. Some windows applications still don't work on my desktop (FreeBSD 8.1, xf86-video-ati-6.13.2, wine-1.3.3). However, they work on Linux and Intel integrated video adapter, but it seems I should blame ati video driver for this. It seems that Intel is the best video adapter for Unix-like system. At least, I hope Intel will not make it unusable by dropping support for no-KMS mode.

четверг, 10 февраля 2011 г.

I hate state establishments

I hate Russian state establishments: they want you to fill a pill of papers to work for them and don't want to pay a penny for your job.

среда, 9 февраля 2011 г.

Some exotic licenses...

We all agree that 2-clause BSD-license is a suitable license for your software. But I have found two more interesting permissive licenses: Beer-ware license and more recently Do What The Fuck You Want To Public License.

More troubles with OpenVZ

I have two troubles with OpenVZ:
1) udevd works strange, in particular, /dev/ptmx gets incorrect permissions and so xterm, gnome-terminal, etc doesn't work. Solved it whith "chmod 666 /dev/ptmx" in rc.local
2) su doesn't work for usual user: asks a password, and when the password is correct, it returns immediately with "incorrect password", when the password is wrong, it returns the same after timeout. Decided to use sudo.

Vnc worked without surprises: just created necessary entries in /etc/sysconfig/vncservers:

VNCSERVERS="2:username"
VNCSERVERARGS[2]="-nohttpd"

I had to replace ~/.vnc/xstartup with the following to run gnome-session on each user login:

while /bin/true; do
/usr/bin/gnome-session
done


Now I have to install some supplementary software (OpenJDK, NetBeans, Oracle SQL Developer) and create template from this settings. After finishing deploying template, I'll have about 20 VMs for students...

OpenVZ and Oracle

I prepare for new Oracle course now. I'd like to provide every student a OpenVZ container running developer desktop and Oracle XE. Just for now, it seems XE runs normally in container. Just set SHMPAGES at least to 524288 in /etc/sysconfig/vz-scripts/<vid>.conf and install XE in container in the following way:

yum install libaio bc
rpm --nopre -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm
/etc/rc.d/oracle-xe configure

пятница, 4 февраля 2011 г.

A system must be configurable...

After reading Stonebraker articles, like this one. I can't decide if knobs are so bad. I tend to agree with this post... A system must be configurable, whatever other people think. I do like to have 1000 knobs in my application (or in system I support). It doesn't mean that I'm happy to tune them all, but I'd like to have a possibility of tuning them when something goes wrong. And I hate applications which try to be more clever than me....

четверг, 3 февраля 2011 г.

SPARC is not dead...

I have missed T3 benchmarks so far. It seems that SPARC clusters rule as ever. I suspect that T3 price is not such pleasant as its performance, however I'm glad to see prosperous non-x86 platform.
And we have just given away our last SPARC server (Sun Fire V440). I'd be glad to work with SPARC servers in the future, however, the probability of this is quite low.

воскресенье, 23 января 2011 г.

I'm going insane...

Sanity lost. I'm tired and doubtfull. Life is shit. And we are just an awful error of evolution... Let this world die in pain...

суббота, 22 января 2011 г.

PostgreSQL talk on NYC MySQL Group event at Oracle's New York headquarters

This talk by EnterpriseDB's CEO is just a general introduction discussing the place of PostgreSQL in modern world. It wasn't a technical talk. However, a lot of interesting question were concerened like PostgreSQL development model, necessity of RAC open source alternative, scaling on commodity servers and so on.

пятница, 21 января 2011 г.

Looking for virtualization solution

Now I'm looking something to replace VMware ESXi... So far I looked at XCP (xen cloud platform). It has issues running OpenIndiana, so it was not a best choice for me. Then I looked at OpenNode. But satisfactory WebUI was available only for latest beta version, and I didn't manage to make it working. Maybe I should look at Aeolus Project? When I return to this task, I'll give it a try. Just for now I'm going to deploy new PostgreSQL server in old proved FreeBSD jailed environment. At least its overhead and complexity is minimal...

пятница, 14 января 2011 г.

repmgr FreeBSD port

I've just managed to create initial prototype of repmgr port for FreeBSD. Port compiles, but repmgrd dumps core for unknown reason... Need to investigate. Shell archive of the port is provided.

Updated: repmgrd works fine with included patch.


# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# databases/postgresql-repmgr
# databases/postgresql-repmgr/Makefile
# databases/postgresql-repmgr/pkg-descr
# databases/postgresql-repmgr/distinfo
# databases/postgresql-repmgr/pkg-plist
# databases/postgresql-repmgr/files
# databases/postgresql-repmgr/files/patch-repmgrd.c
#
echo c - databases/postgresql-repmgr
mkdir -p databases/postgresql-repmgr > /dev/null 2>&1
echo x - databases/postgresql-repmgr/Makefile
sed 's/^X//' >databases/postgresql-repmgr/Makefile << '48fb6f3f1b95d8369d928a104f7bd6a3'
X# New ports collection makefile for: repmgr
X# Date created: January 15, 2011
X
XPORTNAME= postgresql-repmgr
XPORTVERSION= 1.0.0
XPORTREVISION= 0
XCATEGORIES= databases
XMASTER_SITES= http://projects.2ndquadrant.it/sites/default/files/
X#MASTER_SITE_SUBDIR= sites/default/files/
XDISTNAME= repmgr-${PORTVERSION}
X
XMAINTAINER= alp@sfedu.ru
XCOMMENT= PostgreSQL repmgr
X
XBUILD_DEPENDS+= postgresql-server>=9.0:${PORTSDIR}/databases/postgresql90-server
XRUN_DEPENDS:= ${BUILD_DEPNDS}
XRUN_DEPENDS+= rsync:${PORTSDIR}/net/rsync
X
XUSE_GMAKE= yes
XMAKE_ENV= USE_PGXS=1
X
XPORTDOCS= README.*
X
Xdo-install:
X ${INSTALL_PROGRAM} ${WRKSRC}/repmgr ${PREFIX}/bin
X ${INSTALL_PROGRAM} ${WRKSRC}/repmgrd ${PREFIX}/sbin
X.if !defined(NOPORTDOCS)
X @${MKDIR} ${DOCSDIR}
X ${INSTALL_DATA} ${WRKSRC}/README.rst ${DOCSDIR}
X.endif
X.if !defined(NOPORTDATA)
X @${MKDIR} ${DATADIR}
X ${INSTALL_DATA} ${WRKSRC}/repmgr.conf ${DATADIR}
X ${INSTALL_DATA} ${WRKSRC}/repmgr.sql ${DATADIR}
X.endif
X
X.include <bsd.port.mk>
48fb6f3f1b95d8369d928a104f7bd6a3
echo x - databases/postgresql-repmgr/pkg-descr
sed 's/^X//' >databases/postgresql-repmgr/pkg-descr << '4003202a12e35bb4d428938652326a06'
XPostgreSQL replication manager (repmgr)
X
XWWW: http://projects.2ndquadrant.com/repmgr
4003202a12e35bb4d428938652326a06
echo x - databases/postgresql-repmgr/distinfo
sed 's/^X//' >databases/postgresql-repmgr/distinfo << 'e1ae01bffabbb92bb754fc0eea6621aa'
XMD5 (repmgr-1.0.0.tar.gz) = e9a90058ff2ad81de20fd8dc7b8743f0
XSHA256 (repmgr-1.0.0.tar.gz) = b0345a9a32c3f3bab542c8d2ef72881f6f45b6c0d703f481998beb5755a1d79b
XSIZE (repmgr-1.0.0.tar.gz) = 35940
e1ae01bffabbb92bb754fc0eea6621aa
echo x - databases/postgresql-repmgr/pkg-plist
sed 's/^X//' >databases/postgresql-repmgr/pkg-plist << '1ca1316c7087064a99a71f8064202df0'
Xbin/repmgr
Xsbin/repmgrd
X%%DATADIR%%/repmgr.conf
X%%DATADIR%%/repmgr.sql
1ca1316c7087064a99a71f8064202df0
echo c - databases/postgresql-repmgr/files
mkdir -p databases/postgresql-repmgr/files > /dev/null 2>&1
echo x - databases/postgresql-repmgr/files/patch-repmgrd.c
sed 's/^X//' >databases/postgresql-repmgr/files/patch-repmgrd.c << '39954438281f6f4b810cfb628d4308b3'
X--- repmgrd.c 2010-12-06 05:09:48.000000000 +0300
X+++ repmgrd.c 2011-01-16 12:34:49.345998423 +0300
X@@ -173,7 +173,12 @@
X }
X
X /* close the connection to the database and cleanup */
X- CloseConnections();
X+ if (PQisBusy(primaryConn) == 1)
X+ CancelQuery();
X+ if (myLocalConn != NULL)
X+ PQfinish(myLocalConn);
X+ if (primaryConn != NULL && myLocalMode != PRIMARY_MODE)
X+ PQfinish(primaryConn);
X
X return 0;
X }
39954438281f6f4b810cfb628d4308b3
exit


четверг, 13 января 2011 г.

Should we wait for a first stable OpenIndiana release?

I'm excited: it seems OpenIndiana developers consider 148 build stable enough to provide release based on b148-b149 (as I understood, it will be based on latest freely available code from ONNV repository with several fixes and 148-149 builds of other consolidations). Security updates may be available for several core network services (Apache, PostgreSQL and other) for a period of about 6 months.
Long life to OpenIndiana!

Next great step planned for several next builds is moving to Illumos base, which can shake stability, so, it seems, there will be no possibility to make a "stable" release for several months after this serious shift.

вторник, 11 января 2011 г.

repmgr or manage your PostgreSQL cluster easily

I've looked through Greg Smith's post about repmgr and feel quite interested. As I understood, this utility significantly simplifies PostgreSQL cluster management. I'd like to test it this week. There are a lot of questions. Will this repmgr compile on FreeBSD? How will be fail of master processed? What will happen if master goes down, e.g. due to network failure, and then is reborn while old slave is a new master? What will happen if nodes are divided in several groups? We'll see. At least, first three questions are critical...

One more thing which I'd like to see in PostgreSQL is a transparent support for HA configurations from client library. The following scenario worked in Oracle RAC. We had two "IN A" DNS records for "oracle.our.domain" pointing to our RAC nodes, and applications transparently switched from one node to another on node's failure. More supported behavior was achieved by specifying both nodes in ADDRESS_LIST and using proper FAILOVER_MODE.

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

This drives me nuts...

I've tired to fight with OpenOffice Bibliograhy tool. It takes about 10 minutes to find and insert one bibliographic entry. Bibliography is stored in PostgreSQL database and is rather small (about 100 records). But OO just eats one CPU for several minutes while inserting new bibliography link. Really, buggy programs can spoil your mood.

суббота, 8 января 2011 г.

One wonderful thing

It seems I'm going insane, can't stop laughing for 5 minutes... Work really helps you to keep your mind and habits. I still have a half of dissertation to look through and correct. If I don't suicide while processing it, I may be rather exhausted and happy tomorrow evening.

среда, 5 января 2011 г.

Mark Zuckerberg's interview

I'd like to share Zuckerberg's interview I've just watched... At least, it was interesting. And I was shocked that man in 26 made a great job, but I can't even clean up my life or complete damned dissertation...

суббота, 1 января 2011 г.

Blood Diamond

I've just watched "Blood Diamond"... Sometimes it seems that there are too many different worlds. Different countries, different cultures, different way of life. Some people live in the state of permanent war. Developed countries are always parasitize on developing ones. And yes, our life is shit. But there are people for whom it's much worse.