Add host » History » Version 8
Anchi Cheng, 08/12/2014 02:09 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 | If you'd like to shorten your linux hostname recognized by socket without the domain name, you may do so as root |
||
31 | <pre> |
||
32 | hostname your_shorter_hostname |
||
33 | </pre> |
||
34 | |||
35 | and also add that to the /etc/hosts as an alternative name |
||
36 | <pre> |
||
37 | 192.000.1.333 long_host_name.domain_name your_shorter_hostname |
||
38 | </pre> |
||
39 | |||
40 | h3. The Linux main Leginon computer also needs to identify itself by its hostname registered on the instrument Windows computer. |
||
41 | 1 | Anchi Cheng | |
42 | 7 | Anchi Cheng | * On Window XP and WIndows 7 this host file is |
43 | 1 | Anchi Cheng | > C:\\WINDOWS\system32\drivers\etc\hosts |
44 | |||
45 | 7 | Anchi Cheng | * On Window NT, this host file is |
46 | 1 | Anchi Cheng | > C:\\WINNT\system32\drivers\etc\hosts |