Reset locale in script depending on netstat output.
primary key (jobid),
unique (dg_jobid),
index (userid)
-);
+) engine=innodb;
create table users (
userid char(32) binary not null,
primary key (userid),
unique (cert_subj)
-);
+) engine=innodb;
create table events (
jobid char(32) binary not null,
index (time_stamp),
index (host),
index (arrived)
-);
+) engine=innodb;
create table short_fields (
jobid char(32) binary not null,
value varchar(255) binary null,
primary key (jobid,event,name)
-);
+) engine=innodb;
create table long_fields (
jobid char(32) binary not null,
value mediumblob null,
primary key (jobid,event,name)
-);
+) engine=innodb;
create table states (
jobid char(32) binary not null,
primary key (jobid),
index (parent_job)
-);
+) engine=innodb;
create table status_tags (
jobid char(32) binary not null,
value varchar(255) binary null,
primary key (jobid,seq,name)
-);
+) engine=innodb;
create table server_state (
prefix varchar(100) not null,
value varchar(255) binary not null,
primary key (prefix,name)
-);
+) engine=innodb;
create table acls (
aclid char(32) binary not null,
refcnt int not null,
primary key (aclid)
-);
+) engine=innodb;
create table notif_registrations (
notifid char(32) binary not null,
conditions mediumblob not null,
primary key (notifid)
-);
+) engine=innodb;
create table notif_jobs (
notifid char(32) binary not null,
primary key (notifid,jobid),
index (jobid)
-);
+) engine=innodb;
Grant privileges to user: lbserver
Database has the same structure as bkserver has (you can use
sql script etc/glite-lb-dbsetup-proxy.sql to create propper tables).
+
+ For better performance it's recommended to use database backend with
+ transactions. It's set up by default, existing database can be migrated
+ with etc/glite-lb-dbsetup-migrate2transaction.sql (lb-server package).
2) Start servers with scripts from distribution
/opt/glite/etc/init.d/glite-lb-locallogger start
semset;
static char host[300];
static char * port;
+int transactions = -1;
static struct option opts[] = {
#ifdef LB_PERF
{"perf-sink", 1, NULL, 'K'},
#endif
+ {"transactions", 1, NULL, 'b'},
{NULL,0,NULL,0}
};
-static const char *get_opt_string = "p:c:dm:s:l:i:X:Y:z"
+static const char *get_opt_string = "p:c:dm:s:l:i:X:Y:zb:"
#ifdef LB_PERF
"K:"
#endif
#ifdef LB_PERF
"\t--perf-sink\t where to sink events\n"
#endif
+ "\t-b, --transactions\t transactions force switch\n"
,me);
}
while ((opt = getopt_long(argc, argv, get_opt_string, opts, NULL)) != EOF) switch (opt) {
case 'p': strcpy(socket_path_prefix, optarg); break;
+ case 'b': transactions = atoi(optarg); break;
case 'c': con_queue = atoi(optarg); break;
case 'd': debug = 1; break;
case 'z': silent = 1; break;
if ( fscanf(fpid,"%d",&opid) == 1 ) {
if ( !kill(opid,0) ) {
- fprintf(stderr,"%s: another instance running, pid = %d\n",argv[0],opid);
+ fprintf(stderr,"%s: another instance running, pid = %d\n",name,opid);
return 1;
}
else if (errno != ESRCH) { perror("kill()"); return 1; }
char *et,*ed;
edg_wll_Error(ctx,&et,&ed);
- fprintf(stderr,"%s: open database: %s (%s)\n",argv[0],et,ed);
+ fprintf(stderr,"%s: open database: %s (%s)\n",name,et,ed);
return 1;
}
+ if (!ctx->use_transactions && transactions != 0) {
+ fprintf(stderr, "%s: transactions aren't supported!\n", name);
+ }
+ if (transactions >= 0) {
+ fprintf(stderr, "%s: transactions forced from %d to %d\n", name, ctx->use_transactions, transactions);
+ }
edg_wll_Close(ctx);
edg_wll_FreeContext(ctx);
dprintf(("[%d]: DB connection established\n",getpid()));
if (!debug) syslog(LOG_INFO,"DB connection established\n");
}
+
+ if (transactions >= 0) ctx->use_transactions = transactions;
}
static int decrement_timeout(struct timeval *timeout, struct timeval before, struct timeval after)
${INSTALL} -m 755 "glite_lb_$$p" "${PREFIX}/bin/glite-lb-$$p"; \
done
- for f in dbsetup.sql index.conf.template; do \
+ for f in dbsetup.sql dbsetup-migrate2transactions.sql index.conf.template; do \
${INSTALL} -m 644 ${top_srcdir}/config/"glite-lb-$$f" ${PREFIX}/etc; \
done
--- /dev/null
+alter table jobs engine=innodb;
+alter table users engine=innodb;
+alter table events engine=innodb;
+alter table short_fields engine=innodb;
+alter table long_fields engine=innodb;
+alter table states engine=innodb;
+alter table status_tags engine=innodb;
+alter table server_state engine=innodb;
+alter table acls engine=innodb;
+alter table notif_registrations engine=innodb;
+alter table notif_jobs engine=innodb;
{
retval=0
+ LC_ALL=C
if netstat -an --unix | grep "^unix .* LISTEN.* ${GLITE_LB_NOTIF_SOCK}$" >/dev/null 2>&1 ;then
echo glite-lb-notif-interlogd running
else