Challenge goes on…

Yes! I did it and have made my way into the second round of Linux competition presented and organized by Yandex. Unfortunately, due to an upcoming trip to Nizhniy Novgorod I have serious doubts I would be able to participate since my train will bring me back to Moscow five minutes after of the start of the game. Hopefully, I could use WiMax to jump into the fray right from the railway station sitting on the platform near the tracks. Anyway, it should be fun and in the end hardship makes us stronger. Peace…

Posted on October 21, 2010 at 12:23 pm by sergeyt · Permalink · Leave a comment
In: Life, Linux

How to replace a PCIE card in Sun Cluster

I’ve just returned from a quick trip to Nizhniy Novgorod where I had to replace a PCIE card, it was an ethernet adapter (e1000g). Not a big deal, sure, but the tricky part lied in the fact that this card was a part of Sun Cluster setup so I had deliberately chosen a slippery path called DR or dynamic reconfiguration. Actually, it’s not that difficult at all as it might seem at first. Let’s make the long story short…
In my case it was in Intel-based ethernet adapter (e1000g) with two ports: one for the public network (e1000g2) and the other for the private interconnect between clusters (e1000g3). To be able to DR the adapter it must be properly unconfigured and taken out of the OS’s control. Otherwise cfgadm would complain saying the device is busy and won’t let you to remove the card.

  1. First, lets migrate the public IP address to another interface frm the same IPMP group.
    # if_mpadm -d e1000g2
    
  2. Next, take the public interface out from IPMP group. And don’t forget to unmplub it – it’s mandatory.
    # ifconfig e1000g2 group ""
    # ifconfig e1000g2 unplumb
    
  3. Make a record of the current cluster interconnect configuration:
    # clintr show
    # clintr status
    
  4. Disable the cluster’s interconnect cable:
    # clintr disable node1:e1000g3,node2:e1000g3
    
  5. Now you could safely tamper with the PCIE card through the list of the well-know Solaris commands:
    # cfgadm -c unconfigure iou#1-pci#3
    # cfgadm -c disconnect iou#1-pci#3
    
  6. Physically replace the card and add it back into the Solaris OS:
    # cfgadm -c connect iou#1-pci#3
    # cfgadm -c configure iou#1-pci#3
    
  7. Add back the previously removed interconnect cable:
    # clintr enable node1:e1000g3,node2:e1000g3
    
  8. If required plumb and failover the IP for the second port (e1000g2). In my case though, that was done automatically as soon as I configured the PCIE card. Just run the following commands if you have to do that manually. I used sc_ipmp0 as a IPMP group name but in your case it could be different.
    # ifconfig e1000g2 plumb
    # ifconfig e1000g2 group sc_ipmp0
    # if_mpadm -r e1000g2 

Hope it would help someone.
Cheers.

Posted on October 15, 2010 at 4:40 pm by sergeyt · Permalink · Leave a comment
In: Solaris

FreeNAS with MegaRAID SAS 9240-8i

Recently I’ve been involved in a small project to add a support for MegaRAID SAS 9240-8i into FreeNAS 0.71. To tell the truth it was fun since I haven’t been tinkering FreeBSD for quite a long time. Anyway, if you need a support for this card in your FreeNAS installation just download and unpack the kernel from here.

Posted on September 30, 2010 at 7:10 pm by sergeyt · Permalink · Leave a comment
In: FreeBSD

Permanent memory’s riddle

Several days ago I noticed that something wrong was happening with the way cfgadm reported the size of the permanent memory. On a partitioned SunFire 6900 iron with two SBs (SB0 and SB2) in a domain the output looks the following:

cfgadm -alv | grep perm
N0.SB0::memory connected configured ok base address 0x0, 33554432 KBytes total, 33403472 KBytes permanent

I don’t believe in coincidences and the fact that permanent memory was equal to the size of one SB’s memory had raised an eyebrow.

# prtconf | grep Mem
Memory size: 65536 Megabytes

We all know that a permanent memory is Kernel plus OpenBoot and if cfgadm was correct then it’s an easy deal to check that with mdb but…

# echo "::memstat" | mdb -k
Page Summary                Pages                MB  %Tot
------------     ----------------  ----------------  ----
Kernel                     129720              1013    2%
Anon                      1357367             10604   16%
Exec and libs               30298               236    0%
Page cache                 278509              2175    3%
Free (cachelist)          1858089             14516   23%
Free (freelist)           4581704             35794   56%

Total                     8235687             64341
Physical                  8226460             64269

There is an Oracle Standby running inside this domain and the output of “ipcs -ma”, as expected, almost exactly matches with ‘Anon’ section from the aforementioned mdb’s output and when the standby is stopped anonymous memory reduces proportionally. But why on the earth cfgadm produces such an outrageous report?! Reboot doesn’t help and the system is fully patched using, yes a bit outdated, EIS DVD from the 30th of March 2010.

