Site icon UnixArena

How to Build a Cloud Storage on Solaris 11?

Oracle solaris cloud storage

As you know that oracle is marketing Solaris 11 as First cloud operating system in the world.How much true it is ?  I am not sure about that. But recently i had come across one of the oracle blog that explains about making Solaris 11 as cloud storage using Pydio aka AjaXplorer opensource tool.Here I would like to share those information in my way. 

This is cloud storage will be similar to Dropbox,4shared and other web-based storage portals.You can access this storage on Android,Apple iOS smart phone APPS.

Technologies used to Build Cloud Storage:
1.Oracle Solaris 11.1 Operating system
2. Apache Web-server (In-built in IPS Repository)
3. Pydio (AjaXplorer) (PHP Based open-source Software)

Installation of Apache and PHP packages from IPS:
Login to Solaris 11.1 server and install the necessary packages to build the cloud.
  i. pkg:/web/server/apache-22 (Already Installed)
ii. pkg:/web/php-53 (Need to Install)
iii. pkg:/web/server/apache-22/module/apache-php53(Need to install)

root@UAAIS:~# pkg install pkg:/web/server/apache-22
No updates necessary for this image.
root@UAAIS:~#
root@UAAIS:~# pkg list |grep "apache-22"
web/server/apache-22                              2.2.22-0.175.1.0.0.24.0    i--
web/server/apache-22/module/apache-wsgi-26        3.3-0.175.1.0.0.24.0       i--
root@UAAIS:~# 
root@UAAIS:# pkg install pkg:/web/php-53
           Packages to install: 12
           Mediators to change:  1
       Create boot environment: No
Create backup boot environment: No
DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                              12/12       828/828    18.7/18.7  407k/s
PHASE                                          ITEMS
Installing new actions                     1226/1226
Updating package state database                 Done
Updating image state                            Done
Creating fast lookup database                   Done
root@UAAIS:# pkg install pkg:/web/server/apache-22/module/apache-php53
           Packages to install:  1
       Create boot environment: No
Create backup boot environment: No
DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                1/1           6/6      4.5/4.5  2.6M/s
PHASE                                          ITEMS
Installing new actions                         30/30
Updating package state database                 Done
Updating image state                            Done
Creating fast lookup database                   Done
root@UAAIS:#

We have successfully installed the required packages for web-based could. 

Storage:
Since the web-based storage will used by many users,It’s our responsibility to build the storage with multiple redundancy. Assume we got three LUNS from SAN.

1.Scan the Disks.

root@UAAIS:~# cfgadm -al
root@UAAIS:~# devfsadm -c disk
root@UAAIS:~# echo |format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c8t0d0 VMware,-VMware Virtual S-1.0-16.00GB
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c8t1d0 VMware,-VMware Virtual S-1.0-16.00GB
          /pci@0,0/pci15ad,1976@10/sd@1,0
       2. c8t2d0 VMware,-VMware Virtual S-1.0 cyl 2046 alt 2 hd 128 sec 32
          /pci@0,0/pci15ad,1976@10/sd@2,0
       3. c8t3d0 VMware,-VMware Virtual S-1.0 cyl 2046 alt 2 hd 128 sec 32
          /pci@0,0/pci15ad,1976@10/sd@3,0
       4. c8t4d0 VMware,-VMware Virtual S-1.0 cyl 2046 alt 2 hd 128 sec 32
          /pci@0,0/pci15ad,1976@10/sd@4,0
Specify disk (enter its number): Specify disk (enter its number):
root@UAAIS:~#


2.Create a ZFS storage pool with RAIDZ 

root@UAAIS:~# zpool create arenacloud raidz c8t2d0 c8t3d0 c8t4d0
root@UAAIS:~# zpool status arenacloud
  pool: arenacloud
 state: ONLINE
  scan: none requested
config:
        NAME        STATE     READ WRITE CKSUM
        arenacloud  ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            c8t2d0  ONLINE       0     0     0
            c8t3d0  ONLINE       0     0     0
            c8t4d0  ONLINE       0     0     0
root@UAAIS:~#


3.Create a new Dataset for web-based storage.

root@UAAIS:~# zfs create arenacloud/mobile-S


4.Set the mountpoint like below for mobile-S dataset.

root@UAAIS:~# zfs set mountpoint=/var/apache2/2.2/htdocs/webarena/ arenacloud/mobile-S
root@UAAIS:~#

If “webarena” directory doesn’t exists, just create it.

5.Verify ZFS De-Duplication and Compression technologies are enabled or not for the dataset.

root@UAAIS:~# zfs get all arenacloud/mobile-S |egrep "compress|dedup"
arenacloud/mobile-S  compression     off                   default
arenacloud/mobile-S  compressratio   1.00x                    -
arenacloud/mobile-S  dedup           off                   default
root@UAAIS:~#

Those are not enabled here.

6.Set the ZFS de-duplication and compress to “ON” .

root@UAAIS:~# zfs set compression=on  arenacloud/mobile-S
root@UAAIS:~# zfs set  dedup=on arenacloud/mobile-S
root@UAAIS:~# zfs get all arenacloud/mobile-S |egrep "compress|dedup"
arenacloud/mobile-S  compression           on              local
arenacloud/mobile-S  compressratio         1.00x             -
arenacloud/mobile-S  dedup                 on              local
root@UAAIS:~#

