Monday, April 7, 2014

Broadcom BCM 57810 Ethernet Driver for Linux Kernel 2.6.34


  1. Get the driver from here, look for Linux version.Once downloaded, extract the file and look for the following file: netxtreme2-7.8.56.tar.gz. (Your version might be different). It seems like there is some activity between Broadcom and Qlogic and now the nextreme2 drivers are housed on Qlogic website. The link should be this, if it is not accessible, you have to search within Qlogic site (look for the Downloads page).
  2. Copy this file to the machine where BCM 57810 in installed. Once copy, extract this using tar xvfz netxtreme2-7.8.56.tar.gz
  3. Go into this extracted directory and execute make l2build. If you see the following error, you need to edit a file in step 4, else just jump to step 5.
  4. cc1: all warnings being treated as errors
    make[3]: *** [/home/ceph-2/Downloads/netxtreme2-7.8.56/bnx2x-1.78.58/src/bnx2x_main.o] Error 1
    make[2]: *** [_module_/home/ceph-2/Downloads/netxtreme2-7.8.56/bnx2x-1.78.58/src] Error 2
    make[2]: Leaving directory `/usr/src/linux-2.6.34.11'
    make[1]: *** [bnx2x.o] Error 2
    make[1]: Leaving directory `/home/ceph-2/Downloads/netxtreme2-7.8.56/bnx2x-1.78.58/src'
    make: *** [l2build] Error 2
    
  5. Open this file - netxtreme2-7.8.56/bnx2x-1.78.58/src/Makefile and search for Werror. Comment away this line as shown below and save the file.
  6. ifeq ($(DISABLE_WERROR),)
            #override EXTRA_CFLAGS += -Werror
    endif
    
  7. Execute sudo make l2build install. Installation is successful if there is no error reported.
  8. Execute sudo modprobe bnx2x. If no error reported, you should be able to see this module when executing lsmod. Execute ifconfig should also show new interface.

Wednesday, November 27, 2013

YCSB on HBase 0.96 and Hadoop 2.2

My previous post on YCSB on HBase is for Hadoop 1.* and also HBase 0.94.*. And since Hadoop 2.2 is offcialy released and HBase also move to 0.96.0. I will share with you what to change to run YCSB on HBase 0.96 and Hadoop 2.2

The first step to use this benchmark is to donwload the source from YCSB git:
git clone http://github.com/brianfrankcooper/YCSB.git

Once the clone is done, you will see a folder call YCSB on your current path. cd into the newly created directory YCSB and edit the following files using your favorite editor.

-YCSB/hbase/pom.xml

Edit the corresponding line as shown below to reflect the changes.
For HBase, instead of using hbase, you need to change the artifactid to hbase-client and version to 0.96.0-hadoop2.
For Hadoop 2.2, there is no more hadoop-core and for YCSB to work, change the artifactid to hadoop-common and version to 2.2.0.


-YCSB/pom.xml

I pretty sure this is optional but for completeness, you can also choose to change the following


If you refer to my previous post, you notice i don't change slf4j version anymore. This is because HBase 0.96.0 also using same version as stated in the original pom.xml file which is 1.6.4.
cd into YCSB directory and run mvn clean package to build the package. Once you see the following output, it means the build is successful.

