forked from newville/epicsarchiver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
208 lines (141 loc) · 6.93 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
==
==
== General installation instructions for the EpicsArchiver.
==
The installation of EpicsArchiver is not as simple as I would like, due the
fairly large number of packages that it depends on: mysql, Apache, Gnuplot,
Epics Base, and the python connections to these (MySQLdb, mod_python,
Gnuplot.py, and PyEpics). The installation is not especially difficult,
but there are many small steps. It also assumes you have a pretty good
working knowledge of linux and a passing familiarity with Apache.
The end result of the installation will be fairly simple and
straightforward to use:
1. pvarch: a command line program for interacting
with the data collection / archiving
2. mysql databases and tables holding the data.
3. a directory of web scripts to access the data for
plotting, viewing status, and so on.
4. a directory of web-page templates for creating the
web status page.
== Quick Installation Instructions ===
0. Install Apache, Python, MySQL, and Gnuplot on a linux machine.
These are all standard components on modern linux systems,
and may be installed already. You should not need custom
installations.
1. Install Epics base.
2. Install mod_python.
3. Install python extensions for PyEpics, Gnuplot, MySQL.
4. Set up a privileged MySQL account that can grant permissions.
5. copy config_dist.py to config.py, and edit the settings for
your system.
6. run 'python setup.py install'
7. configure Apache to use mod_python for the web programs, by
adding the generated text to the Apache configuration file.
8. initialize the MySQL databases with 'init_pvarch'. Here,
you will be prompted for a MySQL username/password that can
grant permissions.
9. start data collection with the cache:
pvarch cache start
pvarch start
10. add some PVs to be collected.
11. view / modify web page templates
12. Set up cron scripts to manage databases
13. Continue to add PVs and/or modify web pages
============================================================
Detailed instructions:
== 0. Install / Check for Apache, Python, MySQL, and Gnuplot.
A standard Apache installation can work, though you will need one with
'APXS' for loading mod_python.
There are many variations among the linux packages for where Apache things
(configuration files, static web pages, cgi scripts, log files) get placed.
You will have to learn a little about the Apache configuration on your
machine, and will probably have to alter config.py accordingly.
For Python, MySQL, and Gnuplot, standard linux packages will work. Some
systems come with a Gnuplot that uses ugly fonts. If this drives you
crazy, reinstalling with simple configuration settings seems to fix this.
== 1. Install Epics base, Apache, Python, MySQL, and Gnuplot.
For Epics, only Epics base is needed. Use R3.14.9 or higher if you can.
Installation can be as simple as:
mkdir /usr/local/epics
cd /usr/local/epics
wget http://www.aps.anl.gov/epics/download/base/baseR3.14.9.tar.gz
tar xvzf baseR3.14.9.tar.gz
cd base-3.14.9/
export EPICS_HOST_ARCH=linux-x86
make
cd ..
ln -s base-3.14.9 base
You should also add /usr/local/epics/base/lib/linux-86 to the ld.so.conf
for the system (you could use LD_LIBRARY_PATH, but the unprivileged web
user account needs to find EPICS too, so doing this system-wide is
recommended).
== 2. Install mod_python
A linux package for mod_python ought to work, but you may need to build
from source too. It's straightforward, but you'll need to know
some details about Apache, especially where 'apxs' is.
== 3. Install python extensions for PyEpics, Gnuplot, MySQL.
These all install with 'python setup.py install'. These python
packages are included in py_install.
The PyEpics installation will need to find EPICS base, so if it is
somewhere other than /usr/local/epics/base, you may need to set the
environmental variable EPICS_BASE.
Many linux systems come with a slightly old Gnuplot that will work but
make plots with mediocre fonts. Installing the latest gnuplot 4.2 with
a simple
./configure --prefix=/usr
make install
will enable better looking fonts.
== 4. Set up MySQL permissions for a privileged account that can
grant permissions.
That is, set up a mysql super-user account:
~> mysql
mysql> grant all on *.* to bush@localhost identified by 'Barbara' with GRANT OPTION;
You will need to use this username/password to set up the databases
for the archiver
== 5. edit the settings in config.py
Copy config_dist.py to config.py and edit accordingly. There are many
setting in config.py, mostly which has further instructions
for what they mean. You will need to edit these to reflect your set up.
== 6. run 'python setup.py install'
This installs the initial set up of python code, the program 'pvarch', the
web scripts, and initial web template files.... you're close!!
== 7. Configure Apache to use mod_python for the web programs
Doing 'python setup.py install' wrote the file httpd_pvarch.conf
This should go into Apache's configuration, and apache should be restarted.
== 8. Initialize the MySQL databases with 'bin/init_pvarch'
This will create the initial databases for archiving. You will be prompted
for the 'super-user' username/password from Step 3.
Note that running this will wipe out any previous archiving databases, so
you really only need to run this once.
== 9. Add some PVs to be collected.
Use the 'pvarch' program to add individual PVs or a file listing PVs:
~>pvarch add_pv 'XXX.VAL'
~>pvarch add_pvfile 'PvList.txt'
PvList.txt lists PVs to be added, one or more (comma separated) per line.
== 10. Start data collection.
Start both the caching and archiving processes:
~>pvarch cache start
~>pvarch start
This creates 2 processes:
'cacher' : connects to Epics PVs and caches their current
values into a database
'archiver': reads the cached values and archives.
== 11. View / Modify web page templates
You can view the PVs with the cgi-bin/show
web script (the URL being set from config.py), and will probably
be something like:
http://xxx.anl.gov/cgi-bin/pvarch/show/
The PVs shown are determined by the web template files (which are
copied from the templates/ directory at installation to the final
destination set in config.py).
Editing these templates will change what is shown on the status pages.
See the README in the template directory for more details.
== 12. Set up cron scripts to manage databases
You may want to check the status of the cache and archiver periodically,
and rotate archive databases. The scripts in cron/ give some examples
of this.
== 13. Continue to add PVs and/or modify web pages
Note that once the web pages are working, adding PVs to a template file
will add it to the cache and archive as soon as the page is accessed.
When running, this is often the easiest way to add a PV to the archive.
=======================================================================