Really strange DNS problems?

I was doing some maintenance on an older server of a friend of mine, where there was a strange problem. For some processes DNS resolving worked well, for other I just got things like this from php
php_network_getaddresses: getaddrinfo failed
and similar from the mail daemon, new relic sysmon daemon, and others.

After stracing the processes, I found that the failing processes tried to resolve host names at 127.0.0.1 port 53, whereas the working ones used the local provider or 8.8.8.8 which I added.

What was the problem? The access rights on /etc/resolv.conf were wrong! The file was not readable for other users than root.

Sam Newman’s talk – Practical Considerations For Microservices

Sam Newman had a very useful talk at YOW 2013 in Melbourne and Brisbane about Microservices. An updated version was presented at Javazone in Oslo in September 2014.

In both versions he presented 14 tips for a microservice architecture. How has his thinking evolved?

At YOW 2013

1 Standardise in the gaps between services – be flexible about what happens inside the boxes
2 Avoid RPC-mechnaisms or shared serialisation protocols to avoid coupling
3 Have one, two or maybe three ways of integrating, not 20
4 Pick some sensible conventions, and stick with them
5 Use synthetic transactions to test production systems
6 Avoid distributed transactions if at all possible
7 Capture metrics, and logs, for each node, and aggregate them to get a rolled up picture
8 Use correlation IDs to track down nasty bugs
9 Abstract out underlying platform differences to provide a uniform deployment mechanism
10 Have a single way of deploying services in any given environment
11 Consumer Driven Tests to catch breaking changes
12 Don’t let changes build up – release as soon as you can, and preferably one at a time
13 Use timeouts, circuit breakers and bulk-heads to avoid cascading failure
14 Consider Service Templates to make it easy to do the right thing

At Javazone 2014

1 Standardise in the gaps between services – be flexible about what happens inside the boxes
2 Have a clear custodian model
3 Avoid RPC-mechnaisms or shared serialisation protocols to avoid coupling
4 Separate the databases before separating services
5 Adopt a consumer first approach
6 Capture metrics, and logs, for each node, and aggregate them to get a rolled up picture
7 Use synthetic transactions to test production systems
8 Use correlation IDs to track down nasty bugs
9 Abstract out underlying platform differences to provide a uniform deployment mechanism
10 Consumer Drive Tests to catch breaking changes
11 Don’t let changes build up – release as soon as you can, and preferably one at a time
12 Consider Service Templates to make it easy to do the right thing
13 Use timeouts, circuit breakers and bulk-heads to avoid cascading failure
14 Find your own balance

The order of evolution of integration styles is still the same:

  • Data oriented
  • Procedure oriented
  • Document oriented
  • Resource oriented

References:
http://www.slideshare.net/spnewman/practical-microservices-javazone-2014
http://www.slideshare.net/spnewman/practical-microservices-yow-2013

Toshiba Encore WT8 – Battery not detected

The Encore WT8 tablet that I was testing was just installed when suddenly the battery was not detected any more, even though the device actually was running on batteries.

Interestingly, I couldn’t find any one with the same problem, but I tried the usual stuff, resetting bios to default settings, exhausting the battery etc.

Finally, it was solved, but I’m not certain which step was the actual fix. Or maybe it was a combination?

Anyway – I upgraded to bios 1.60, but had to hack the installer as it has a battery check. “Insert system battery”.  Unzipping the bios-installer with 7zip, twice, you get access to a platform.ini-file, where you can change a line to BatteryCheck=0, and then run the flasher. I needed the BitLocker recovery key from Microsoft to boot again, restored bios settings, did a proper shutdown, and finally powered it off by pressing the power button and volume up.

The last part was found on the Microsoft Surface support pages as Solution 4 to battery problems.

http://www.microsoft.com/surface/en-us/support/hardware-and-drivers/surface-battery-wont-charge?lc=1044

My device now has bios v1.60 and embedded controller 0.84, so it’s probably a very early unit.

 

Running VisualVM through an ssh tunnel with SOCKS