[INFO] YCSB Root ......................................... SUCCESS [40.653s]
[INFO] Core YCSB ......................................... SUCCESS [46.852s]
[INFO] Cassandra DB Binding .............................. SUCCESS [44.413s]
[INFO] HBase DB Binding .................................. SUCCESS [1:49.114s]
[INFO] Hypertable DB Binding ............................. SUCCESS [45.091s]
[INFO] DynamoDB DB Binding ............................... SUCCESS [38.011s]
[INFO] ElasticSearch Binding ............................. SUCCESS [3:22.121s]
[INFO] Infinispan DB Binding ............................. SUCCESS [2:43.266s]
[INFO] JDBC DB Binding ................................... SUCCESS [13.182s]
[INFO] Mapkeeper DB Binding .............................. SUCCESS [8.313s]
[INFO] Mongo DB Binding .................................. SUCCESS [5.941s]
[INFO] OrientDB Binding .................................. SUCCESS [15.621s]
[INFO] Redis DB Binding .................................. SUCCESS [4.171s]
[INFO] Voldemort DB Binding .............................. SUCCESS [14.630s]
[INFO] YCSB Release Distribution Builder ................. SUCCESS [13.381s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:45.433s
[INFO] Finished at: Thu Sep 12 18:25:37 SGT 2013
[INFO] Final Memory: 65M/165M
[INFO] ------------------------------------------------------------------------


You should be able to look for ycsb-0.1.4.tar.gz file inside YCSB/distribution/target directory. Copy this file to the directory where you have the access permission and untar it. Once untar, copy the hbase-site.xml file from your hbase conf directory to your ycsb-0.1.4/hbase-binding/conf/ directory. Also, you should copy the hadoop-auth-2.2.0.jar from your Hadoop installation directory to your  ycsb-0.1.4/hbase-binding/lib/ directory. If not, you might see the following error when you try to run YCSB.

Exception in thread "Thread-3" java.lang.NoClassDefFoundError: org/apache/hadoop/util/PlatformName
        at org.apache.hadoop.security.UserGroupInformation.getOSLoginModuleName(UserGroupInformation.java:303)
        at org.apache.hadoop.security.UserGroupInformation.(UserGroupInformation.java:348)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.hbase.util.Methods.call(Methods.java:39)
        at org.apache.hadoop.hbase.security.User.call(User.java:414)
        at org.apache.hadoop.hbase.security.User.callStatic(User.java:404)
        at org.apache.hadoop.hbase.security.User.access$200(User.java:48)
        at org.apache.hadoop.hbase.security.User$SecureHadoopUser.(User.java:221)
        at org.apache.hadoop.hbase.security.User$SecureHadoopUser.(User.java:216)
        at org.apache.hadoop.hbase.security.User.getCurrent(User.java:139)
        at org.apache.hadoop.hbase.client.HConnectionKey.(HConnectionKey.java:67)
        at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:240)
        at org.apache.hadoop.hbase.client.HTable.(HTable.java:187)
        at org.apache.hadoop.hbase.client.HTable.(HTable.java:149)
        at com.yahoo.ycsb.db.HBaseClient.getHTable(HBaseClient.java:118)
        at com.yahoo.ycsb.db.HBaseClient.update(HBaseClient.java:303)
        at com.yahoo.ycsb.db.HBaseClient.insert(HBaseClient.java:358)
        at com.yahoo.ycsb.DBWrapper.insert(DBWrapper.java:148)
        at com.yahoo.ycsb.workloads.CoreWorkload.doInsert(CoreWorkload.java:461)
        at com.yahoo.ycsb.ClientThread.run(Client.java:269)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

Before you can run the test, you need to start your hdfs (start-dfs.sh) and hbase (start-hbase.sh). Go into hbase shell and create a table call usertable with column family call family. You can ignore the warning message, you can refer to this link for more information.


After create the table and the column family, you can start loading data into your database

$ ~/ycsb-0.1.4/bin/ycsb load hbase -P ~/ycsb-0.1.4/workloads/workloada -p columnfamily=family -p recordcount=10000 -p threadcount=4 -s | tee -a workloada_load.dat

Start running the benchmark with the command below:

$ ~/ycsb-0.1.4/bin/ycsb run hbase -P ~/ycsb-0.1.4/workloads/workloada -p columnfamily=family -p operationcount=10000 -p recordcount=10000 -p threadcount=4 -s | tee -a workloada_run.dat

The steps above are very simple validation using workloada with only 10000 records loaded into database and 10000 operations during the run. Please take note for run operation (especially for read and update operation tests), you need to specify the recordcount also for your test database size. If you never specify, it will use the default value which is specified in the workload files (default is 1000) and this will cause your test to only execute 10000 operations again and again on 1000 records and the rest of the 9000 records will not be accessed at all.

For more details on what are the available workloads, you can refer to the offcial git site.

Thursday, November 21, 2013

Proxmox 3.1-3 with Brocade FC HBA Card

If you are using Proxmox 3.1-3 with Brocade FC HBA card, you probably will face the issue where Brocade module simply will not load. Looking at dmesg and you will find the following error message.


Brocade BFA FC/FCOE SCSI driver - version: 3.0.23.0
bfa 0000:81:00.0: firmware: requesting cbfw-3.0.3.1.bin
Can't locate firmware cbfw-3.0.3.1.bin
bfa 0000:81:00.1: firmware: requesting cbfw-3.0.3.1.bin
Can't locate firmware cbfw-3.0.3.1.bin

To solve this issue, you need to get the firmware file from Brocade. Download it from here. Select this package - Linux Adapter Firmware package for 3.0.23.x Drivers in RHEL 6.4 (bfa_fw_update_to_v3.0.23.0.tgz, 827 KB)

