Sunday, November 10, 2013

Give it a try BoneCP


I used c3p0 pooling almost everywhere. After reading few articles and suggestions I want to try BoneCP to see how its workout.
Here is basic sample how to test it.

You must have below jar files in your classpath
bonecp-0.8.0.RELEASE.jar
guava-15.0.jar
slf4j-api-1.7.5.jar
mysql-connector-java-5.0.8-bin
DB driver
My case its Mysql. So I use below link to download.

You can try these on below links.
http://jolbox.com/ - Go to download link

Once the setup is done its quite straightforward. You can try piece of code appear below.

------------------------------------------------------------------
oneCP connectionPool = null;
Connection connection = null;
        try {
            // load the database driver (make sure this is in your classpath!)
            Class.forName("com.mysql.jdbc.Driver");
        } catch (Exception e) {
            e.printStackTrace();
            return;
        }

        try {
            // setup the connection pool
            BoneCPConfig config = new BoneCPConfig();
            config.setJdbcUrl("jdbc:mysql://10.82.100.61/kasun"); // jdbc url specific to your database, eg jdbc:mysql://127.0.0.1/db
            config.setUsername("kasun");
            config.setPassword("kasun123");
            config.setMinConnectionsPerPartition(5);
            config.setMaxConnectionsPerPartition(10);
            config.setPartitionCount(1);
            connectionPool = new BoneCP(config); // setup the connection pool

            connection = connectionPool.getConnection(); // fetch a connection

            if (connection != null) {
                System.out.println("Connection successful!");
                Statement stmt = connection.createStatement();
                ResultSet rs = stmt.executeQuery("SELECT * FROM t1"); // do something with the connection.
                while (rs.next()) {
                    System.out.println("Column One - " + rs.getString(1));
                    System.out.println("Column Two - " + rs.getString(2));
                }
            }
            Thread.sleep(30000);
            connectionPool.shutdown(); // shutdown connection pool.
        } catch (SQLException e) {
            e.printStackTrace();
        } catch (InterruptedException iex) {
            iex.printStackTrace();

        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }
    }
------------------------------------------------------------------

Thread sleep is introduce in order to check the connectivity from Mysql.
Table definition as below.

CREATE TABLE `t1` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `address` varchar(30) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1

Table data as below

mysql> select * from t1 \G
*************************** 1. row ***************************
     id: 2
address: bandarawela
1 row in set (0.00 sec)

Compile it and run.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Connection successful!
Column One - 2
Column Two – bandarawela

Below is the connections listed in Mysql.


mysql> show processlist;
+-----+-------+-----------------------------+-------+---------+------+-------+------------------+
| Id  | User  | Host                        | db    | Command | Time | State | Info             |
+-----+-------+-----------------------------+-------+---------+------+-------+------------------+
| 214 | kasun | MA02ENLKASUN:50805 | kasun | Query   |    0 | init  | show processlist |
| 231 | kasun | MA02ENLKASUN:52283 | kasun | Sleep   |    7 |       | NULL             |
| 232 | kasun | MA02ENLKASUN:52284 | kasun | Sleep   |    7 |       | NULL             |
| 233 | kasun | MA02ENLKASUN:52285 | kasun | Sleep   |    7 |       | NULL             |
| 234 | kasun | MA02ENLKASUN:52286 | kasun | Sleep   |    7 |       | NULL             |
| 235 | kasun | MA02ENLKASUN:52287 | kasun | Sleep   |    7 |       | NULL             |
+-----+-------+-----------------------------+-------+---------+------+-------+------------------+
6 rows in set (0.00 sec)

BoneCP simple and easy to user. You can check their website for further and for more examples. Worth a try.


Wednesday, November 6, 2013

LVM snapshot and volume creation


I test this on my CentOS VirtualBox. Went well for me.
Increase the virtual disk size in Windows 7. Make sure you shut down the virtual machine (As it give me errors, may be if I have two disks I can do it on the non-primary)
C:\Program Files\Oracle\VirtualBox>VBoxManage.exe modifyhd "C:\Users\kasun\VirtualBox VMs\centOS1\centOS1.vdi" --resize 20000
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

