-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add direct-ip support for tsung nodes interconnection #189
Conversation
…ons within /etc/hosts file any more, without the dns server support now
IntroThis pull request adds the ability that the tsung_controller can connect the tsung client server with direct ip support. In many case, the server's hostname is shortname, add the local dns server not resolve it. echo "10.10.10.10 tsung_master" >> /etc/hosts
echo "10.10.10.11 tsung_client1" >> /etc/hosts Using the IP direct feature will avoid many settings, if you have one tsung cluster with lots of servers. How to use it1. Tsung Controller using IP with FQDN supportWhen start tsung, you can use the tsung -I Your_Server_IP -f tsung.xm start eg: tsung -I 10.10.10.10 -f tsung.xm start You get the node name is : tsung_controller@10.10.10.10. 2. Set up the client ip attribution<client host="tsung_client1" hostip="10.10.10.11" maxusers="120000" cpu="7" weight="4">
<ip value="10.10.10.11"></ip>
<ip value="10.10.10.12"></ip>
</client> In order to support the tsung client with direct ip support, I add the <!ATTLIST client
cpu NMTOKEN "1"
type (machine | batch) "machine"
host NMTOKEN #IMPLIED
hostip CDATA ""
batch (torque | pbs | lsf | oar) #IMPLIED
scan_intf NMTOKEN #IMPLIED
maxusers NMTOKEN "800"
use_controller_vm (true | false) "false"
weight NMTOKEN "1"> Then the tsung client node name will be : tsung1@10.10.10.11 . 3. How does it workThe major logic within HostIP = getAttr(Attrs, hostip),
...
%% if the node()'s hostname is ip, then we will got the hostip replace the host attr
{ok, MasterHostname} = ts_utils:node_to_hostname(node()),
case {ts_utils:is_ip(MasterHostname), ts_utils:is_ip(Host), ts_utils:is_ip(HostIP)} of
%% must be hostname and not ip:
{false, true, _} ->
io:format(standard_error,"ERROR: client config: 'host' attribute must be a hostname, "++ "not an IP ! (was ~p)~n",[Host]),
exit({error, badhostname});
{true, true, _} ->
%% add a new client for each CPU
lists:duplicate(CPU,#client{host = Host,
weight = Weight/CPU,
maxusers = MaxUsers});
{true, _, true} ->
%% add a new client for each CPU
lists:duplicate(CPU,#client{host = HostIP,
weight = Weight/CPU,
maxusers = MaxUsers});
{_, _, _} ->
%% add a new client for each CPU
lists:duplicate(CPU,#client{host = Host,
weight = Weight/CPU,
maxusers = MaxUsers})
end If the tsung_controller's node hostname and the That's all :))
NOTEThanks to @nniclausse 's advice, I add |
Hey! This seems like a really nice addition, without much impact! I'll take a little test drive this weekend, but as far as I can tell, this looks good. Thanks! |
Hi; |
@nniclausse Haha, I have added |
…ons within /etc/hosts file any more, without the dns server support now