锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲成Av人片乱码色午夜,国产精品亚洲一区二区三区,亚洲女人影院想要爱http://blogjava.net/ivanwan/category/36393.html鑷敱鐨勫姏閲忥紝鑷敱鐨勭敓媧匯?/description>zh-cnSat, 05 Apr 2014 04:49:57 GMTSat, 05 Apr 2014 04:49:57 GMT60RabbitMQ 3.3.0榪滅▼guest鑳借闂?/title><link>http://m.tkk7.com/ivanwan/archive/2014/04/04/411974.html</link><dc:creator>ivaneeo</dc:creator><author>ivaneeo</author><pubDate>Fri, 04 Apr 2014 13:28:00 GMT</pubDate><guid>http://m.tkk7.com/ivanwan/archive/2014/04/04/411974.html</guid><wfw:comment>http://m.tkk7.com/ivanwan/comments/411974.html</wfw:comment><comments>http://m.tkk7.com/ivanwan/archive/2014/04/04/411974.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/ivanwan/comments/commentRss/411974.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/ivanwan/services/trackbacks/411974.html</trackback:ping><description><![CDATA[<div>/etc/rabbitmq.conf:<br /><br />[</div><div>    {rabbit, [{loopback_users, []}]}</div><div>].</div><img src ="http://m.tkk7.com/ivanwan/aggbug/411974.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/ivanwan/" target="_blank">ivaneeo</a> 2014-04-04 21:28 <a href="http://m.tkk7.com/ivanwan/archive/2014/04/04/411974.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Starting a set of Erlang cluster nodes http://m.tkk7.com/ivanwan/archive/2011/03/18/346552.htmlivaneeoivaneeoFri, 18 Mar 2011 09:09:00 GMThttp://m.tkk7.com/ivanwan/archive/2011/03/18/346552.htmlhttp://m.tkk7.com/ivanwan/comments/346552.htmlhttp://m.tkk7.com/ivanwan/archive/2011/03/18/346552.html#Feedback0http://m.tkk7.com/ivanwan/comments/commentRss/346552.htmlhttp://m.tkk7.com/ivanwan/services/trackbacks/346552.htmlThis tutorial explains how to configure your cluster computers to easily start a set of Erlang nodes on every machine through SSH. It shows how to use the slave module to start Erlang nodes that are linked to a main controler.

Configuring SSH servers

SSH server is generally properly installed and configured by Linux distributions, if you ask for SSH server installation. The SSH server is sometime called sshd, standing for SSH deamon.

You need to have SSH servers running on all your cluster nodes.

Configuring your SSH client: connection without password

SSH client RSA key authentification

To be able to manage your cluster as a whole, you need to set up your SSH access to the cluster nodes so that you can log into them without being prompt for a password or passphrase. Here are the needed steps to configure your SSH client and server to use RSA key for authentification. You only need to do this procedure once, for each client/server.

  1. Generate an SSH RSA key, if you do not already have one:
    ssh-keygen -t rsa
        
  2. Copy the id_rsa.pub file to the target machine:
    scp .ssh/id_rsa.pub userid@ssh2-server:id_rsa.pub
        
  3. Connect through SSH on the server:
    ssh userid@ssh2-server
        
  4. Create a .ssh directory in the user home directory (if necessary):
    mkdir .ssh
        
  5. Copy the contents of the id_rsa.pub file to the authorization file for protocol 2 connections:
    cat id_rsa.pub >>$HOME/.ssh/authorized_keys
        
  6. Remove the id_rsa.pub file:
    rm $HOME/id_rsa.pub
        

    Alternatively, you can use the command ssh-copy-id ssh2-server, if it is available on your computer, to replace step 2 to 6. ssh-copy-id is for example available on Linux Mandrake and Debian distributions.

Adding your identity to the SSH-agent software

After the previous step, you will be prompted for the passphrase of your RSA key each time you are initialising a connection. To avoid typing the passphrase many time, you can add your identity to a program called ssh-agent that will keep your passphrase for the work session duration. Use of the SSH protocol will thus be simplified:

  1. Ensure a program called ssh-agent is running. Type:
    ps aux | grep ssh-agent
        

    to check if ssh-agent is running under your userid. Type:

    pstree
        

    to check that ssh-agent is linked to your current window manager session or shell process.

  2. If ssh-agent is not started, you can create an ssh-agent session in the shell with, for example, the screen program:
    ssh-agent screen
        

    After this command, SSH actions typed into the screen console will be handle through the ssh-agent.

  3. Add your identity to the agent:
    ssh-add
        

    Type your passphrase when prompted.

  4. You can list the identity that have been added into the running ssh-agent:
    ssh-add -l
        
  5. You can remove an identity from the ssh-agent with:
    ssh-add -d
        