Login to the CentOS(virtual machine)
fdisk /edv/sda
n
primary partition
3
2089
2300
w
--------------------------
Reboot so it will be written to the partition table
--------------------------
n
primary partition
4
2301
2549
w
reboot
--------------------------

Two physical volumes.
pvcreate /dev/sda3
pvcreate /dev/sda4


pvscan
pvdisplay - display the physical volume

Create the volume group
vgcreate vol_grp_k /dev/sda3 /dev/sda4

vgscan
vgdisplay – will display the volume group

Create the logical volume
lvcreate -v -L 900MB -n vol_k_one vol_grp_k

Create the file system
mkfs.ext4 /dev/vol_grp_k/lv_one_k
Create a dir
mkdir /back
Mount so can be use for,
mount /dev/vol_grp_k/lv_one_k /back

Take a snapshot
Getting the snapshot from previously created partition
lvcreate --snapshot –-size=100M --name=Snap /dev/vol_grp_k

Snap will be mounted to this
mkdir /snap_shot

Mounting
mount -o ro /dev/vol_grp_k/lv_one_k /snap_shot
<Do what ever you want to do>
then remove the snapshot as you dont need it anymore

umount /dev/vol_grp_k/lv_one_k
lvremove /dev/vol_grp_k/lv_one_k


Tuesday, November 5, 2013

Test smtp with telnet



Something very useful testing smtp connections. You can just telnet can see the email delivery. Take a tcpdump for future reference as well.

server> telnet outlook1.kwire.local 25
Trying 10.21.90.1...
Connected to outlook1.kwire.local.
Escape character is '^]'.
220 kwire.local Microsoft ESMTP MAIL Service ready at Wed, 6 Nov 2013 12:03:59 +0800
helo kwire.com
250 EXCAS01.kwire.local Hello [10.21.1.3]
mail from:sender@kwire.com
250 2.1.0 Sender OK
rcpt to:admin@kwire.com
250 2.1.5 Recipient OK
data
354 Start mail input; end with <CRLF>.<CRLF>

test mail from kwire
.
250 2.6.0 <67af9592-163d-4c10-8b65-21d582af9cfa@EXCAS01.kwire.com> [InternalId=3278440] Queued mail for delivery
---------------------------------------------------------------------------------------

Note - each new line is with ENTER. 

Monday, November 4, 2013

MongoDB replica set hidden member and application configuration


Replica set usage

It seems the driver made 3 connection when we specify the three mongod servers in connection URL.
            MongoClient mongoClient = new MongoClient(Arrays.asList(new ServerAddress("localhost", 27017),new ServerAddress("localhost", 37017), new ServerAddress("localhost", 47017)));

Tue Nov 05 12:04:53.690 [conn56] end connection 127.0.0.1:64511 (3 connections now open)
Tue Nov 05 12:04:53.693 [conn57] end connection 127.0.0.1:64516 (2 connections now open)
Tue Nov 05 12:04:53.909 [conn52] end connection 127.0.0.1:64486 (1 connection now open)
Tue Nov 05 12:04:53.911 [initandlisten] connection accepted from 127.0.0.1:64520 #58 (2 connections now open)


            MongoClient mongoClient = new MongoClient(Arrays.asList(new ServerAddress("localhost", 27017),new ServerAddress("localhost", 37017)));

Tue Nov 05 12:05:23.918 [conn58] end connection 127.0.0.1:64520 (1 connection now open)
Tue Nov 05 12:05:23.920 [initandlisten] connection accepted from 127.0.0.1:64555 #60 (2 connections now open)

Tue Nov 05 12:05:27.360 [conn59] end connection 127.0.0.1:64521 (1 connection now open)
Tue Nov 05 12:05:27.361 [initandlisten] connection accepted from 127.0.0.1:64556 #61 (2 connections now open)


When the PRIMARY is down can clearly see it first try with previous PRIMARY but then move to the new PRIMARY. After sometime it will make sure it will route to the correct server on next attempt.

Nov 05, 2013 12:17:08 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:37017 - java.io.IOException - message: Connection refused: connect
Nov 05, 2013 12:17:08 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: localhost/127.0.0.1:37017 - java.io.IOException - message: Connection refused: connect
Nov 05, 2013 12:17:09 PM com.mongodb.ConnectionStatus$UpdatableNode update
WARNING: Server seen down: MA02ENLKASUN/127.0.0.1:37017 - java.io.IOException - message: Connection refused: connect