Migrated post from http://labs.skiinfo.com in 2009:

VisualVM was included for the first time with JDK 6u07, and is improving with every release.

For our production environment there is one huge show stopper: It doesn’t work very well through firewalls. RMI allocates a random port number, which is unpractical when we want to tunnel the traffic with SSH. A possibility has been to use WideCap, tsocks or a similar proxifier, but we were really looking for a cleaner solution.

With a combination of a SOCKS proxy (like putty or openssh!), and setting some system properties on startup, we’ll traverse the firewalls!

Run “ssh -D 9696 your.production.internal.com” and you’ll have a SOCKS server on localhost. (Or add a dynamic tunnel in Putt). In this way you can tunnel jstat traffic with a command like this:
jstat -gcutil -J-DsocksProxyHost=localhost -J-DsocksProxyPort=9696 25883@cluster1.internal.com

But unfortunately VisualVM does not support the system properties setting a global SOCKS proxy. However, VisualVM is based on Netbeans, and in the sources we find that Netbeans have a more advanced support for proxies, letting you select between http proxies or SOCKS proxies.

We finally managed to run VisualVM over SSH with the following command line:
visualvm.exe -J-Dnetbeans.system_socks_proxy=localhost:9696 -J-Djava.net.useSystemProxies=true

 

You might need Jstatd running on your server. If your firewall blocks most ports from your external interface, you can use the following permission file:
grant {
permission java.security.AllPermission;
};
in grant-all-permissions.txt

Then start
jstatd -J-Djava.security.policy=grant-all-permissions.txt

If you have remote JMX enabled in your application server, you can add a JMX connection separately (easy in VisualVM 1.2-beta) for the JMX port.

Thanks to ankon (http://stackoverflow.com/users/196315/ankon) for noting.

 

The same probably applies to the built in jconsole and jvisualvm programs.

Ås by night and fog at Hvitsten 8/4-2008

hvitsten-aas-by-night-hennings-40-90-smallThe most obvious mistake was that I had the wrong plan out of the 6th – but changed my mind. It was probably the right thing to do, but I lost 2 minutes on this leg. Additionally at this point of the course I really should have brought some water/maxim. Fortunately it was possible to run on paths on many of the remaining legs, but I lost some time on the 11th and 12th leg as well, due to sloppy / tired orienteering. The map of 9.2 km ÅsbNFC final 2008.

The colours are yellow below 4.0 m/km  and black above 9.0 m/km.

Gateløp på Gjettum

trening-20080228Det var merkbart at det er noen måneder siden forrige o-løp på beina. Dagens løp var uten særlig flyt. I tillegg klarte også jeg å tape tid på islagte gressletter.

Hvis du lurer på hvor jeg gjennomførte dårlig, så er det bare å se på veivalg fargelagt etter løpshastighet. Sort farge betyr dårligere enn ca 7 min/km, gul betyr raskere enn 3.30 min/km.

Turagrø-Fanaråken opp

På grunn av uvær ble det Turtagrø-Sognefjellshytta opp istedet… Situasjonen på Fanaråken om morgenen var -4, kraftig vind, 10 cm sne, og merkingen var blitt borte i løpet av natten. Arrangøren gikk derfor over til backup-løsningen, 16.5 km asfalt til Sognefjellshytta. Ikke akkurat det vi var forberedt på , forrige løpetur på over en time på asfalt var antagelig i mars. Henning åpnet kanskje noe hardt, og hadde øyekontakt med teten et godt stykke. Zsuzsa hadde ryggen min, og på første væskestasjon var vi sammen. Generelt løp jeg bedre nedover og fikk luke, som Zsuzsa tettet i første motbakke. Det ble en fin konkurranse, og Zsuzsa hadde full kontroll på damefeltet. Henning ble best i huset, og er fornøyd med det. 😉 Vinneren i herreklassen ble en Vidar-løper.

Fanaråken Duathlon ble vunnet av “motbakke-kongen” Jon Tvedt.