# uname -a
SunOS sf6900-2-da 5.10 Generic_142900-07 sun4u sparc SUNW,Sun-Fire

So far, the answer to this puzzle is yet to be found but if you have a solution on your hands than please give me a hint. ;-)

P.S. This system doesn’t have a support contract so opening a ticket on the sunsolve is not an option.

Posted on September 20, 2010 at 10:11 am by sergeyt · Permalink · Leave a comment
In: Solaris

Oracle Solaris 10 9/10

Oracle Solaris 10 9/10 What’s New

Posted on September 8, 2010 at 5:06 pm by sergeyt · Permalink · Leave a comment
In: Oracle, Solaris

Oracle Solaris Cluster 3.3

Oracle Sun Cluster 3.3 has been announced.

Read Release Notes to get an idea of what has changed since the previous release.

Posted on September 8, 2010 at 4:26 pm by sergeyt · Permalink · Leave a comment
In: Oracle, Solaris

Mirroring root disk on HP-UX 11iv3

This post have been resting in a dust a way too long but now I’m going to fix that by guiding you through a very important and sometimes a vital process as a root disk mirroring on HP-UX. Truth to be told that there is no single grain of rocket science so treat it as a pure reference. Lets imagine that disk3 is a current boot device and disk5 will be our new mirror.

  1. Run the following commands to determine the size (in megabytes) of EFI, HP-UX and HSPS of the boot device:
  2. # diskinfo -b /dev/rdisk/disk3_p1 | awk '{print $1/1024}'
    # diskinfo -b /dev/rdisk/disk3_p2 | awk '{print $1/1024}' 
    # diskinfo -b /dev/rdisk/disk3_p3 | awk '{print $1/1024}'
    
  3. Next, prepare a file, i.e. /tmp/partitionfile, with the following content:
  4. 3
    EFI 500MB
    HPUX 100%
    HPSP 400MB
    
  5. It’s quite convenient to have a list of disks before making the changes so once they’re applied they will be vividly visible at once:
  6. # ioscan -fnC disk
    # ioscan -m dsf
    
  7. Create the partitions on a new disk and with insf command make them available to OS by creating the device files:
    # idisk -f /tmp/partitionfile -w /dev/rdisk/disk5
    # insf -e 
    
  8. Make it bootable:
  9. # pvcreate -f -B /dev/rdisk/disk5_p2 
    
  10. Extend the root volume group:
  11. # vgextend vg00 /dev/disk/disk5_p2 
    Volume group "vg00" has been successfully extended.
    Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
    
  12. To complete the setup of the disk as a boot disk run mkboot command:
  13. # mkboot -e -l /dev/disk/disk5
    

    The -e option tells mkboot to use EFI layout and the -l option tells mkboot that this volume will be used by a volume manager (even if it is not currently used by one)

  14. Create a temporary AUTO file and use the efi_cp command to copy it to the mirror, using the block device of the first (EFI) partition. The –lq option ensures that the system will boot without quorum. In the event of the primary boot disk failing this will allow the mirror disk to boot.
  15. # print 'boot vmunix -lq' > /tmp/AUTO
    # efi_cp -d /dev/disk/disk5_p1 /tmp/AUTO EFI/HPUX/AUTO
    
  16. Now proceed with mirroring your logical volumes. I used pvdisplay to get an ordered list of the volumes to be able to create the mirrored volumes in the same order.
  17. # pvdisplay -v /dev/disk/disk3_p2 | grep "current.*00000"
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol1 /dev/disk/disk5_p2
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol2 /dev/disk/disk5_p2
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol3 /dev/disk/disk5_p2
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol4 /dev/disk/disk5_p2
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol5 /dev/disk/disk5_p2
    ...
    
  18. Prepare LVM logical volume to be root, boot, primary swap, or dump volume:
  19. # /usr/sbin/lvlnboot -b /dev/vg00/lvol1
    # /usr/sbin/lvlnboot -r /dev/vg00/lvol3
    # /usr/sbin/lvlnboot -s /dev/vg00/lvol2
    # /usr/sbin/lvlnboot -d /dev/vg00/lvol2
    # /usr/sbin/lvlnboot –R
    
  20. Finally, add the new disk to boot device configuration table:
  21. # /usr/bin/echo “l /dev/disk/disk5_p2” >> /stand/bootconf
    
  22. Set the alternate boot path to the mirror_disk:
  23. # /usr/sbin/setboot -a /dev/disk/disk5_p2
    
  24. If the mirror disk includes an HPSP partition, use the efi_fsinit command on the character device file for the HPSP (third) partition to initialize it with an EFI file system:
  25. # /usr/sbin/efi_fsinit -d /dev/rdisk/disk5_p3
    
Posted on September 2, 2010 at 7:17 pm by sergeyt · Permalink · 6 Comments
In: HP-UX

What a day!