But on next attempt it is getting without connection exceptions.


Hidden member
You can make hidden member, which will never be a primary rather synch with data and can be used for backup or reporting. But whenever new primary need to elected it will be join in. Priority is 0 and must enable the hidden.

{
"_id" : <num>
  "host" : <hostname:port>,
  "priority" : 0,
  "hidden" : true
}

cfg = rs.conf()
cfg.members[0].priority = 0
cfg.members[0].hidden = true
rs.reconfig(cfg)
After the hidden member add in. Can’t be view from db.isMaster() 

rs0:PRIMARY> db.isMaster()
{
        "setName" : "rs0",
        "ismaster" : true,
        "secondary" : false,
        "hosts" : [
                "MA02ENLKASUN:37017",
                "MA02ENLKASUN:57017",
                "MA02ENLKASUN:27017"
        ],
        "arbiters" : [
                "MA02ENLKASUN:47017"
        ],
        "primary" : "MA02ENLKASUN:37017",
        "me" : "MA02ENLKASUN:37017",
        "maxBsonObjectSize" : 16777216,
        "maxMessageSizeBytes" : 48000000,
        "localTime" : ISODate("2013-11-05T07:25:25.248Z"),
        "ok" : 1
}
rs0:PRIMARY> cfg = rs.conf();
rs0:PRIMARY> cfg.members[3].priority=0;
0
rs0:PRIMARY> cfg.members[3].hidden=true;

rs0:PRIMARY> rs.reconfig(cfg);
Tue Nov 05 15:26:37.998 DBClientCursor::init call() failed
Tue Nov 05 15:26:38.005 trying reconnect to 127.0.0.1:37017
Tue Nov 05 15:26:38.009 reconnect 127.0.0.1:37017 ok
reconnected to server after rs command (which is normal)

rs0:SECONDARY> db.isMaster()
{
        "setName" : "rs0",
        "ismaster" : true,
        "secondary" : false,
        "hosts" : [
                "MA02ENLKASUN:37017",
                "MA02ENLKASUN:27017"
        ],
        "arbiters" : [
                "MA02ENLKASUN:47017"
        ],
        "primary" : "MA02ENLKASUN:37017",
        "me" : "MA02ENLKASUN:37017",
        "maxBsonObjectSize" : 16777216,
        "maxMessageSizeBytes" : 48000000,
        "localTime" : ISODate("2013-11-05T07:26:45.595Z"),
        "ok" : 1
}

Thursday, October 31, 2013

MongoDB replication


Replication is for non-other than making several copies of data for future/other references.
This may be used for backup, reporting, recovery.
MongoDB no exceptions replication can be used for any of the above cases.

Secondary will replicate its oplog and execute changes on data sets.
So secondary will reflect primary’s data.
Clients can either configure to read from secondary or can read from primary
In case of configured following will check,

primary                  This is the default. All operations read from the current replica set primary.
primaryPreferred   Mostly operations read from the primary but if it is unavailable, operations read from secondary members.
secondary              All operations read from the secondary members of the replica set.
secondaryPreferred         Mostly operations read from secondary members but if no secondary members are available, operations read from the primary.
nearest                  Read from the nearest member of the replica set, irrespective of the member’s type

Member selection in case primary disconnect, step down and in the initialization of replica set is as below,
First list suitable list of available servers (primary, secondary or all members). Then check which the absolute is nearest.

secondaryAcceptableLatencyMS can be used to override.

Default acceptable latency is 15 milliseconds (It will ping and check).

For mongos - localThreshold or localThreshold runtime option to change the value.

Once above criteria is met randomly choose which can be used for read operation.

Read association - which is something to think about as your secondary may lag, which will result with different results on same queries. So you can use this as it’s provide you below functionality,
Application may associate with specific server so the results will be consistence. But until,
Application may read with different read preference, thread terminates or socket exception.

If you are interested enough its quite easy to setup a replica set.

port = 47017
bind_ip = localhost
dbpath = D:\mongodb\mongodb-win32-x86_64-2008plus-2.4.7-3\data
replSet = rs0
rest = true




