Skip to main content

Posts

Showing posts from March, 2010

Erlang nodes and /etc/hosts configuration

The basic unit of erlang distributed programming is erlang node. To find an erlang node is a prerequisite for running program on it. The configuration of /etc/hosts and domain resolving may affect. The issue came to me when I tested discoproject on two computers and got "Node failure". Let's start with the classic example in Pragmatic Programming Erlang. First we start two erlang shell on the same machine, one named gandalf, the other named bilbo: erl -sname gandalf erl -sname bilbo In node bilbo, you try "net_adm:ping(gandalf@localhost)." and you suppose to get a "pong" as response. Unfortunately, this may not happen on every computers, it is highly possible you may get a "pang" or some error massage. But you may start erlang shells in another way: erl -sname gandalf@localhost erl -sname bilbo@localhost This time, you should finally get a "pong"(if you got "pang" before). The magic lies here, if start an erlan

NameError when easy_install tc-0.7.2

Tc is python interface for Tokyo Cabinet, supporting Table DB feature. I got an "NameError: global name 'debian' is not defined" when "sudo easy_install tc-0.7.2". I managed to get the library instlled as follow: 1) Download and uzip the package. The download address is http://pypi.python.org/packages/source/t/tc/tc-0.7.2.tar.gz . 2) Edit setup.py, and comment out the following lines: try: shell_cmd('which dpkg-buildpackage') self.cmdclass['debian'] = debian except IOError: pass 3) Build and install tc: python setup.py build python setup.py install