Today was one of those strange days when everything is changing so quickly that it’s simply impossible to grasp a single moment of your life. Sometime I wish I had a pause button somewhere to fix that. Oddities. During the day I was using a subway quite extensively and every time I entered a car there was a homeless reeking so hard and badly making an impression that a tear-gas grenade had just exploded. Lesson learned. If you think you know everything my advise just go through a job interview to make this illusion to dissolve. The advantage of this is that the skills and knowledge that have been buried deeply inside your mind could be revived quickly in a flash. Too bad for you, if you like me, could remember a right answer one hour after the interview and when it’s too late. There no such thing as a rewind button and the time machine is yet to be invented, so just try to be more collected the next time.

Good luck, my friend.

Posted on September 1, 2010 at 11:45 pm by sergeyt · Permalink · Leave a comment
In: Life

Back from vacation

Smooth and sunny days are now over and I’m back to the city’s jungles. Two weeks have passed quicker than an eye blink adding another fistful of memories and joy. The autumn is approaching and its gait is getting louder with every day. It’s raining. The office’s window is covered with myriads of raindrops which will evaporate as soon as it stops falling down. Moody brooding has taken over myself and it’s a clear indication that it’s time to change something in the life.

Posted on August 26, 2010 at 5:05 pm by sergeyt · Permalink · Leave a comment
In: Life

Mine Redmine

Hi there, it’s been quite a while since I’ve posted here but anyway, today I’d like to share a personal experience on installing Redmine on Ubunto server with mod_cgi. Yes, I’m aware about the Official HowTo but it lacks several steps which are not obvious if you haven’t read Generic Installation Instructions beforehand and expect that apt-get will do all the job for you – it will not.

So, let’s begin…

  1. Install the required packages. If you’re planning to use another DB then obviously you should select a different redmine-dbname package:
    # apt-get install redmine redmine-mysql
    
  2. Create redmine’s database configuration file /etc/redmine/default/database.yml:
    production:
      adapter: mysql
      database: redmine
      host: localhost
      username: redmine
      password: pa55w0rd
      encoding: utf8
    
  3. Create a dispatch.cgi file /user/share/redmine/public/dispatch.cgi:
    #!/usr/bin/ruby
    
    require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
    
    require "dispatcher" 
    
    ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
    Dispatcher.dispatch
    

    Note. Another option is simple as coping /user/share/redmine/public/dispatch.rb to /user/share/redmine/public/dispatch.cgi.

  4. Configure Apache by adding redmine’s virtualhost section similar to the one presented below:
    <VirtualHost *:80>
            ServerName redmine.<YOUR-DOMAIN>.com
            ServerAdmin webmaster@<YOUR-DOMAIN>.com
            DocumentRoot /usr/share/redmine/public/
            ErrorLog logs/redmine_error_log
    
            <Directory "/usr/share/redmine/public/">
                    Options Indexes ExecCGI FollowSymLinks
                    Order allow,deny
                    Allow from all
                    AllowOverride all
            </Directory>
    </VirtualHost>
    
  5. Next, you’ll have to create either /usr/share/redmine/public/.htaccess file or add the following lines into redmine’s virtualhost section:
    RewriteEngine On
    RewriteRule ^$ index.html [QSA]
    RewriteRule ^([^.]+)$ $1.html [QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
    
  6. Change to /usr/share/redmine and create the database structure:
    # cd /usr/share/redmine 
    # RAILS_ENV=production rake db:migrate
    
  7. Insert default configuration data into the database:
    # RAILS_ENV=production rake redmine:load_default_data
    
  8. The last step is to enable email notifications. To do that edit /etc/redmine/default/email.yml as follows:
    production:
        delivery_method: :sendmail
    

    If you don’t have /usr/sbin/sendmail in your system then there are other options you could use. For more details, please, go here. And don’t forget to restart Apache when you’re done.

  9. Finally, try to access Redmine by going to http://redmine.YOUR-DOMAIN.com url and providing admin/admin to login into the administration account.

The configuration presented above would work with mod_cgi. But there is a problem – it’s slow. To add some speed use passenger module which noticeably increases Redmine experience.

  1. Stop apache and delete dispatch.cgi and .htaccess file you’ve created earlier.
  2. Install the module itself:
    # apt-get install libapache2-mod-passenger
    
  3. Edit /etc/apache2/mods-available/passenger.conf and add:
    PassengerDefaultUser www-data
    
  4. Return to the virtualhost section of your site:
    <VirtualHost *:80>
        ServerName www.myredmine.com
        DocumentRoot /usr/share/redmine/public
    
       RailsEnv production
       RailsBaseURI /
       PassengerEnabled On
       SetHAndler none
       PassengerAppRoot /usr/share/redmine
        <Directory /usr/share/redmine/public>
            Allow from all
            Options -MultiViews
        </Directory>
    </VirtualHost>
    
  5. Restart Apache and you’re ready to go.
  6. Posted on July 19, 2010 at 2:19 pm by sergeyt · Permalink · One Comment
    In: Linux