These are the basic configs. Make sure to change port, dbpath accordingly (at least). Enabling rest is important as you can use the built-in admin to view the status.

Then log into one mongodb and execute below.

rs.initiate();
rs.add(“server1:port”);
rs.addArb(“server2:port”);
rs.status();




below will useful in case try to read from secondary

rs.slaveOk

Saturday, May 25, 2013

Difference comes in his own ways

He was there when I was 5 years old, when my mother took me to school back in 1988. His uniqueness came with  his unique singing and the college crest bi-cycle, which he always use to ride. Last time I met him was back in 2010.
Unbelievable thing is he remember me when I just saw him. This after 9 years which I had left my school. He walk with me around the school that day, explaining what kind of development changes that is taking place at that time. He asked me "did you walk all the way to school?" Well, I was use to walk to my school back in those days, which 1 1/2 kms from my home. I said no. He just smile at me,
Simple life style. He use to tell me his origins comes from one of the estate in Bandarawela. His face reminds me the toughness of the world around as well as how much unfair the entire system is.
He bring me lot of memory, which I perish and love to go thru the best days of life. That is my childhood.
He reminds me how a simple guy make such big difference. As I heard he pass a away few days back. And there was Facebook post which lot of people share and comment. People who stayed there now around the globe. Join when they were very young and after left the school now conquer the world. Little man stay there for ever went thru lot of changes but minimum changes to his own life.
He reminds me lot.
How much we use to share the feelings of others. But now we forgot everything.
Simplicity is what we really need but we wasn't able to find it even it was there in front of us.
How much difference a man can make with his own ways.
How much he loyal to himself and to the place he worked. Which is very rare right now.
Hope this post will remain long time as his picture will remain too.
Nalan rest in piece.


Wednesday, May 8, 2013

ZFS cheat sheet



This is a quick and dirty cheat sheet on Sun's ZFS

error messages 
/var/adm/messages
 console

States 
DEGRADED

One or more top-level devices is in the degraded state because they have become offline. Sufficient replicas exist to keep functioning

FAULTED
One or more top-level devices is in the faulted state because they have become offline. Insufficient replicas exist to keep functioning

OFFLINE
The device was explicity taken offline by the "zpool offline" command

ONLINE
The device is online and functioning

REMOVED
The device was physically removed while the system was running

UNAVAIL
The device could not be opened


Storage Pools 

displaying

zpool list
zpool list -o name,size,altroot

Note: there are a number of properties that you can select, the default is: name, size, used, available, capacity, health, altroot

status
zpool status

## Show only error pools with more verbosity
zpool status -xv      

statistics

zpool iostat -v 5 5

Note: use this command like you would iostat 

History
zpool history -il

creating
## performing a dry run but don't actual perform the creation
zpool create -n data c1t0d0s0

# you can persume that I created two files called /zfs1/disk01 and /zfs1/disk02 using mkfile
zpool create data /zfs/disk1 /zfs/disk2

# using a standard disk slice
zpool create data c1t0d0s0

## using a different mountpoint than the default /<pool name>
zpool create -m /zfspool data c1t0d0s0

# mirror and hot spare disks examples
zpool create data mirror c1t0d0 c2t0d0 mirror c1t0d1 c2t0d1
zpool create data mirror c1t0d0 c2t0d0 spare c3t0d0

## setting up a log device and mirroring it
zpool create data mirror c1t0d0 c2t0d0 log mirror c3t0d0 c4t0d0

## setting up a cache device
zpool create data 01 mirror c1t0d0 c2t0d0 cache c3t0d0 c3t1d0

destroying
zpool destroy /zfs1/data

## in the event of a disaster you can re-import a destroyed pool
zpool import -f -D -d /zfs1 data1

adding 
zpool add data c2t0d0
Note: make sure that you get this right as zpool only supports the removal of hot spares and cache disks

removing
zpool remove data c2t0d0
Note: zpool only supports the removal of hot spares and cache disks

clearing faults 
zpool clear data
## Clearing a specific disk fault
zpool clear data c2t0d0

attaching
## c2t0d0 is an existing disk that is not mirrored, by attaching c3t0d0 both disks will become a mirror pair
zpool attach data c2t0d0 c3t0d0

