Postgres (13.5) cannot start after restarting server (Debian 4.19.208-1)
UPDATE 1
I changed user permissions and now I have another error on starting postgres:
systemctl status postgresql
FATAL: lock file "postmaster.pid" already exists
But I checked pg clusters and there exists only one:
Also I deleted postmaster.pid and there is no file any more:
So I have no errors details but postrges is shutting down.
Any ideas?
==============================================================
I'm trying to start manually sudo service postgresql start but got error:
Job for postgresql.service failed because the control process exited with error code. See "systemctl status postgresql.service" and "journalctl -xe" for details.
So then I ran systemctl status postgresql
Results:
FATAL: data directory "/var/lib/postgresql/13/main" has invalid permissions
DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
I modified permissions:
chmod u=rwx /var/lib/postgresql/13/main
chmod g=rx /var/lib/postgresql/13/main
But I still see the same error about permissions.
You can see whole results on screenshot
Sorry, I'm not so familiar with Linux
I fixed this problem. I ran postgres not as a service but with logs:
postgresql -D /var/lib/postgresql/13/main
And I saw in the log that problem was with pg_hba.conf. I opened this file - it was empty!
So I restored pg_hba.conf from backup and started postgres as service
Related
I am using these steps to use apache pulsar on docker: https://github.com/streamnative/tgip/blob/master/episodes/001/demo.md
I was able to use these steps before to install and use pulsar but for some reason now when am creating a directory, it is going to write protected and pulsar zookeeper container is exiting with following logs as soon as it is created:
ERROR org.apache.zookeeper.server.ZooKeeperServerMain - Unable to access datadir, exiting abnormally
org.apache.zookeeper.server.persistence.FileTxnSnapLog$DatadirException: Unable to create data directory data/zookeeper/version-2
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.<init>(FileTxnSnapLog.java:136) ~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:137) ~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:112) ~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:67) [org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:140) [org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:90) [org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
Unable to access datadir, exiting abnormally
23:36:15.223 [main] INFO org.apache.zookeeper.audit.ZKAuditProvider - ZooKeeper audit is disabled.
23:36:15.226 [main] ERROR org.apache.zookeeper.util.ServiceUtils - Exiting JVM with code 3
23:36:15.196 [PurgeTask] ERROR org.apache.zookeeper.server.DatadirCleanupManager - Error occurred while purging.
org.apache.zookeeper.server.persistence.FileTxnSnapLog$DatadirException: Unable to create data directory data/zookeeper/version-2
at org.apache.zookeeper.server.persistence.FileTxnSnapLog.<init>(FileTxnSnapLog.java:136) ~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
at org.apache.zookeeper.server.PurgeTxnLog.purge(PurgeTxnLog.java:80) ~[org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
at org.apache.zookeeper.server.DatadirCleanupManager$PurgeTask.run(DatadirCleanupManager.java:141) [org.apache.zookeeper-zookeeper-3.6.3.jar:3.6.3]
at java.util.TimerThread.mainLoop(Timer.java:556) [?:?]
at java.util.TimerThread.run(Timer.java:506) [?:?]
23:36:15.229 [PurgeTask] INFO org.apache.zookeeper.server.DatadirCleanupManager - Purge task completed
I have made sure that SELinux is disabled and tried changing permission using chmod 777 data/ and every other step available to resolve this but still unable to find any. Please help me with the possible resolution.
Following, How to capture data change in yugabyte db?
to publish the change logs.
It works properly. But, yb-connector.jar is not resuming the publishing change data logs, after restarting yugabyte db.
Commands Executed:
wget -O yb-cdc-connector.jar https://github.com/yugabyte/yb-kafka-connector/blob/master/yb-cdc/yb-cdc-connector.jar?raw=true
terminal1:
###start yugabyte db
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" start
terminal2:
###start load generator
julia "/root/gen_users_yb.jl"
terminal3:
###publish change logs
java -jar ./yb-cdc-connector.jar --table_name yugastore.users --master_addrs 127.0.0.1:7100 --log_only
terminal1:
###stop yugabyte db
/opt/yugabyte/yugabyte-2.0.10.0/bin/yb-ctl --data_dir "/opt/yugabyte/data" stop
(Note: upon LibPQ Exception load generator exits and yb-connector waits)
terminal2:
###restarting load generator
julia "/root/gen_users_yb.jl"
Observation: No resumption in publishing logs on terminal 3
Please help me in configure yb-cdc-connector resume printing logs upon yb-ctl restart (stop and start).
This isn't yet supported. Can you create an issue on github https://github.com/yugabyte/yugabyte-db/issues ?
I'm trying to install SonarQube : i ve followed those steps :
Setting up SOnarQube Tuto : here
To summarize it :
Downloading Sonar and moving it to /opt/sonar
adding those coonfig steps to /opt/sonar/conf/sonar.properties :
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
and
sonar.web.host=127.0.0.1
sonar.web.context=/sonar
sonar.web.port=9000
implementing sonar as a service:
sudo cp /opt/sonar/bin/linux-x86-64/sonar.sh /etc/init.d/sonar
sudo gedit /etc/init.d/sonar
Insert two new lines:
SONAR_HOME=/opt/sonar
PLATFORM=linux-x86-64
Modify the following lines:
WRAPPER_CMD="${SONAR_HOME}/bin/${PLATFORM}/wrapper"
WRAPPER_CONF="${SONAR_HOME}/conf/wrapper.conf"
...
PIDDIR="/var/run"
Register as a Linux service:
sudo update-rc.d -f sonar remove
sudo chmod 755 /etc/init.d/sonar
sudo update-rc.d sonar defaults
After those steps : i ve tried to run Sonar from : localhost:9000/sonar and after executing : sudo /etc/init.d/sonar start
`
Strangely , it didsn't run .
SO when i run `sudo /etc/init.d/sonar status , i discover that it goes steps after few seconds , and it throws some error in it log file , like the following :
es.log:
2017.12.09 18:05:14 ERROR es[][o.e.b.Bootstrap] Exception
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) [elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) [elasticsearch-5.6.3.jar:5.6.3]
2017.12.09 18:05:14 WARN es[][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:123) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:70) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:84) ~[elasticsearch-5.6.3.jar:5.6.3]
Caused by: java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:342) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:132) ~[elasticsearch-5.6.3.jar:5.6.3]
... 6 more
Any suggestions ??
SonarSource has upgraded the Elasticsearch tool used as a part of the latest SonarQube LTS version. As a result SonarQube cannot be run as a root. See this blog and the SonarQube 6.6 upgrade notes and this SO question.
Change the root access to the sonar file. Try running in normal user access.
chown <another user>:<user group> sonar.sh
I was facing the same issue and spend good amount of time before getting the solution.
Error was same as
2017.12.09 18:05:14 ERROR es[][o.e.b.Bootstrap] Exception
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:106) ~[elasticsearch-5.6.3.jar:5.6.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:195) ~[elasticsearch-5.6.3.jar:5.6.3]
Solution
Create a ‘sonar’ user using adduser command //I was using linux system
chown -R sonar sonar-install-folder/
Edit the sonar.sh file sonar-install-folder/bin/linux-x86-6 in start script and change the #RUN_AS_USER to be RUN_AS_USER=sonar
And then use below commands
./sonar.sh stop
Gracefully stopping SonarQube...
SonarQube was not running.
./sonar.sh start
Starting SonarQube...
Started SonarQube.
./sonar.sh status
SonarQube is running (22100).
So, basically elastic search doesnt require to be run by root user. By default the RUN_AS_USER was commented in the startup script which was picking my current user which was root, and then some linux permission rules come into picture due to which elasticsearch process was not getting up and which was causing sonar process to go down as well.
It was evident from sonar.log
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
2020.05.08 06:36:36 WARN app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 78
2020.05.08 06:36:36 INFO app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.05.08 06:36:36 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
Create new user to run the sonarQube or access the SonarQube dashboard
for ubuntu flavour user creation.
#sudo adduser sonar.
after executing the above command it will ask for passwd
#adduser sonar sudo
#adduser sonar admin
#sudo su sonar
chown sonar:sonar sonar.sh
I am getting this error and sites are not opening now
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
I got this problem after doing this
yum remove php php-cli php-common php-gd php-ldap php-mysql php-odbc php-pdo php-pear php-pecl-apc php-pecl-memcache php-pgsql php-soap php-xml php-xmlrpc
Most probably there is a configuration file left for php in /etc/httpd/conf.d/ that is loaded by default by apache (having the .conf extension). Since you have removed php, php module can't be loaded and httpd throws that error being unable to start.
So go to /etc/httpd/conf.d, see what .conf files you have there and either remove the php.conf file or at least comment the php module in it so it won't be loaded when apache is restarted. Then try again to restart apache by issuing systemctl restart httpd
I am fairly new to Linux (and brand new to chef) and I have ran into an issue when setting up my chef server. I am trying to create an admin user with the command
sudo chef-server-ctl user-create admin Admin Ladmin admin#example.com
examplepass -f admin.pem
but after I keep getting this error:
ERROR: Connection refused connecting...
ERROR: Connection refused connecting to https://127.0.0.1/users/, retry 5/5
ERROR: Network Error: Connection refused - Connection refused
connecting to https://..., giving up
Check your knife configuration and network settings
I also noticed that when I ran chef-server-ctl I got this output:
[2016-12-21T13:24:59-05:00] ERROR: Running exception handlers Running
handlers complete
[2016-12-21T13:24:59-05:00] ERROR: Exception
handlers complete Chef Client failed. 0 resources updated in 01 seconds
[2016-12-21T13:24:59-05:00] FATAL: Stacktrace dumped to
/var/opt/opscode/local-mode-cache/chef-stacktrace.out
[2016-12-21T13:24:59-05:00] FATAL: Please provide the contents of the
stacktrace.out file if you file a bug report
[2016-12-21T13:24:59-05:00] FATAL:
Chef::Exceptions::CannotDetermineNodeName: Unable to determine node
name: configure node_name or configure the system's hostname and fqdn
I read that this error is due to a prerequisite mistake but I'm uncertain as to what it means or how to fix it. So any input would be greatly appreciated.
Your server does not have a valid FQDN (aka full host name). You'll have to fix this before installing Chef server.