Please consult ssh-add manual for more options (identity lifetime, agent locking, ...)

Routing to and from the cluster

When setting up clusters, you can often only access the gateway/load balancer front computer. To access the other node, you need to tell the gateway machine to route your requests to the cluster nodes.

To take an example, suppose your gateway to the cluster is 80.65.232.137. The controler machine is a computer outside the cluster. This is computer where the operator is controling the cluster behaviour. Your cluster internal adresses form the following network: 192.0.0.0. On your client computer, launch the command:

route add -net 192.0.0.0 gw 80.65.232.137 netmask 255.255.255.0
This will only works if IP forwarding is activated on the gateway computer.

To ensure proper routing, you can maintain an common /etc/hosts file with entries for all computers in your cluster. In our example, with a seven-computers cluster, the file /etc/hosts could look like:

10.9.195.12   controler
80.65.232.137 gateway
192.0.0.11    eddieware
192.0.0.21    yaws1
192.0.0.22    yaws2
192.0.0.31    mnesia1
192.0.0.32    mnesia2

You could also add a DNS server, but for relatively small cluster, it is probably easier to manage an /etc/hosts file.

Starting Erlang nodes and setting up the Erlang cluster

Starting a whole Erlang cluster can be done very easily once you can connect with SSH to all cluster node without being prompt for a password.

Starting the Erlang master node

Erlang needs to be started with the -rsh ssh parameters to use ssh connection to the target nodes within the slave command, instead of rsh connection. It also need to be started with network enable with the -sname node parameter.

Here is an example Erlang command to start the Erlang master node:

erl -rsh ssh -sname clustmaster

Be carefull, your master node short name has to be sufficent to route from the slave nodes in the cluster to your master node. The slave:start timeout if it cannot connect back from the slave to your master node.

Starting the slave nodes (cluster)

The custom function cluster:slaves/1 is a wrapper to the Erlang slave function. It allows to easily start a set of Erlang node on target hosts with the same cookie.

-module(cluster).
-export([slaves/1]).
%% Argument:
%% Hosts: List of hostname (string)
slaves([]) ->
ok;
slaves([Host|Hosts]) ->
Args = erl_system_args(),
NodeName = "cluster",
{ok, Node} = slave:start_link(Host, NodeName, Args),
io:format("Erlang node started = [~p]~n", [Node]),
slaves(Hosts).
erl_system_args()->
Shared = case init:get_argument(shared) of
error -> " ";
{ok,[[]]} -> " -shared "
end,
lists:append(["-rsh ssh -setcookie",
atom_to_list(erlang:get_cookie()),
Shared, " +Mea r10b "]).
%% Do not forget to start erlang with a command like:
%% erl -rsh ssh -sname clustmaster

Here is a sample session:

mremond@controler:~/cvs/cluster$ erl -rsh ssh -sname demo
Erlang (BEAM) emulator version 5.3 [source] [hipe]
Eshell V5.3 (abort with ^G)
(demo@controler)1> cluster:slaves(["gateway", "yaws1", "yaws2", "mnesia1", "mnesia2", "eddieware"]).
Erlang node started = [cluster@gateway]
Erlang node started = [cluster@yaws1]
Erlang node started = [cluster@yaws2]
Erlang node started = [cluster@mnesia1]
Erlang node started = [cluster@mnesia2]
Erlang node started = [cluster@eddieware]
ok

The order of the nodes in the cluster:slaves/1 list parameter does not matter.

You can check the list of known nodes:

(demo@controler)2> nodes().
[cluster@gateway,
cluster@yaws1,
cluster@yaws2,
cluster@mnesia1,
cluster@mnesia2,
cluster@eddieware]

And you can start executing code on cluster nodes:

(demo@controler)3> rpc:multicall(nodes(), io, format, ["Hello world!~n", []]).
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!
{[ok,ok,ok,ok,ok,ok],[]}
If you have trouble with slave start, you can uncomment the line:
%%io:format("Command: ~s~n", [Cmd])
before the open_port instruction:
open_port({spawn, Cmd}, [stream]),
in the slave:wait_for_slave/7 function.


