Project

General

Profile

Add host » History » Version 9

Anchi Cheng, 08/12/2014 02:15 PM

1 2 Anchi Cheng
h2. Add the IP address and matching hostname of the microscope and digital camera computer in your host file on the main Leginon computer, and vice versa.
2 1 Anchi Cheng
3 8 Anchi Cheng
h3. Find out what python thinks the hostname is. * REPEAT THIS BOTH ON Linux processing server and instrument WIndows PC* so you have all the information.
4 3 Anchi Cheng
5
Run the following in python command line:
6
<pre>
7
import socket
8
socket.gethostname()
9
</pre>
10 1 Anchi Cheng
11 8 Anchi Cheng
h3. Find out the ip address associate with the hostname
12
13
Run the following in python command line:
14 4 Anchi Cheng
<pre>
15 8 Anchi Cheng
import socket
16
socket.gethostbyname('your_host_name')
17 4 Anchi Cheng
</pre>
18 2 Anchi Cheng
19 8 Anchi Cheng
h3. Modify your host file on the linux Leginon computer to include the instrument host if the latter is not already mapped by your domain name server
20 1 Anchi Cheng
21
*  On Linux, this host file is
22
> /etc/hosts
23
24 8 Anchi Cheng
Example of hosts file:
25 1 Anchi Cheng
26 8 Anchi Cheng
<pre>
27
192.000.1.222   instrument_host_name.domain_name instrument_short_host_name
28
</pre>
29
30 9 Anchi Cheng
h3. Use shorter hostname if desired
31
32 8 Anchi Cheng
If you'd like to shorten your linux hostname recognized by socket without the domain name, you may do so as root
33
<pre>
34
hostname your_shorter_hostname
35
</pre>
36
37
and also add that to the /etc/hosts as an alternative name
38
<pre>
39
192.000.1.333   long_host_name.domain_name your_shorter_hostname
40
</pre>
41 9 Anchi Cheng
42
You will need to restart networking to make it persistent.
43
<pre>
44
/etc/init.d/network restart
45
</pre>
46
47
Test the change by finding the ip address with the hostname as in the above section.
48 8 Anchi Cheng
49
h3. The Linux main Leginon computer also needs to identify itself by its hostname registered on the instrument Windows computer.
50 1 Anchi Cheng
51 7 Anchi Cheng
*  On Window XP and WIndows 7 this host file is
52 1 Anchi Cheng
> C:\\WINDOWS\system32\drivers\etc\hosts
53
54 7 Anchi Cheng
*  On Window NT, this host file is
55 1 Anchi Cheng
> C:\\WINNT\system32\drivers\etc\hosts