Can not start cloudera-scm-server-db because of "The CM is using external DB" - postgresql

I've updated jdk from 1.8_131 to 1.8_151 for CDH5. So i need to restart the cluster to make it take affect. In the begining i use cloudrea manager web page to restart, but it failed when zookeeper started which is the first step. Then I made a bad choice which is close cloudrea manager in terminal including kill -9 postgresql process. After that, i could't open the cloudrea manager web page.
I use following instructions to start the cluster.
service cloudera-scm-server-db start
service cloudera-scm-server start
service cloudera-scm-agent start
All of them are failed, because /var/log/cloudera-scm-server and /var/log/cloudera-scm-agent disappear.
So I creat these two files manually also include dg.log and cloudera-scm-agent.log
At this time, the server and agent could start. But server-db still can not. The next is some details.
Starting cloudera-scm-server-db (via systemctl): Job for
cloudera-scm-server-db.service failed because the control process
exited with error code. See "systemctl status
cloudera-scm-server-db.service" and "journalctl -xe" for details
journalctl -xe
The CM is using external DB. Failed to start embedded DB service, giving up
service --status-all
What i've done:
So, what should i do now? thank you thank you very much!!!

The above problem had been sovled.
If you open this /etc/cloudera-scm-server/db.properties file, which shown as below.
# cat /etc/cloudera-scm-server/db.properties
Auto-generated by scm_prepare_database.sh
#
Sat Oct 1 12:19:15 PDT 201
#
com.cloudera.cmf.db.type=postgresql
com.cloudera.cmf.db.host=localhost
com.cloudera.cmf.db.name=scm
com.cloudera.cmf.db.user=scm
com.cloudera.cmf.db.password=TXqEESuhj5
com.cloudera.cmf.db.setupType=EXTERNAL
EXTERNAL is the crux.
In my CDH service, I use embedded postgresql as my server database. But it's not recommended to use by cloudera offical. I'm a new man on Cloudera, so I made a mistake.
I wrongly use a command which only prepared for Cloudera Manager Server external database.
/usr/share/cmf/schema/scm_prepare_database.sh postgresql scm scm scm_password
The above command can config db.properties
As long as you run above command, com.cloudera.cmf.db.setupType will be set to EXTERNAL(For more details about this, you can find in Cloudera docs)
The most direct and effective way is to reset password of scm.
Then
update the password
set Type as EMBEDDED
make port 7432 listening(you can use netstat -nltp to check)
in db.properties.
#vim cat /etc/cloudera-scm-server/db.properties
Auto-generated by scm_prepare_database.sh
Sat Oct 1 12:19:15 PDT 201
com.cloudera.cmf.db.type=postgresql
com.cloudera.cmf.db.host=localhost:7432
com.cloudera.cmf.db.name=scm
com.cloudera.cmf.db.user=scm
com.cloudera.cmf.db.password=new_password
com.cloudera.cmf.db.setupType=EMBEDDED
Now close all cloudera-scm service and restart in order server-db,server,agent.
If /var/log was cleared wrongly.
You can creat these files such as /var/log/cloudera-scm-server and /var/log/cloudera-scm-agent manually.
It is noteworthy that you should creat these file by user cloudera-scm, otherwise the log can not be written, and you won't find what error happened from log file.

Related

How to configure telnet service for yocto image

telnet is necessary in order to maintain compatibility with older software in this case. I'm working with the Yocto Rocko 2.4.2 distribution. when I try to telnet to the board I'm getting the oh so detailed message "connection refused".
Using the method here and the options here I modified the busybox configuration per suggestion. When the board is booted up and logged in, if you execute: telnet, it spits out usage info and a quick directory check shows that telnet is installed to /usr/bin/telnet. My guess is that the telnet client is installed but the telnet server is not running?
I need to get telnetd to start manually at least so I know it will work with an init script in place. The second reference link there suggests that 'telnetd will not be started automatically though...' and that there will need to be an init script. How can I start telnetd manually for testing?
systemctl enable telnetd
returns: Unit telnetd.service could not be found
UPDATE
telnetd in located in /usr/sbin/telnetd. I was able to manually start the telnetd service for testing from there. After manually starting the service telnet login now works. looking into writing a systemd init script to auto start the telnetd service, so I suppose this issue is closed. unless anyone would like to offer up detailed telnet busybox configuration and setup steps as an answer to 'How to configure telnet service for yocto image'
update
Perhaps there is something more? I created a unit file that looks like this:
[Unit]
Description=auto start telnetd
[Service]
ExecStart=/usr/sbin/telnetd
[Install]
WantedBy=multi-user.target
on reboot, systemd indicates the process executed and succeeded:
systemctl status telnetd
.
.
.
Process: 466 ExecStart=/usr/sbin/telnetd (code=exited, status=0/SUCCESS)
.
.
.
The service is not running however. netstat -l does not list it and telnet login fails. Something I'm missing?
last update...i think
so following this post, I managed to get telnet.socket service to startup on reboot.
systemctl status telnet.socket
shows that it is running and listening on 23. Now however, when I try to remote in with telnet I'm getting
Connection closed by foreign host
Everything I've read so far has been talking about xinetd service (which I do not have...). What is confusing is that, if I just navigate to /usr/sbin/ and execute telnetd, the server is up and running and I can telnet into the board, so I do not believe I'm missing any utilities or services (like the above mentioned xinetd), but something is still not being configured correctly. any ideas?

