Posts Tagged macosx

Distributed Caching, also on Mac OS X

IBM’s distributed caching system, WebSphere eXtreme Scale (formerly ObjectGrid) is a distributed, transactional object caching system for elastic scalability and extreme performance.

It can store any type of data and provides REST API as long with Java (HashMap, JPA, Hibernate, Spring) APIs.  It also natively integrates with WebSphere Application Server and WebSphere Liberty Profile to cache HTTP session data.

It is supported on most platforms and – because it is a pure JavaSE application, it also works on Mac OS X, although this platform is not officially supported by IBM.

How to get started ?

  • Download eXtreme Scale trial and unzip
  • In a Terminal, go to product directory
  • cd ObjectGrid/gettingstarted
  • Run the Catalog Server
  • ./runcat.sh
  • Open another Terminal window and start an ObjectGrid server
  • ./runcontainer.sh server0
  • Repeat the last step to create several instances of ObjectGrid server
  • Then experiment with client script.  It provides basic CRUD operations from command line
  • ./runclient.sh i key value

Congrats, you managed to setup a multi instance grid, in-memory cache system on your Mac.

To further understand how it works and how you can programmatically interact with the cache, refer to eXtreme Scale documentation.

Next step will be to demonstrate how eXtreme Scale integrates with Liberty to create a multi instance cluster with shared HTTP Session. Stay Tuned.

Enjoy !

 

 

, , , , ,

No Comments

MacPort on Mac OS X Lion

If you have performed a fresh install of Mac OS X Lion or if you plan to install MacPort after having installed Lion, you will soon realize that the MacPort team does not distribute (yet) a Lion installer.  Snow Leopard installer will fail when detecting Lion.

Question is therefore : how to install MacPort on Lion ?  Answer : install it from the sources.

It might be scarry, but it is very easy, here are the details.

Preriquisite : install Aple’s development tool XCode.  It is freely available from the App Store (be patient it is a 3.5 Gb download)

  • Open a terminal
  • create a directory for the sources
mkdir macport.sources
  • Fetch the sources

cd macport.sources
sudo svn checkout http://svn.macports.org/repository/macports/trunk

  • Compile
cd trunk/base
sudo ./configure --enable-readline
sudo make install
  • Install
sudo make distclean
  • Change your profile to include MacPort in the PATH
vi $HOME/.profile
#!/usr/bin/bash
# MacPort
export PATH=$PATH:/opt/local/bin
  • Source your profile to include the changes
. $HOME/.profile

That’s it ! Easy as I promised.

You can now search for package with

sudo port list | grep <your search>

and install packages with

sudo port install <package name>

Enjoy !

, , , ,

5 Comments

First run of OpenJDK 1.7 for Mac OS X

My colleague Alexis recently shared a couple of links on Twitter to DMG files containing recent builds of OpenJDK for Mac OS X.

These builds are created by the community for the community – they are experimental and are probably not stable.  Thanks Gildas and Henri for your work !

I downloaded the 64 bits version (32 bits version also available) and installed it in a couple of minutes.  These builds install in Apple proposed location : /Library/Java/JavaVirtualMachines

First test is obviously :

marsu:~ sst$ /Library/Java/JavaVirtualMachines/openjdk-1.7-x86_64/bin/java -version
openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-henri_2010_11_25_16_22-b00)
OpenJDK 64-Bit Server VM (build 20.0-b02, mixed mode)

Then I configured Netbeans to use that JDK to compile and run projects :

Netbeans 6.9 has build in modules to support some upcoming Java SE 7 syntax, such as the language simplifications proposed by project Coin.

BTW, should you want to create the builds yourself, everything is documented – you can even start a continuous build with Hudson. You can then download specific scripts to build OpenJDK on MacOSX and to create the installation packages (Will require Apple’s Developer Tools to be installed)

Enjoy !

, ,

4 Comments

How to remotely capture a core dump on a Mac ?

Mac OS X is usually a very stable OS, over the last 10 years I can count on my fingers the rare number of cases when the system entirely crashed and required a reboot.

(I am not counting the deliberate attempts to make it crash , playing with development version of kernel modules or very very early builds of all kinds)

Since a couple of months however, I am able to crash the entire system just using iTunes.

When downloading multiple files simultaneously or when starting any type of concurrent disk access for several minutes, iTunes freezes, bringing the whole system down with him.

It looks like this is linked to my type of machine (iMac 24″) as I can not reproduce on any other three machines at home.  I am not the only one experiencing this issue.  Apple’s support forums host a thread here and another here with people describing exact similar symptoms (some of them with PowerMacs too)

As I am part of the Apple developer Program, I opened a bug report to request attention about this.

Surprisingly, Apple answered with 2-3 weeks asking for more details, in particular, a stack trace of the system while in frozen state.

Stackshot can be enabled as follows:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.stackshot.plist

Then, type the following chord:

Control-Option-Command-Shift-Period

a file will be written out /Library/Logs/stackshot.log and a symbolized file will be written to /Library/Logs/stackshot-syms.log

Unfortunately, this does not help in my case as the whole system was unresponsive when the crash occurs, I have no possibility to type any command while the system is frozen.

Apple then asked me to produce a core dump, using Non Maskable Interrupt trigger and a remote core dump server.

Basically, the idea is to configure the kernel to let it send a core dump to a remote server, through the network.  On another machine, you’ll have to setup the core dump server, i.e. a process that will listen on the network, will accept the connection from the crashed kernel and will dump the data to a file on disk.

Once the kernel client and the core dump server configured, you need to tell the kernel to generate the data and send them to the remote server.  For this top happen, you’ll need to force a panic with DTrace for example.

But in my case, the kernel is not panicking, just freezing.

I had to generate a Non Maskable Interrupt to activate the debugging process.  Once properly configured as described in Apple Technical Note, this is a simple as shortly pressing the POWER button.

This method is explained with many details and options in Apple technical Note TN2118.  It is surprisingly easy to setup and allows to collect valuable debugging information for developers.  I am attaching a screen shot of the crashed machine while in this state.

I hope Apple will be able to provide a fix for this issue.

,

1 Comment