detaching
zpool detach data c2t0d0
Note: see above notes is attaching

onlining
zpool online data c2t0d0

offlining
zpool offline data c2t0d0
 ## Temporary offlining (will revent back after a reboot)
 zpool offline data -t c2t0d0

Replacing
## replacing like for like
zpool replace data c2t0d0
 ## replacing with another disk
zpool replace data c2t0d0 c3t0d0

scrubbing
zpool scrub data
 ## stop a scrubbing in progress, check the scrub line using "zpool status data" to see any errors
zpool scrub -s data

Note: Only one of scrubbing or resilvering can be running at the sametime

scrubbing - examines all data to discover hardware faults or disk failures
resilvering - examines only data that ZFS knows to be out of date

exporting
zpool export data

importing
## when using standard disk devices i.e c2t0d0
zpool import data
## if using files in say the /zfs filesystem
zpool import -d /zfs

## importing a destroyed pool
zpool import -f -D -d /zfs1 data

upgrade
## List upgrade paths
zpool upgrade -v

## upgrade all pools
zpool upgrade -a

## upgrade specific pool, use "zpool get all <pool>" to obtain version number of a pool
zpool upgrade data

## upgrade to a specific version
zpool upgrade -V 10 data

Filesystem 
displaying
zfs list
## list different types
zfs list -t file-system
zfs list -t snapshot
zfs list -t volume

## recursive display
zfs list -r data/mysql

## complex listing
zfs list -o name,sharenfs,mountpoint

Note: there are a number of attributes that you can use in a complex listing, so use the man page to see them all

creating 
## presuming i have a pool called data create a /data/apache file-system
zfs create data/apache

## using a different mountpoint
zfs create -o mountpoint=/mysql data/mysql

## create a volume - the device can be accessed via /dev/zvol/[rdsk|dsk]/data/swap
zfs create -V 50mb data/swap
swap -a /dev/zvol/dsk/data/swap

Note: don't use a zfs volume as a dump device it is not supported

destroying
zfs destroy data/mysql
## using the recusive options -r = all children, -R = all dependants
zfs destroy -r data/mysql
zfs destroy -R data/mysql

mounting
zfs mount data
Note: there are all the normal mount options that you can apply i.e ro/rw, setuid

unmounting
zfs umount data

share
zfs share data

## Persist over reboots
zfs set sharenfs=on data

unshare
zfs unshare data
## persist over reboots
zfs set sharenfs=off data

taking snapshot
## creating a snapshot
zfs snapshot data@10022010

## destroying a snapshot
zfs destroy data@10022010

rollback
zfs rollback data@10022010

cloning/promoting
zfs clone data@10022010 data/clone

## promoting a clone
zfs promote data/clone
Note: the clone must reside in the same pool

renaming 
## the dataset must be kept within the same pool
zfs rename data/ora_disk01 data/ora_d01

Note: you have two options
-p creates all the non-existing parent datasets
-r recursively rename the sanpshots of all descendent datasets (used with snapshots only)

getting parameters 

zpool get all data
Note: the source column denotes if the value has been change from it default value, a dash in this column means it is a read-only value

## List all the properties
zfs get all data/mysql

## get a specific property
zfs get setuid data/mysql

## get a list of a specific properties for all datasets
zfs get compression

Note: the source column denotes if the value has been change from it default value, a dash in this column means it is a read-only value

setting parameters
zpool set autoreplace=on data
Note: use the command "zpool get all <pool>" to obtain list of current setting

## set and unset a quota
zfs set quota=50M data/mysql
zfs set quota=none data/mysql

Note: use the command "zfs get all <dataset> " to obtain list of current settings

inherit

## set back to the default value
zfs inherit compression data/mysql

upgrade 

## List the upgrade paths
zfs upgrade -v

## List all the datasets that are not at the current level
zfs upgrade

## upgrade a specific dataset
upgrade -V <version> data/mysql

send/receive

## here is a complete example of a send and receive with incremental update

## create some test files
mkfile -v 100m /zfs/master
mkdir -v 100m /zfs/slave

## create mountpoints
mkdir /master
mkdir /slave