After you downloaded the file, extract the content and copy all the files to /lib/firmware. install bfa module using "modprobe bfa" and the module should load successfully this time.

Thursday, September 19, 2013

YCSB on HBase

* This post is for using YCSB on HBase 0.94.11 and Hadoop 1.2.1, for YCSB on HBase 0.96 and Hadoop 2.2, please go to this post.

YCSB (Yahoo Cloud Serving Benchmark) is a benchmark tool with common set of workloads for evaluating the performance of different “key-value” and “cloud” serving stores. HBase is one of the targets that can be benchmarked using YCSB.

The first step to use this benchmark is to donwload the source from YCSB git:
git clone http://github.com/brianfrankcooper/YCSB.git

Although it is mentioned you are able to download the binary from the site but the binary will not work when your hbase server version is different compare to the hbase client version used in YCSB binary and you will most likely get the error like below:

java.lang.IllegalArgumentException: Not a host:port pair: 

Once finish cloning, cd into the newly created directory YCSB and edit the following files using your favorite editor.

-YCSB/hbase/pom.xml
Edit the following line shown below to the hbase and hadoop version you have in your environment. In my case, my hbase is 0.94.11 and hadoop is 1.2.1.


-YCSB/pom.xml
Edit the following line to change the slf4j version to 1.4.3.


-YCSB/elasticsearch/pom.xml
Edit the following line to change the slf4j version to 1.4.3.


The changes to the last 2 pom.xml files is to make sure hbase and ycsb use the same version of slf4j. If this is not changed, you might face the problem shown below when running ycsb.

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoopuser/ycsb-0.1.4/hbase-binding/lib/hbase-binding-0.1.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoopuser/ycsb-0.1.4/hbase-binding/lib/slf4j-log4j12-1.4.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
SLF4J: Your binding is version 1.5.5 or earlier.
SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x
Exception in thread "Thread-1" java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
        at org.apache.zookeeper.ZooKeeper.(ZooKeeper.java:94)
        at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.(RecoverableZooKeeper.java:98)
        at org.apache.hadoop.hbase.zookeeper.ZKUtil.connect(ZKUtil.java:127)
        at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.(ZooKeeperWatcher.java:153)
        at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.(ZooKeeperWatcher.java:127)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1507)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.ensureZookeeperTrackers(HConnectionManager.java:716)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:986)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:961)
        at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:227)
        at org.apache.hadoop.hbase.client.HTable.(HTable.java:170)
        at org.apache.hadoop.hbase.client.HTable.(HTable.java:129)
        at com.yahoo.ycsb.db.HBaseClient.getHTable(HBaseClient.java:118)
        at com.yahoo.ycsb.db.HBaseClient.update(HBaseClient.java:302)
        at com.yahoo.ycsb.db.HBaseClient.insert(HBaseClient.java:357)
        at com.yahoo.ycsb.DBWrapper.insert(DBWrapper.java:148)
        at com.yahoo.ycsb.workloads.CoreWorkload.doInsert(CoreWorkload.java:461)
        at com.yahoo.ycsb.ClientThread.run(Client.java:269)

Cd into YCSB directory and run mvn clean package to build the package. Once you see the following output, it means the build is successful.

