X

News, tips, partners, and perspectives for the Oracle Solaris operating system

Scaling IPS repositories with Apache on Oracle Solaris

Glynn Foster
Product Manager

For over a year now I've been working on Oracle Solaris and SPARC initiatives in the Oracle Cloud, writing much of the infrastructure code for SPARC Model 300, and the next generation services. It's been a fun ride to take many of the Oracle Solaris best practices and implement them in the cloud.

When we standup the SPARC services, we use the Oracle Solaris Automated Installer (AI) and Image Packaging Systems (IPS) to do the bare metal installations of the systems. When you have to do this in a cloud environment, you typically need pretty good performance so you can quickly stand up the systems in parallel.

One nice tip is to put an Apache instance in front of IPS to get better scalabity and caching. Doing this is pretty simple and already covered in our excellent documentation. As a high level, here's the steps.

Step 1: Create Apache configuration fragment

Depending on your setup, it's a simple process of installing the following fragment into /etc/apache2/2.4/conf.d/ and enabling the Apache service.

AllowEncodedSlashes NoDecode
AddOutputFilterByType DEFLATE text/html application/javascript text/css text/plain
MaxKeepAliveRequests 10000
ProxyTimeout 30
ProxyRequests Off

CacheRoot /apache_cache
CacheEnable disk /
CacheMaxFileSize 1000000000
CacheDirLevels 1
CacheDirLength 2

<LocationMatch ".*/catalog.attrs">
Header set Cache-Control no-cache
</LocationMatch>

<LocationMatch ".*/search/\d/.*">
        Header set Cache-Control no-cache
</LocationMatch>

Redirect /solaris http://${HOST_IP}/solaris/
ProxyPass /solaris/ http://${HOST_IP}:8001/ nocanon max=200

substituting an appropriate IP address for your host. You can see here that I have a cache directory located at /apache_cache and I'm proxying through to the IPS server hosted on port 8001 .

# svcadm enable apache24

Step 2: Create and configure the IPS repository

There's a couple of ways you can download a copy of the Oracle Solaris package repository - either using pkgrecv directly from pkg.oracle.com, or downloading the zip files for the GA repository and any incremental SRU. These are covered in pretty good detail at our lifecycle management OTN page. Once you've done this, use svccfg to configure the repository:

# svccfg -s pkg/server:default setprop pkg/proxy_base = astring: http://${HOST_IP}/solaris
# svccfg -s pkg/server:default setprop pkg/inst_root = astring: /solaris_repo
# svccfg -s pkg/server:default setprop pkg/port = 8001
# svccfg -s pkg/server:default setprop pkg/threads = 200
# svcadm enable pkg/server:default

As before, substitute an appropriate IP address for your host. You can see here that the repository contents are stored in /solaris_repo.

Step 3: Profit!

And that's all there is to it. If you wanted to host multiple IPS repositories, just extend the Apache configuration fragment for a different namespace, use a different port and serve up the new IPS content using a new instance of the pkg/server SMF service:

Redirect /mycompany http://${HOST_IP}/mycompany/
ProxyPass /mycopmany/ http://${HOST_IP}:8002/ nocanon max=200
# svccfg -s pkg/server:mycompany setprop pkg/proxy_base = astring: http://${HOST_IP}/mycompany
# svccfg -s pkg/server:mycompany setprop pkg/inst_root = astring: /mycompany_repo
# svccfg -s pkg/server:mycompany setprop pkg/port = 8002
# svccfg -s pkg/server:mycompany setprop pkg/threads = 200
# svcadm enable pkg/server:mycompany

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services