Had to terminate a process run by pg_cron. However, after doing that pg_cron extension stopped. Below is the log from the server:
2021-04-29 12:55:40.712 UTC [535529] LOG: pg_cron scheduler shutting down
Now, no jobs are running. How to restart the extension without restarting the PostgreSQL server.
Related
W NETWORK [thread1] Failed to connect to 127.0.0.1:27017 after 5000ms milliseconds, giving up.
E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed
I expect to work this mongodb
Windows environment:
If you are using on localhost then start the mongod process, from the bin location(the location where you installed mongodb)
"C:\Program Files\MongoDB\Server\6.0\bin\mongod.exe" default path location
keep this terminal running, do not close it
After that open the mongo shell, download from offical mongodb website install it, and connect your localhost
in Linux environment :
Maybe your server might not be working, restart the service.
As you are not able to log in to the system so kill the process.
in linux terminal:
ps -ef | grep mongo
get the process id number, then kill the process
kill pid_number
After that start it from its config file
in terminal pass this command, and change the path of mongod.conf file if it is not installed on default location.
mongod --config=/etc/mongod.conf
(this one is default path)
Hope this will work.
I am trying to create a scheduled SQL Agent Job that executes a .bat file with a gsutil rsync command to synchronize a local folder with a Google Cloud Bucket. The task runs without an error, but does not finish or actually perform the rsync command.
I can however manually run the .bat file with success as the root user, as I have a key handshake with the GCP service account. I can also successfully execute other non-gsutil .bat files from the SQL Agent Job, as I have created credentials and proxy to run as the root user
The .bat file looks like this :
gsutil rsync -r G:\MyBackupFolder gs://my-coldline-storage-bucket
and I am running the SQL Agent step as type Operating system (CmdExec)
I am trying to start Tomcat in my Jenkins job on a slave machine.
I start Jenkins slave manually by opening slave-agent.jnlp
This is what I tried in Execute Windows Batch Command:
call C:\tomcat\bin\startup.bat
Tomcat starts on running the build and the build is marked successful but then Tomcat auto closes after few seconds.
This is Jenkins Process Tree Killer in action. This is by design. You can either disable it globally for the whole Jenkins (not recommended) by starting Jenkins with extra parameter
-Dhudson.util.ProcessTree.disable=true.
For Windows environment, you can use the at command to schedule start of Tomcat (with 1 sec delay).
Here is what I get when I try to access psql from console. I am using homebrew to run postgres.
atul-new-mac:sites user$ psql
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
I checked the version by this:
atul-new-mac:sites user$ which psql
/usr/local/bin/psql
Here is the detail from the log file:
atul-new-mac:sites user$ tail -f /usr/local/var/postgres/server.log
ERROR: could not access status of transaction 0
DETAIL: Could not open file "pg_clog/0000": Permission denied.
LOG: received smart shutdown request
LOG: autovacuum launcher shutting down
LOG: shutting down
PANIC: could not open control file "global/pg_control": Permission denied
LOG: checkpointer process (PID 381) was terminated by signal 6: Abort trap
LOG: terminating any other active server processes
LOG: could not open temporary statistics file "pg_stat/global.tmp": Permission denied
LOG: abnormal database system shutdown
This is what I get when I try to start it manually:
atul-new-mac:postgres user$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
pg_ctl: another server might be running; trying to start server anyway
server starting
sh: /usr/local/var/postgres/server.log: Permission denied
Your log tells that your postgresql instance is having trouble with permissions (lines ERROR and PANIC) and reading other extracts you give, you may already have a postgresql instance running.
To check it, just do this command:
ps aux | grep -i "*postgres*"
You should see all postgresql processes running.
Try to stop all thoses processes either by using pg_ctl stop or if nothing happens and the processes are still there, then try to kill them (I presume you're on a development platform, so that should not cause a problem for others)
kill -9 <postgresID>
Then when all the postgresql processes have disappeared, then try to start postgresql. If you're still having a permission problem, use lsof tool to see which process is locking your files.
I'm trying to test a small PostgreSQL setup, so I cobbled together a quick local install. However, when I'm trying to create my personal db with createdb, it chokes on errors like this (notably, it starts with base/16384 the first time, and increments each time I run it). Anyone know what's going on here, or if there's some trivial config I missed that would cause this? Thanks, and this is somewhat time-critical, so please respond if you do know anything. Thanks!
UPDATES:
I'm running this on a CentOS 5 server, apologies that I don't have too many further details (it's a shared account on that server). uname -a has the following output:
Linux {OMITTED} 2.6.18-194.11.4.el5 #1 SMP Tue Sep 21 05:04:09 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
I installed PostgreSQL from source from:
http://wwwmaster.postgresql.org/download/mirrors-ftp/source/v9.0.1/postgresql-9.0.1.tar.bz2
built in my home directory and installed to prefix=$HOME/local/pgsql.
Here's a terminal readout for me attempting to create my user's db on a fresh data setup:
[htung#{OMITTED}:~]$ killall postgres
LOG: autovacuum launcher shutting down
LOG: received smart shutdown request
LOG: shutting down
LOG: database system is shut down
[htung#{OMITTED}:~]$ rm -r tmp
mk[1]+ Done ../local/pgsql/bin/postgres -D $HOME/tmp (wd: ~/tmp)
(wd now: ~)
[htung#{OMITTED}:~]$ mkdir tmp
[htung#{OMITTED}:~]$ local/pgsql/bin/initdb -D $HOME/tmp
The files belonging to this database system will be owned by user "htung".
This user must also own the server process.
The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".
fixing permissions on existing directory /afs/{OMITTED}/htung/tmp ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /afs/{OMITTED}/htung/tmp/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
Success. You can now start the database server using:
local/pgsql/bin/postgres -D /afs/{OMITTED}/htung/tmp
or
local/pgsql/bin/pg_ctl -D /afs/{OMITTED}/htung/tmp -l logfile start
[htung#{OMITTED}:~]$ local/pgsql/bin/postgres -D $HOME/tmp
LOG: database system was shut down at 2010-11-15 13:47:25 PST
LOG: autovacuum launcher started
LOG: database system is ready to accept connections
[1]+ Stopped local/pgsql/bin/postgres -D $HOME/tmp
[htung#{OMITTED}:~]$ bg
[1]+ local/pgsql/bin/postgres -D $HOME/tmp &
[htung#{OMITTED}:~]$ local/pgsql/bin/createdb
ERROR: could not fsync file "base/16384": Invalid argument
STATEMENT: CREATE DATABASE htung;
createdb: database creation failed: ERROR: could not fsync file "base/16384": Invalid argument
[htung#{OMITTED}:~]$
I would guess that you're possibly running into the SE linux system here. I'd recommend to either turn off SELinux and see if that works, or to install from RPMs available from the postgresql website.