[INFO] YCSB Root ......................................... SUCCESS [40.653s]
[INFO] Core YCSB ......................................... SUCCESS [46.852s]
[INFO] Cassandra DB Binding .............................. SUCCESS [44.413s]
[INFO] HBase DB Binding .................................. SUCCESS [1:49.114s]
[INFO] Hypertable DB Binding ............................. SUCCESS [45.091s]
[INFO] DynamoDB DB Binding ............................... SUCCESS [38.011s]
[INFO] ElasticSearch Binding ............................. SUCCESS [3:22.121s]
[INFO] Infinispan DB Binding ............................. SUCCESS [2:43.266s]
[INFO] JDBC DB Binding ................................... SUCCESS [13.182s]
[INFO] Mapkeeper DB Binding .............................. SUCCESS [8.313s]
[INFO] Mongo DB Binding .................................. SUCCESS [5.941s]
[INFO] OrientDB Binding .................................. SUCCESS [15.621s]
[INFO] Redis DB Binding .................................. SUCCESS [4.171s]
[INFO] Voldemort DB Binding .............................. SUCCESS [14.630s]
[INFO] YCSB Release Distribution Builder ................. SUCCESS [13.381s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:45.433s
[INFO] Finished at: Thu Sep 12 18:25:37 SGT 2013
[INFO] Final Memory: 65M/165M
[INFO] ------------------------------------------------------------------------


You should be able to look for ycsb-0.1.4.tar.gz file inside YCSB/distribution/target directory. Copy this file to the directory where you have the access permission and untar it. Once untar, copy the hbase-site.xml file from your hbase conf directory to your ycsb-0.1.4/hbase-binding/conf/ directory.

Before you can run the test, you need to start your hdfs (start-dfs.sh)and hbase (start-hbase.sh). Go into hbase shell and create a table call usertable with column family call family.


After create the table and the column family, you can start loading data into your database

$ ~/ycsb-0.1.4/bin/ycsb load hbase -P ~/ycsb-0.1.4/workloads/workloada -p columnfamily=family -p recordcount=10000 -p threadcount=4 -s | tee -a workloada_load.dat

Start running the benchmark with the command below:

$ ~/ycsb-0.1.4/bin/ycsb run hbase -P ~/ycsb-0.1.4/workloads/workloada -p columnfamily=family -p operationcount=10000 -p recordcount=10000 -p threadcount=4 -s | tee -a workloada_run.dat

The steps above are very simple validation using workloada with only 10000 records loaded into database and 10000 operations during the run. Please take note for run operation (especially for read and update operation tests), you need to specify the recordcount also for your test database size. If you never specify, it will use the default value which is specified in the workload files (default is 1000) and this will cause your test to only execute 10000 operations again and again on 1000 records and the rest of the 9000 records will not be accessed at all.

For more details on what are the available workloads, you can refer to the offcial git site.

Wednesday, September 11, 2013

Bad Table Rendering When Converting Word Document to PDF

It is always frustrated to see what is being formatted nicely in your Word document become mess up when converted to pdf. One of the problems is table format. Example below shows table see in Word and table see in pdf.
Table display nicely when you see in Office Word

What a mess after converting to pdf

Turn out this is because of the cell margin. Open your table properties and go to cell tab as shown below. Click on the Options... button.


This will bring up Cell Options window as shown below. Noticed that the top and bottom margin is not zero. Change this to zero and click OK.


Convert your pdf document again and you will see that the table format rendering is ok now.

The only problem now is the cell margin gone. To solve this, you just need to use Line Spacing Option as shown below to create the margin you like.



Finally, you got the table format you want in your pdf file.


Friday, August 2, 2013

Install Adaptec Storage Manager (ASM) For Adaptec 2420SA Card On Ubuntu System

Adaptec 2420SA is actually quite an old card and therefore when you check this link, there is no available package for Ubuntu system (i not sure whether latest ASM can use for old Adaptec card or not, if you have the information, please comment below).

So i downloaded the rpm package into my Ubuntu system and use alien to convert it into deb package.

sudo alien asm_linux_x64_v5_20_17414.rpm

sudo dpkg -i storman_5.20-1_amd64.deb

After finish installing, i change the arcconf permission to make it executable.
sudo chmod 744 arcconf

To check the card information, i run the following command
sudo /usr/StorMan/arcconf getconfig 1

If you encounter the following error when run the arrconf command, you need to install libstdc++5
/usr/StorMan/arcconf: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

Install libstdc++5
sudo apt-get install libstdc++5

Format Faster on Linux Drive (ext4)

This is actually not really a problem for most of the users as they only format filesystem once and use it afterwards. But for users who need to do repeated testing on multiple drives, this could be really helpful as it can save you a lot of time.

One way to make format faster is to modify the bytes-per-inode value. By specifying higher value for this parameter, less inode will be created. As such, this is probably not suitable for all the situation but it is suitable if your filesystem only need to store virtual machine image which each file is big in size but the number of files in the filesystem is less.

bytes-per-inode Time Free inode
16384 (default) 1m29.712s 30490613
32768 48.809s 15245301
65536 23.675s 7622645
131072 14.793s 3811317

As you can see, the lesser inode need to be created, your format can be done faster. Command to do this:

mkfs -t ext4 -i 131072 /dev/sdb1

Another way is to use lazy_itable_init when formatting filesystem. This is actually the fastest way because inode table is not fully initialized when you do the formatting, instead, it is initialized when it is mounted. So this again might not be suitable if you are doing some IO test as you never know how this initialization process will affect your real IO performance. So the time taken is -- only 3.785s.

Command to do this

mkfs -t ext4 -E lazy_itable_init=1 /dev/sdb1

Notes:

time command was used to capture the elpased time
Disk size is 500GB