| 1 |
\chapter{Running NoTA}\label{chap:running}\index{running} |
| 2 |
After all the programming, you might actually want to run you NoTA-based |
| 3 |
program. It is not very hard, but there some things to keep in mind. |
| 4 |
|
| 5 |
\section{First steps} |
| 6 |
The two important questions to answer are: |
| 7 |
\begin{itemize} |
| 8 |
\item which ones of my nodes have \emph{single-process} capabilities, and which not? |
| 9 |
\item which node should become the \emph{manager node}? |
| 10 |
\end{itemize} |
| 11 |
|
| 12 |
\subsection{Single-process or not?} |
| 13 |
In appendix~\ref{chap:building} we discussed the building of single-process |
| 14 |
and non-single-process nodes. It's important to know if we any nodes that are |
| 15 |
\textbf{not} single-process capable, you \textbf{have to} run the NoTA daemon, |
| 16 |
\textbf{nota-ind}. |
| 17 |
|
| 18 |
If you have received some binary ('\texttt{mynode}') , and don't \emph{know} if |
| 19 |
it supports single-process-capabilities or not, you can of course try. Or |
| 20 |
you can inspect the libraries '\texttt{mynode}' is linked against: |
| 21 |
\begin{verbatim} |
| 22 |
$ ldd myprogram ~ |
| 23 |
linux-gate.so.1 => (0xb7fb0000) |
| 24 |
libh_in3_sp.so.0 => /usr/lib/libh_in3_sp.so.0 (0xb7f80000) |
| 25 |
[ .... ] |
| 26 |
\end{verbatim} |
| 27 |
As you see \texttt{libh\_in3\_sp.*} in the linked libraries, you know the |
| 28 |
program has single-process capabilities. If it didn't you would have found |
| 29 |
\texttt{libh\_in3.*}. In practice, it's a good convention to put \texttt{-sp} |
| 30 |
somewhere in the binary name of nodes that support single-process mode. |
| 31 |
|
| 32 |
Once more: if at least one of your nodes does not have single process |
| 33 |
capabilities, you will need to start the NoTA daemon (read on for details). |
| 34 |
|
| 35 |
\subsection{Electing a manager} |
| 36 |
In any NoTA system there has to be at least one node with \emph{manager |
| 37 |
capabilities}\index{manager node} - we call this node the \textbf{manager |
| 38 |
ndde}. This node has some special responsibilities regarding an accurate |
| 39 |
view of the network -- that is, it maintains a list of active nodes in the |
| 40 |
network, and where to find them. This should be confused with the Resource |
| 41 |
Manager - the manager node works at an architecturally lower lever. |
| 42 |
|
| 43 |
\subsubsection{Not all managers are daemons} |
| 44 |
If your system, as explained before, not use the NoTA daemon, you can elect a |
| 45 |
manager by starting one of the (service) nodes with the special environment |
| 46 |
variable \texttt{NOTA\_LMANAGER}\index{\texttt{NOTA\_LMANAGER}}. If it is set |
| 47 |
to \texttt{1}, the node finds out about its role and will dutifully take on |
| 48 |
the corresponding reponsibilities. So: |
| 49 |
\begin{verbatim} |
| 50 |
$ NOTA_LMANAGER=1 my-node |
| 51 |
\end{verbatim} |
| 52 |
will make \textbf{my-node} the manager node. |
| 53 |
|
| 54 |
\subsubsection{Daemons can be managers too} |
| 55 |
If your system is using |
| 56 |
\texttt{nota-ind}\index{\texttt{nota-ind}}\index{daemon}, this is a natural |
| 57 |
choice to become the manager node. You can run start |
| 58 |
\texttt{nota-ind}\index{\texttt{nota-ind}} in manager-mode with the |
| 59 |
\textbf{-m} option: |
| 60 |
\begin{verbatim} |
| 61 |
$ nota-ind -m |
| 62 |
\end{verbatim} |
| 63 |
|
| 64 |
In some cases, you might even want to run multiple daemons of which of course |
| 65 |
only one can be the manager. |
| 66 |
|
| 67 |
\subsection{The resource manager} |
| 68 |
In many of the simpler examples, we don't use the Resource |
| 69 |
Manager\index{resource manager}(RM). As explained in chapter~\ref{chap:rm}, |
| 70 |
that is not a very scalable solution, and in bigger systems we \textbf{do} |
| 71 |
want to use the RM. |
| 72 |
|
| 73 |
After you've installed NoTA (if needed, see appendix~\ref{chap:installing}), |
| 74 |
the resource manager will be available as a program called |
| 75 |
\texttt{nota-rmsvc}\index{\texttt{nota-rmsvc}}. Note that the resource manager |
| 76 |
does \textbf{not} run in single-process mode; thus, running the resource |
| 77 |
manager also implies running \texttt{nota-ind}. |
| 78 |
|
| 79 |
When you start \texttt{nota-rmsvc}, you are greeted with a little menu: |
| 80 |
\begin{verbatim} |
| 81 |
$ nota-rmsvc |
| 82 |
[...] |
| 83 |
|
| 84 |
1: print service_list |
| 85 |
2: print eventreq_list |
| 86 |
8: initialize service_list |
| 87 |
9: clear eventreq_list |
| 88 |
x: exit |
| 89 |
[1-2, 8-9, x] > |
| 90 |
\end{verbatim} |
| 91 |
Options 1 and 2 allow you to inspect the list of services and events. Options |
| 92 |
8 and 9 can be used to clear them. The latter is of course not recommend to keep |
| 93 |
your NoTA-system well-functioning, but it can be useful for debugging. |
| 94 |
|
| 95 |
\section{Running} |
| 96 |
After all these decisions, we can start our system. You can follow the |
| 97 |
following steps: |
| 98 |
\begin{enumerate} |
| 99 |
\item If your system needs \texttt{nota-ind}, start it; in most cases, |
| 100 |
you'd use \texttt{nota-ind -m}, to start the NoTA daemon in manager mode; |
| 101 |
\item If your systems needs the Resource Manager, start |
| 102 |
\texttt{nota-rmsvc}. If you hadn't started \texttt{nota-ind} yet, the |
| 103 |
Resource Manager will not start; go back to step 1 in that case; |
| 104 |
\item start your Service Nodes (SNs); |
| 105 |
\item start your Application nodes (ANs); |
| 106 |
\item sit back an watch your system perform beyond expectations. |
| 107 |
\end{enumerate} |