To learn more about ZFS De-duplication.

Pydio or AjaXplorer Installation:
1.Download Pydio/AjaXplorer from sourceforge.net

2.Copy the downloaded file to /var/apache2/2.2/htdocs/webarena/ 

3.Extract the file using below command.

root@UAAIS:/var/apache2/2.2/htdocs/webarena # tar -xvfz pydio-core-5.0.4.zip
x pydio-core-5.0.4.zip/.htaccess, 751 bytes, 2 tape blocks
x pydio-core-5.0.4.zip/data/personal/.htaccess, 13 bytes, 1 tape blocks
x pydio-core-5.0.4.zip/data/tmp/.htaccess, 13 bytes, 1 tape blocks
x pydio-core-5.0.4.zip/data/public/index.html, 0 bytes, 0 tape blocks
x pydio-core-5.0.4.zip/data/cache/.htaccess, 13 bytes, 1 tape blocks
x pydio-core-5.0.4.zip/data/files/.htaccess, 13 bytes, 1 tape blocks


4.Set the below permissions.

root@UAAIS:~# chown -R webservd:webservd /var/apache2/2.2/htdocs
root@UAAIS:~# chmod -R 777 /var/apache2/2.2/htdocs/webarena/


5.This step will make the web-link much more better.

root@UAAIS:# cd /var/apache2/2.2/htdocs/webarena/pydio-core-5.0.4
root@UAAIS:# mv * /var/apache2/2.2/htdocs/webarena/


Configuring the security:
Just blindly follow the below steps. 
1.Configure the security for HTTPS communication.(SSL)

root@UAAIS:~# cp /etc/apache2/2.2/samples-conf.d/ssl.conf /etc/apache2/2.2/conf.d

root@UAAIS:~# openssl genrsa -out server.key 2048
Generating RSA private key, 2048 bit long modulus
......+++
.....+++
e is 65537 (0x10001)

root@UAAIS:~# openssl req -new -key server.key -out server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) []:IN
State or Province Name (full name) []:TN
Locality Name (eg, city) []:Coimbatore
Organization Name (eg, company) []:UnixArena
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:UAAIS.arenadc
Email Address []:lingeshwaran.rangasamy@gmail.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:Welc0me@123
An optional company name []:
root@UAAIS:~#

root@UAAIS:~# openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=/C=IN/ST=TN/L=Coimbatore/O=UnixArena/CN=UAAIS.arenadc/emailAddress=lingeshwaran.rangasamy@gmail.com
Getting Private key

root@UAAIS:~# cp server.* /etc/apache2/2.2


2.Restart the http service.

root@UAAIS:~# svcadm restart http:apache22


3.To know how much size of file can be uploaded to the web-storage,use the below mentioned command.

root@UAAIS:~# php -r 'echo PHP_INT_MAX;'
2147483647root@UAAIS:~#
root@UAAIS:~#
root@UAAIS:~# bc
2147483647/1024/1204
1741

Since its X86 architecture ,it just allows maximum 1741MB size of file can be uploaded.
SPRAC supports the file size in TB.

4.Edit the “/etc/php/5.3/php.ini” file to set the “post_max_size” and “upload_max_filesize” 
Post_max_size should be greater than max_filesize.

root@UAAIS:~# cat /etc/php/5.3/php.ini |egrep "post_max_size|upload_max_filesize"
post_max_size = 2048M
upload_max_filesize = 1741M
root@UAAIS:~#


5.Install the Apache security module and configure it.

root@UAAIS:~# pkg install web/server/apache-22/module/apache-security
           Packages to install:  2
       Create boot environment: No
Create backup boot environment: No
DOWNLOAD                                PKGS         FILES    XFER (MB)   SPEED
Completed                                2/2         51/51      0.7/0.7  158k/s

PHASE                                          ITEMS
Installing new actions                         95/95
Updating package state database                 Done
Updating image state                            Done
Creating fast lookup database                   Done
root@UAAIS:~# cp /etc/apache2/2.2/samples-conf.d/security2.conf /etc/apache2/2.2/conf.d/
root@UAAIS:~#


6.Restart the http service once again.

root@UAAIS:~# svcadm restart http:apache22
root@UAAIS:~#


7.Setup the index.html like below under htdocs.



How to access the Storage ?
1. Open the browser and enter the system IP address.It will take some time to verify the settings.


2.Just ignore those above warning and Continue to Pydio.


3.Click on Start wizard and star filling the information.


4.Do not select database unless you are looking for some advanced configuration.


5.After filling all the four category  , just click on install to configure the Pydio.


6.After login as Admin , Go to the settings to create a new users.
Each user will be having their own work-space and common space.


























7. You can upload the files to your workspace from your computer or mobile.


8.It has in-built image/text viewers and editors.


Do you like pydio ? or Oracle Solaris 11.1 ? I felt both are awesome.

You can download Android Pydio app from Google play for Smart Phones.

Hope you this article is informative for you. Thank you for visiting UnixArena.

Exit mobile version