Postgres service failing on Win10, manual startup works

As of today, suddenly, my Postgres 9.6 Windows 10 service fails to start up the server. Here is what I used to register the service:
pg_ctl register -N PostgreSQL-9.6.10 --pgdata=%DATA_HOME%\Postgres ^
--log=%DATA_HOME%\Postgres\server.log
When I go to my Windows service control panel, when I hit start for this new service, which is registered okay, it reports that the service is started for a brief moment and then it switches the status to stopped. I am unable to find any logging of the service itself, to get a trace of why this might be happening.
The service does start fine when I do it manually:
pg_ctl -D %DATA_HOME%\Postgres -l %DATA_HOME%\Postgres\postgres.log start
Any idea what the problem might be and how to recover my service?

How to redirect script output to the stdout of systemd?

Currently, I am doing some services migration from RedHat 6 to 7. In specific, from SysV to systemd. I meet problems of logs missing.
I have a service start script in RedHat 6, say scriptA. It will output some log info to console if I execute it to start a service.
Then with systemd, I use systemctl start to execute the scriptA, logs from scriptA can only be seen in journal.
How can I redirect scriptA's output to the stdout of command systemctl start .service?
Using StandardOutput= in unit file setting might be a valid solution, but I failed after trying all valid values.

sphinx on centos 7 cant started because of searchd.pid absent

I installed sphinx-2.2.11 on my CentOS 7
yum install -y postgresql-libs unixODBC wget
http://sphinxsearch.com/files/sphinx-2.2.11-1.rhel7.x86_64.rpm yum
install sphinx-2.2.11-1.rhel7.x86_64.rpm
Installation went without any errors and then I created sphinx config and installed php extension (also all without error)
I restart apache (httpd) and
I tried to START sphinx service
systemctl start searchd
I got this message
Job for searchd.service failed because a configured resource limit was > exceeded. See "systemctl status searchd.service" and "journalctl -xe" for details.
after launch command - systemctl status searchd.service
May 02 20:28:57 kvmde43-10657.fornex.org systemd[1]: Failed to read
PID from file /var/run/sphinx/searchd.pid: Invalid argument May 02
20:28:57 kvmde43-10657.fornex.org systemd[1]: Failed to start
SphinxSearch Search Engine.
In fact I havn't "searchd.pid" anywhere at system though installation went good) How should I fix it ?
Thanks in advance
I have just resolved this issue.
I took a look at sphinx log /var/log/sphinx/searchd.log
and noted that some data files under folder /var/log/sphinx/data/ are Permission denied;
I set chown sphinx:sphinx on /var/log/sphinx/data/ folder and It started to work as charm )
Thanks
Same symptom with a slightly different cause...
/var/log/sphinx/searchd.log shows
FATAL: failed to open '/var/data/binlog.lock': 13 'Permission denied'
Fixed by adding binlog_path = to the searchd section of sphinx.conf. Empty path disables binary logging which by default tries to open files in /var/data owned by root. Alternatively, you can supply a valid path writeable by sphinx.
The Sphinx search index is a database distributed over several files in the /var/lib/sphinx/ folder. Those file names start with the doc prefix which is the index name as configured in /etc/sphinx/sphinx.conf.
The searchd service also stores the binlog files in that folder to be able to restore the Sphinx functionality in case of the system crash. If you cannot start the searchd service because it cannot create a binlog file, try to move or delete all binlog.* files from this folder and then start the service.

Getting Access to PID in install4j / Mirth Connect

I am using Mirth connect which uses install4j to launch the program.
I am using the mcservice program and would like to get the pid of the launched application so that I can monitor it. How do I do this? Right now the service only has the standard start, status, etc commands.
Back in 2011 there seemed to be some indication that pid monitoring would be coming soon: http://www.mirthcorp.com/community/forums/showthread.php?t=5509
If you need get the the number of the process pid, you can do it by the terminal command:
$ pgrep mcservice
Also, you can store the pid number into a file and run the next command:
$ kill -9 `cat /path/to/file.pid`
In this case, you choosing the best solution for your issue. If you need something more complex you can view this link: Simple Process Checker To Find Out If A Service Is Running or Not