Обсуждение: pgadmin not processing scheduled jobs

Поиск
Список
Период
Сортировка

pgadmin not processing scheduled jobs

От
"Robert Young"
Дата:
I've ran the pgagent.sql script against my database.  I've started the pgagent as you can see...

  501  3107  1219   0   0:00.06 ttys000    0:00.12 pgagent -f -l 2 host=localhost dbname=mydb user=myuser

pgagent output shows...

laptop:~ ryoung$ pgagent -f -l 2 host=localhost dbname=mydb user=myuser
DEBUG: Creating primary connection
DEBUG: Creating DB connection: host=localhost dbname=mydb user=myuser
DEBUG: Database sanity check
DEBUG: Clearing zombies
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 1, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
DEBUG: Connection stats: total - 1, free - 0, deleted - 0
DEBUG: Checking for jobs to run
DEBUG: Sleeping...
DEBUG: Clearing inactive connections
........

as you can see, no jobs to run are found.

here is the pgagent.pga_job table.  Notice that the jobagentid is null as well as the joblastrun field.

mydb=# select * from pgagent.pga_job;
 jobid | jobjclid | jobname | jobdesc | jobhostagent | jobenabled |          jobcreated          |          jobchanged          | jobagentid |          jobnextrun           | joblastrun
-------+----------+---------+---------+--------------+------------+------------------------------+------------------------------+------------+-------------------------------+------------
     1 |        1 | test    |         | 127.0.0.1    | t          | 2008-10-24 11:04:40.86785-06 | 2008-10-24 11:04:40.86785-06 |            | 2008-10-24 12:56:49.378361-06 |


here is the output from the pgagent.pga_jobagent table.  As you can see, the agent is set in this table.

mydb=# select * from pgagent.pga_jobagent;
 jagpid |         jaglogintime          |       jagstation       
--------+-------------------------------+-------------------------
   3108 | 2008-10-24 12:55:26.271553-06 | laptop.movenetworks.com

pgagent.pga_schedule table output.

mydb=# select * from pgagent.pga_schedule;
 jscid | jscjobid | jscname | jscdesc | jscenabled |        jscstart        | jscend |                                                        jscminutes                                                         |                     jschours                      |   jscweekdays   |                           jscmonthdays                            |         jscmonths        
-------+----------+---------+---------+------------+------------------------+--------+---------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+-----------------+-------------------------------------------------------------------+---------------------------
     1 |        1 | 1       |         | t          | 2008-10-24 11:05:00-06 |        | {f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f} | {f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f} | {f,f,f,f,f,f,f} | {f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f,f} | {f,f,f,f,f,f,f,f,f,f,f,f}
(1 row)


pgagent.pga_step table output.

mydb=# select * from pgagent.pga_jobstep;
 jstid | jstjobid | jstname |       jstdesc       | jstenabled | jstkind |                jstcode                 | jstdbname | jstonerror | jscnextrun
-------+----------+---------+---------------------+------------+---------+----------------------------------------+-----------+------------+------------
     1 |        1 | 1       | 2008-10-15 00:00:00 | t          | s       | update db_version set push_dt = now(); | mydb    | f          |

Everything looks accurate to me.  If I click on the 'run now' link in pgadmin3 it updates the date on the job table, but it still finds no jobs to run.

Any help would be appreciated.

Thanks




Re: pgadmin not processing scheduled jobs

От
"Robert Young"
Дата:
I've solved the issue.  pgagent.pga_job.jobhostagent must be blank.  Thanks to this link http://forums.enterprisedb.com/posts/list/1419.page

Anyway, the docs say ... "optionally the hostname of a specific machine running pgAgent, if this job should only run on that specific server. If left empty, any server may run the job. This is not normally an issue for SQL-only jobs, however any jobs with batch/shell steps may need to be targetted to a specific server." ..., so why didn't it work when I specified the host of 127.0.0.1 or localhost?

Thanks

Re: pgadmin not processing scheduled jobs

От
"Scott Marlowe"
Дата:
On Fri, Oct 24, 2008 at 3:00 PM, Robert Young <robbyoung21@gmail.com> wrote:
> I've solved the issue.  pgagent.pga_job.jobhostagent must be blank.  Thanks
> to this link http://forums.enterprisedb.com/posts/list/1419.page
>
> Anyway, the docs say ... "optionally the hostname of a specific machine
> running pgAgent, if this job should only run on that specific server. If
> left empty, any server may run the job. This is not normally an issue for
> SQL-only jobs, however any jobs with batch/shell steps may need to be
> targetted to a specific server." ..., so why didn't it work when I specified
> the host of 127.0.0.1 or localhost?

I'm just guessing, but it could be that your machine is setup to use
local unix sockets and not allow tcp/ip connections.