XRootD
Loading...
Searching...
No Matches
XrdCmsConfig.hh
Go to the documentation of this file.
1#ifndef _CMS_CONFIG_H_
2#define _CMS_CONFIG_H_
3/******************************************************************************/
4/* */
5/* X r d C m s C o n f i g . h h */
6/* */
7/* (c) 2011 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
33#include <cstdlib>
34
35#include "Xrd/XrdJob.hh"
36#include "XrdCms/XrdCmsPList.hh"
37#include "XrdCms/XrdCmsTypes.hh"
38#include "XrdOuc/XrdOucPList.hh"
39#include "XrdOuc/XrdOucTList.hh"
40
41class XrdInet;
43class XrdScheduler;
44class XrdNetSecurity;
45class XrdNetSocket;
46class XrdOss;
47class XrdSysError;
48class XrdOucEnv;
49class XrdOucName2Name;
50class XrdOucProg;
51class XrdOucStream;
52class XrdCmsAdmin;
53
54struct XrdVersionInfo;
55
56class XrdCmsConfig : public XrdJob
57{
58public:
59
61int Configure1(int argc, char **argv, char *cfn);
62int Configure2();
63int ConfigXeq(char *var, XrdOucStream &CFile, XrdSysError *eDest);
64void DoIt();
65int GenLocalPath(const char *oldp, char *newp);
66int asManager() {return isManager;}
67int asMetaMan() {return isManager && isMeta;}
68int asPeer() {return isPeer;}
69int asProxy() {return isProxy;}
70int asServer() {return isServer;}
71int asSolo() {return isSolo;}
72
73int LUPDelay; // Maximum delay at look-up
74int LUPHold; // Maximum hold at look-up (in millisconds)
75int DELDelay; // Maximum delay for deleting an offline server
76int DRPDelay; // Maximum delay for dropping an offline server
77int PSDelay; // Maximum delay time before peer is selected
78int RWDelay; // R/W lookup delay handling (0 | 1 | 2)
79int QryDelay; // Query Response Deadline
80int QryMinum; // Query Response Deadline Minimum Available
81int SRVDelay; // Minimum delay at startup
82int SUPCount; // Minimum server count
83int SUPLevel; // Minimum server count as floating percentage
84int SUPDelay; // Maximum delay when server count falls below min
85int SUSDelay; // Maximum delay when suspended
86int MaxLoad; // Maximum load
87int MaxDelay; // Maximum load delay
88int MaxRetries; // Maximum number of non-DFS select retries
89int MsgTTL; // Maximum msg lifetime
90int RefReset; // Min seconds before a global ref count reset
91int RefTurn; // Min references before a global ref count reset
92int AskPerf; // Seconds between perf queries
93int AskPing; // Number of ping requests per AskPerf window
94int PingTick; // Ping clock value
95int LogPerf; // AskPerf intervals before logging perf
96
97int PortTCP; // TCP Port to listen on
98int PortSUP; // TCP Port to listen on (supervisor)
99XrdInet *NetTCP; // -> Network Object
100
101int P_cpu; // % CPU Capacity in load factor
102int P_dsk; // % DSK Capacity in load factor
103int P_fuzz; // % Capacity to fuzz when comparing
104int P_gsdf; // % Global share default (0 -> no default)
105int P_gshr; // % Global share of requests allowed
106int P_io; // % I/O Capacity in load factor
107int P_load; // % MSC Capacity in load factor
108int P_mem; // % MEM Capacity in load factor
109int P_pag; // % PAG Capacity in load factor
110
111char DoMWChk; // When true (default) perform multiple write check
112char DoHnTry; // When true (default) use hostnames for try redirs
113char nbSQ; // Non-blocking send queue handling option
114char MultiSrc; // Allow retries via 'tried=' and 'cms.sadd' cgi
115
116int DiskMin; // Minimum MB needed of space in a partition
117int DiskHWM; // Minimum MB needed of space to requalify
118short DiskMinP; // Minimum MB needed of space in a partition as %
119short DiskHWMP; // Minimum MB needed of space to requalify as %
120int DiskLinger; // Manager Only
121int DiskAsk; // Seconds between disk space reclaculations
122int DiskWT; // Seconds to defer client while waiting for space
123bool DiskSS; // This is a staging server
124bool DiskOK; // This configuration has data
125
126bool forceRO; // Manager will force incoming paths to be r/o
127
128char rsvd[3];
129
130char sched_RR; // 1 -> Simply do round robin scheduling
131char sched_Pack; // 1 -> Pick with affinity (>1 same but wait for resps)
132char sched_AffPC; // Affinity path component count (-255 <= n <= 255)
133char sched_Level; // 1 -> Use load-based level for "pack" selection
134char sched_Force; // 1 -> Client cannot select mode
135char sched_LoadR; // 1 -> Use randomized load-based weighting for selection
136int doWait; // 1 -> Wait for a data end-point
137
138int adsPort; // Alternate server port
139int adsMon; // Alternate server monitoring
140char *adsProt; // Alternate server protocol
141
142char *mrRdrHost; // Maxretries redirect target
145char *msRdrHost; // Nomultisrc redirect target
148
149XrdVersionInfo *myVInfo; // xrootd version used in compilation
150
151XrdOucName2Name *xeq_N2N; // Server or Manager (non-null if library loaded)
152XrdOucName2Name *lcl_N2N; // Server Only
153
155char *ossLib; // -> oss library
156char *ossParms; // -> oss library parameters
157char *prfLib; // ->perf library
158char *prfParms; // ->perf library parameters
159char *VNID_Lib; // Server Only
160char *VNID_Parms; // Server Only
161char *N2N_Lib; // Server Only
162char *N2N_Parms; // Server Only
163char *LocalRoot; // Server Only
164char *RemotRoot; // Manager
165char *myPaths; // Exported paths
166short RepStats; // Statistics to report (see RepStat_xxx below)
167char TimeZone; // Time zone we are in (|0x80 -> east of UTC)
169char myRType[4];
170char *myRole;
171const char *myProg;
172const char *myName;
173const char *myDomain;
174const char *myInsName;
175const char *myInstance;
176const char *mySID;
177const char *myVNID;
178const char *mySite;
179 char *envCGI;
180 char *cidTag;
181const char *ifList;
182XrdOucTList *ManList; // From manager directive
183XrdOucTList *NanList; // From manager directive (managers only)
184XrdOucTList *SanList; // From subcluster directive (managers only)
185
186XrdOss *ossFS; // The filsesystem interface
187XrdOucProg *ProgCH; // Server only chmod
188XrdOucProg *ProgMD; // Server only mkdir
189XrdOucProg *ProgMP; // Server only mkpath
190XrdOucProg *ProgMV; // Server only mv
191XrdOucProg *ProgRD; // Server only rmdir
192XrdOucProg *ProgRM; // Server only rm
193XrdOucProg *ProgTR; // Server only trunc
194
195unsigned long long DirFlags;
202
203 XrdCmsConfig() : XrdJob("cmsd startup") {ConfigDefaults();}
205
206// RepStats value via 'cms.repstats" directive
207//
208static const int RepStat_frq = 0x0001; // Fast Response Queue
209static const int RepStat_shr = 0x0002; // Share
210static const int RepStat_All = 0xffff; // All
211
212private:
213
214void ConfigDefaults(void);
215int ConfigN2N(void);
216int ConfigOSS(void);
217int ConfigProc(int getrole=0);
218int isExec(XrdSysError *eDest, const char *ptype, char *prog);
219int Manifest();
220int MergeP(void);
221int setupManager(void);
222int setupServer(void);
223char *setupSid();
224void Usage(int rc);
225int xapath(XrdSysError *edest, XrdOucStream &CFile);
226int xallow(XrdSysError *edest, XrdOucStream &CFile);
227int xaltds(XrdSysError *edest, XrdOucStream &CFile);
228int Fsysadd(XrdSysError *edest, int chk, char *fn);
229int xblk(XrdSysError *edest, XrdOucStream &CFile, bool iswl=false);
230int xcid(XrdSysError *edest, XrdOucStream &CFile);
231int xdelay(XrdSysError *edest, XrdOucStream &CFile);
232int xdefs(XrdSysError *edest, XrdOucStream &CFile);
233int xdfs(XrdSysError *edest, XrdOucStream &CFile);
234int xexpo(XrdSysError *edest, XrdOucStream &CFile);
235int xfsxq(XrdSysError *edest, XrdOucStream &CFile);
236int xfxhld(XrdSysError *edest, XrdOucStream &CFile);
237int xlclrt(XrdSysError *edest, XrdOucStream &CFile);
238int xmang(XrdSysError *edest, XrdOucStream &CFile);
239int xmode(XrdSysError *edest, XrdOucStream &CFile);
240int xnbsq(XrdSysError *edest, XrdOucStream &CFile);
241int xperf(XrdSysError *edest, XrdOucStream &CFile);
242int xping(XrdSysError *edest, XrdOucStream &CFile);
243int xprep(XrdSysError *edest, XrdOucStream &CFile);
244int xprepm(XrdSysError *edest, XrdOucStream &CFile);
245int xreps(XrdSysError *edest, XrdOucStream &CFile);
246int xrmtrt(XrdSysError *edest, XrdOucStream &CFile);
247int xrole(XrdSysError *edest, XrdOucStream &CFile);
248int xsched(XrdSysError *edest, XrdOucStream &CFile);
249int xschedm(char *val, XrdSysError *eDest, XrdOucStream &CFile);
250int xschedp(char *val, XrdSysError *eDest, XrdOucStream &CFile);
251int xschedx(char *val, XrdSysError *eDest, XrdOucStream &CFile);
252bool xschedy(char *val, XrdSysError *eDest, char *&host, int &hlen, int &port);
253int xsecl(XrdSysError *edest, XrdOucStream &CFile);
254int xspace(XrdSysError *edest, XrdOucStream &CFile);
255int xsubc(XrdSysError *edest, XrdOucStream &CFile);
256int xsupp(XrdSysError *edest, XrdOucStream &CFile);
257int xtrace(XrdSysError *edest, XrdOucStream &CFile);
258int xvnid(XrdSysError *edest, XrdOucStream &CFile);
259
260XrdInet *NetTCPr; // Network for supervisors
261XrdOucEnv *xrdEnv;
262char *AdminPath;
263int AdminMode;
264char **inArgv;
265int inArgc;
266char *SecLib;
267char *blkList;
268int blkChk;
269int isManager;
270int isMeta;
271int isPeer;
272int isProxy;
273int isServer;
274int isSolo;
275char *perfpgm;
276int perfint;
277int cachelife;
278int emptylife;
279int pendplife;
280int FSlim;
281};
282namespace XrdCms
283{
284extern XrdCmsAdmin Admin;
285extern XrdCmsConfig Config;
286extern XrdScheduler *Sched;
287}
288#endif
static XrdSysError eDest(0,"crypto_")
static const int RepStat_shr
static const int RepStat_frq
XrdOucProg * ProgMP
int GenLocalPath(const char *oldp, char *newp)
const char * myDomain
XrdNetSocket * RedirSock
XrdNetSocket * AdminSock
XrdOucProg * ProgRM
XrdCmsPList_Anchor PathList
const char * myInsName
XrdInet * NetTCP
XrdOucTList * SanList
const char * mySite
static const int RepStat_All
unsigned long long DirFlags
const char * myName
XrdOucTList * NanList
XrdNetSecurity * Police
XrdOucPListAnchor PexpList
XrdNetSocket * AnoteSock
XrdVersionInfo * myVInfo
XrdOucProg * ProgRD
XrdOucProg * ProgCH
const char * ifList
const char * myInstance
XrdOucProg * ProgMV
XrdOucProg * ProgMD
int Configure1(int argc, char **argv, char *cfn)
int ConfigXeq(char *var, XrdOucStream &CFile, XrdSysError *eDest)
XrdOucTList * ManList
const char * mySID
XrdOucName2Name * xeq_N2N
const char * myProg
XrdOucName2Name * lcl_N2N
int Configure0(XrdProtocol_Config *pi)
XrdOucProg * ProgTR
const char * myVNID
XrdCmsAdmin Admin
XrdScheduler * Sched
XrdCmsConfig Config