这是我kvs.erl:如何改变我的主机名在二郎山
-module(kvs).
-export([start/0, store/2, lookup/1]).
start() -> register(kvs, spawn(fun() -> loop() end)).
store(Key, Value) -> rpc({store, Key, Value}).
lookup(Key) -> rpc({lookup, Key}).
rpc(Q) ->
kvs ! {self(), Q},
receive
{kvs, Reply} ->
Reply
end.
loop() ->
receive
{From, {store, Key, Value}} ->
put(Key, {ok, Value}),
From ! {kvs, true},
loop();
{From, {lookup, Key}} ->
From ! {kvs, get(Key)},
loop()
end.
当我启动使用二郎:ERL -name赵-setcookie ABC
然后:RPC:调用(fifar @ huihua.sohu-inc.com,KVS,存储,[天气,冷])。
它显示错误:
([email protected])1> rpc:call([email protected],kvs,store,[weather,cold]).
** exception error: bad argument in an arithmetic expression
in operator -/2
called as '[email protected]' - 'inc.com'
我认为这是对Linux的主机名,
,但我用这个Linux shell中:主机名-a
它不能显示“huihua.sohu-INC .COM”
所以我能做些什么,
感谢