DistccTycoon: distcc_tycoon.txt

File distcc_tycoon.txt, 5.3 KB (added by DennisWilkinson, 4 years ago)
Line 
1This is a how-to for installing distcc to run on a Tycoon cluster.
2
3distcc is a free, distributed C compiler available at distcc.samba.org.
4
5In this guide the "client" is the machine directing the compilation,
6probably your local machine, and the "servers" are the machines to
7which the jobs are distributed. Of course distcc can also use the
8client to do some of the work.
9
10It is assumed that the user has established accounts on several machines and
11has downloaded the distcc tarball from distcc.samba.org.
12
13This guide first shows how to install distcc on the client, then on one
14server at a time, and finally on multiple servers at once.
15After the installation steps is a brief guide to getting distcc up and running.
16
17
18INSTALLATION ON CLIENT
19
201. Install gcc on client machine if you don't have it:
21   #yum -y install gcc.
22
232. Install distcc.
24   a. Unzip and untar distcc tarball.
25   b. Go into the distcc directory and install it with
26      $./configure
27      $make
28      #make install
29
30
31INSTALLATION ON ONE SERVER AT A TIME
32
33In this section {} represents the place where you type in the IP address of
34the server.
35
361. Run the following command to open port 3632 on the server:
37   $tycoon host bid {} 1000000000 "{ ('TCPv4Port', '3632'): 1}"
38
39   Here {} is the IP address of the machine you will be connecting to.
40   This command is necessary to enable distcc to communicate with the server.
41
422. Install distcc on the server
43
44   a. Copy distcc tarball to server:
45      $tycoon_scp distcc-2.18.3.tar.bz2 {}:
46
47      Don't forget the colon at the end of the copy command.
48
49   b. ssh into machine with
50      $tycoon_ssh {}
51
52   c. Follow the steps above (in INSTALLATION TO CLIENT) to install distcc.
53
54      The root password on tycoon virtual machines is rootroot.
55   
563. Start the distcc daemon on the server with
57   $distccd --daemon -a {client IP address} --log-file log --log-level info
58
59   The log file name (I used "log" above) is your choice.
60   I find that "info" is a useful log-level; for others see the man page.
61
62
63INSTALLATION ON MULTIPLE SERVERS AT ONCE
64
65To save time you can use use vxargs to execute commands on multiple
66remote machines at once. vxargs is a python script available online.
67vxargs reads a text file to get the IP address of the machines to connect to.
68This file must have the machine addresses by themselves on separate lines.
69
70In vxargs commands, you type in {} literally to tell vxargs where
71to put the remote machine's IP address. This may be confusing in light of
72my previous notation. So: you must literally include the characters "{}" in
73a vxargs command where the IP address would normally go.
74
751. Install gcc on the servers:
76   $vxargs -a iplist.txt -o vxargs_log tycoon_ssh root@{} yum -y install gcc
77
78   In this command "iplist.txt" is a file and "vxargs_log" a directory.
79   You do not have to use these exact names.
80   iplist.txt is the list of addresses of the remote machines (as
81   described above).
82   vxargs_log is a directory containing the log files where
83   vxargs will write the output of your commands (stdout, stdin, stderr).
84
85   Again, you must literally include the "{}".
86
872. Open port 3632 on the servers:
88
89   $vxargs -a iplist.txt -o vxargs_log tycoon host bid {} 1000000000 "{ ('TCPv4Port', '3632'): 1}"
90
913. Copy in the installed distcc directory from your home machine:
92   $vxargs -a iplist.txt -o vxargs_log tycoon_scp -r distcc-2.18.8 {}:
93
94   This is far simpler than trying to install distcc directly
95   on each server using vxargs. There is a technical difficulty with the
96   command syntax of tycoon_ssh which makes a remote distcc install difficult.
97   Using ssh -p 47277 instead of tycoon_ssh in the remote install is possible
98   but you would have to establish all the servers as known hosts before
99   running vxargs because you can't input while vxargs is running.
100
1014. Start the distcc daemon on the servers:
102
103   $vxargs -a iplist.txt -o vxargs_log tycoon_ssh {} ./distcc-2.18.8/distccd --daemon -a {client IP address} --log-file log --log-level info
104
105   Because distcc was not directly installed, the path will not be updated
106   on the servers and you have to include the path in the command
107   to start the daemon.
108
109
110RUNNING DISTCC
111
112This is a brief guide to how to issue a distcc command. For more information
113see the man page.
114
115Once distcc is installed on the client and servers, you have opened port
1163632 on the servers and started the daemons there, there is one thing left
117to do. On the client, do an
118
119$export DISTCC_HOSTS='{server 1 IP address} {server 2 IP address} ...'
120
121This variable tells distcc where to send the jobs. You can include
122"localhost" in this list and jobs will be compiled on the client too.
123The order of the servers in the DISTCC_HOSTS variable determines the
124priority, so put the fastest machines first for best results.
125
126The man pages include a list of other options for this command, as well
127as other shell variables distcc can use.
128
129
130Finally, to compile using distcc, just type
131
132$make -j # CC=distcc {whatever}.
133
134Here # indicates the number of jobs to run at once. This must be
135at least as large as the number of servers if you want to use them all.
136You can experiment with increasing this number, which may
137improve the performance.
138
139There are other ways to send the make command to distcc;
140for example, you can set distcc to be the default compiler. See man pages.