In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains the "CDSW database login error psql: FATAL: role" postgres "how to solve", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in-depth, together to study and learn "CDSW database login error psql: FATAL: role" postgres "does not exist how to solve" it!
Problem phenomenon
Test environment
1.Redhat7.4
2.CDH6.2.0
3.CDSW1.5.0
Error message "psql: FATAL: role" postgres "does not exist"
Abnormal analysis
Through the above exception analysis, Fayson guesses that the role of postgres users may be deleted because the security of the PG database is considered after the CDSW upgrade. It is illegal to view the CDSW user audit log by accessing the background database, probably to prevent the unusual operation of Fayson.
Since it is not possible to log in to the PG database directly by switching to the postgres user, Fayson accesses the CDSW database through the account password. Through the analysis, it is found that the service of CDSW is composed of services provided by multiple docker containers (the expression here may not be professional enough). Fayson finds the docker container that provides Web access interface, and most of the information displayed in the Web interface is stored in the data. You can also find a way to access the CDSW database (account number, password and other information) in the Web service.
Problem solving
1. Find the running Web container with the following docker command
[root@cdsw postgres-data] # docker ps | grep web
As shown in the screenshot above, there are three Web containers running, mainly in highly available mode, so we will see three Docker containers running.
two。 Enter the Web container using the following command
[root@cdsw postgres-data] # docker exec-I-t c972bbc1b3bc / bin/bash
3. Information such as the account password for accessing the CDSW database was found in the environment variables in the Web container.
Cdsw@web-bd545c85b-n4488:/app/web$ echo $POSTGRESQL_USER
Cdsw@web-bd545c85b-n4488:/app/web$ echo $POSTGRESQL_PASS
Cdsw@web-bd545c85b-n4488:/app/web$ echo $POSTGRESQL_DB
Cdsw@web-bd545c85b-n4488:/app/web$ echo $DB_IP
4. Use the psql client to remotely access CDSW data in the current container
Cdsw@web-bd545c85b-n4488:/app/web$ / usr/lib/postgresql/9.4/bin/psql-U sense-W-h 100.77.0.128
As the figure above shows, we have successfully accessed the CDSW database again.
Thank you for your reading, the above is the content of "CDSW database login error psql: FATAL: role" postgres "does not exist how to solve". After the study of this article, I believe you have a deeper understanding of how to solve the problem of CDSW database login error psql: FATAL: role "postgres" does not exist, and the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.