ivaneeo 2011-03-18 17:09 鍙戣〃璇勮
]]>
Erlang鐨刄nicode鏀寔http://m.tkk7.com/ivanwan/archive/2009/10/28/300065.htmlivaneeoivaneeoWed, 28 Oct 2009 07:19:00 GMThttp://m.tkk7.com/ivanwan/archive/2009/10/28/300065.htmlhttp://m.tkk7.com/ivanwan/comments/300065.htmlhttp://m.tkk7.com/ivanwan/archive/2009/10/28/300065.html#Feedback1http://m.tkk7.com/ivanwan/comments/commentRss/300065.htmlhttp://m.tkk7.com/ivanwan/services/trackbacks/300065.html闃呰鍏ㄦ枃

ivaneeo 2009-10-28 15:19 鍙戣〃璇勮
]]>
銆愯漿銆慹rlang 緗戠粶璋冧紭瀹炴垬http://m.tkk7.com/ivanwan/archive/2009/10/27/299927.htmlivaneeoivaneeoTue, 27 Oct 2009 07:49:00 GMThttp://m.tkk7.com/ivanwan/archive/2009/10/27/299927.htmlhttp://m.tkk7.com/ivanwan/comments/299927.htmlhttp://m.tkk7.com/ivanwan/archive/2009/10/27/299927.html#Feedback0http://m.tkk7.com/ivanwan/comments/commentRss/299927.htmlhttp://m.tkk7.com/ivanwan/services/trackbacks/299927.html闃呰鍏ㄦ枃

ivaneeo 2009-10-27 15:49 鍙戣〃璇勮
]]>
Unit Test in Erlanghttp://m.tkk7.com/ivanwan/archive/2009/10/27/299926.htmlivaneeoivaneeoTue, 27 Oct 2009 07:48:00 GMThttp://m.tkk7.com/ivanwan/archive/2009/10/27/299926.htmlhttp://m.tkk7.com/ivanwan/comments/299926.htmlhttp://m.tkk7.com/ivanwan/archive/2009/10/27/299926.html#Feedback0http://m.tkk7.com/ivanwan/comments/commentRss/299926.htmlhttp://m.tkk7.com/ivanwan/services/trackbacks/299926.html闃呰鍏ㄦ枃

ivaneeo 2009-10-27 15:48 鍙戣〃璇勮
]]>
Erlang: Let鈥檚 talk to javahttp://m.tkk7.com/ivanwan/archive/2009/10/27/299924.htmlivaneeoivaneeoTue, 27 Oct 2009 07:46:00 GMThttp://m.tkk7.com/ivanwan/archive/2009/10/27/299924.htmlhttp://m.tkk7.com/ivanwan/comments/299924.htmlhttp://m.tkk7.com/ivanwan/archive/2009/10/27/299924.html#Feedback0http://m.tkk7.com/ivanwan/comments/commentRss/299924.htmlhttp://m.tkk7.com/ivanwan/services/trackbacks/299924.html闃呰鍏ㄦ枃

ivaneeo 2009-10-27 15:46 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 国产成人无码区免费内射一片色欲 | 国产精品亚洲不卡一区二区三区| 99999久久久久久亚洲| 久久不见久久见免费视频7| 久久亚洲精品无码| 日本免费大黄在线观看| 99久久精品国产亚洲| 最近中文字幕大全免费视频| 亚洲综合国产精品| 18观看免费永久视频| 亚洲一区二区三区深夜天堂| 在线免费一区二区| 特级毛片爽www免费版| 久久夜色精品国产亚洲av | 8x网站免费入口在线观看| 亚洲综合色一区二区三区小说| 1000部拍拍拍18勿入免费视频下载 | 一级女人18毛片免费| 四虎必出精品亚洲高清| 日本免费网站观看| 一级人做人爰a全过程免费视频| 亚洲一区二区三区乱码A| 久久精品无码精品免费专区| 亚洲人成网站在线观看播放青青| 在线精品免费视频无码的 | 免费国产叼嘿视频大全网站 | 亚洲Av综合色区无码专区桃色| 91老湿机福利免费体验| 亚洲熟妇丰满xxxxx| 亚洲一级特黄大片在线观看| 美女在线视频观看影院免费天天看 | 国产一精品一av一免费爽爽 | 自拍偷自拍亚洲精品播放| 中文字幕精品亚洲无线码二区| 少妇太爽了在线观看免费视频| 亚洲国产精品免费观看| 国产福利电影一区二区三区,亚洲国模精品一区| 水蜜桃视频在线观看免费播放高清| 亚洲国产高清视频在线观看| 亚洲福利精品一区二区三区| 欧洲一级毛片免费|