## Create the pools
zpool create master
zpool create slave

## create the data filesystem
zfs create master/data

## create a test file
echo "created: 09:58" > /master/data/test.txt

## create a snapshot and send it to the slave, you could use SSH or tape to transfer to another server (see below)
zfs snapshot master/data@1
zfs send master/data@1 | zfs receive slave/data

## set the slave to read-only because you can cause data corruption, make sure if do this before accessing anything the
## slave/data directory
zfs set readonly=on slave/data

## update the original test.txt file
echo "`date`" >> /master/data/text.txt

## create a second snapshot and send the differences, you may get an error message saying that the desination had been
## modified this is because you did not set the slave/data to ready only (see above)
zfs snapshot master/data@2
zfs send master/data@1 master/data@2 | zfs receive slave/data
------------------------------------------------------------------------------------------------
## using SSH
zfs send master/data@1 | ssh backup_server zfs receive backups/data@1

## using a tape drive, you can also use cpio
zfs send master/data@1 > /dev/rmt/0
zfs receive slave/data2@1 < /dev/rmt/0
zfs rename slave/data slave/data.old
zfs rename slave/data2 slave/data

## you can also save incremental data
zfs send master/data@12022010 > /dev/rmt/0
zfs send -i master/data@12022010 master/data@13022010 > /dev/rmt/0

## Using gzip to compress the snapshot
zfs send master/fs@snap | gzip > /dev/rmt/0

allow/unallow

## dislay the permissions set
zfs allow master

## create permission set
zfs allow -s @permset1 create,mount,snapshot,clone,promote master

## grant a user permissions
zfs allow vallep @permset1 master

## revoke a user permissions
zfs unallow vallep @permset1 master

Note: there are many permissions that you can set so see the man page or just use the "zfs allow" command

Tuesday, May 7, 2013

ZFS file system


ZFS
The features of ZFS include protection against data corruption, support for high storage capacities, integration of the concepts of file-system, and  volume management, snapshots and copy-on-write clones, continuous integrity checking and automatic repair.

One major feature that distinguishes ZFS from other file systems is that ZFS is designed from the ground up with a focus on data integrity.

It is done this by keeping checksum of each block. And stored the value in pointer block not the block is self. Even a checksum of pointer block also stored, this continues till the root node.

First it calculate checksum of data/metadata and compare, if its matched then it will be pass to the programing stack which the process is asking for it.
When the checksum is mismatched it use zfs mirroring or RAID data to heal the data. This way it make sure the data integrity

Even with single disk you can have pool by specifying "copies=2" means two copies of data.

Repair
There is no tool similar to fsck in zfs. Which is available on Linux. Which does file system validation and system repair.
But it has tool called scrub which is fix some silent corruption and other problems.

But it check not only metadata like fsck it check data itself, so fsck on bigger diak can be completed in few minutes while scrub will take hours. Eventhough fsck return completed still the data may be corrupted.

And unlike fsck scrub doesn't need file system to be unmounted while running the file system check.

Sun microsystem recommend to run scrub on once in a month for enterprise disks(cause they provide higher reliability) and for cheap commodity disks once in week.

Snapshot
Heavy price is paid during data writes. So the snapshot are very fast. This is due to zfs use copy on write transactional object model. zfs has feature where we can track back to old data. This is base on copy on write method. It always use empty blocks to write, so the old data is always preserved.
zpool command has -F option where user can discard latest changes and go back to previous functional state. This is how the snaphost also worked. Since data are already there creation of snapshot is very fast.
Writable snapshots or clones also available. Still it uses copy on write transactional model when sharing the same set  of blocks on different file system.

Limits
zfs 128 bit file system. It was design that the limitations are so high and will not encountered.
248 — Number of entries in any individual directory[52]
16 exabytes (264 bytes) — Maximum size of a single file
16 exabytes — Maximum size of any attribute
256 zettabytes (278 bytes) — Maximum size of any zpool
256 — Number of attributes of a file (actually constrained to 248 for the number of files in a ZFS file system)
264 — Number of devices in any zpool
264 — Number of zpools in a system
264 — Number of file systems in a zpool

filling a 128-bit file system would require more energy than that needed to boil all the oceans on planet Earth