Comments (6)
Yes, that container should be visible with docker ps
if everything ran correctly. You can use docker-compose logs pg_normalized_batch
to view the logs for that container to find our why it shut down.
from cmc-csci143.
That is good to know, thank you! These are the outputs when I run that command. Would it be safe for me to remove the /var/lib/postgresql/data
directory or is there a better approach to solve this?
lambda-server:~/twitter_postgres_indexes (master>) $ docker-compose logs pg_normalized_batch
/home/sfullerton24/.local/lib/python3.6/site-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography. The next release of cryptography will remove support for Python 3.6.
from cryptography.hazmat.backends import default_backend
Attaching to twitter_postgres_indexes_pg_normalized_batch_1
pg_normalized_batch_1 | The files belonging to this database system will be owned by user "postgres".
pg_normalized_batch_1 | This user must also own the server process.
pg_normalized_batch_1 |
pg_normalized_batch_1 | The database cluster will be initialized with locale "en_US.utf8".
pg_normalized_batch_1 | The default database encoding has accordingly been set to "UTF8".
pg_normalized_batch_1 | The default text search configuration will be set to "english".
pg_normalized_batch_1 |
pg_normalized_batch_1 | Data page checksums are disabled.
pg_normalized_batch_1 | initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
pg_normalized_batch_1 | initdb: hint: If you want to create a new database system, either remove or empty the directory "/var/lib/postgresql/data" or run initdb with an argument other than "/var/lib/postgresql/data".
pg_normalized_batch_1 |
from cmc-csci143.
Yes, it is safe to remove that directory, and that is what you should do if they database gets corrupted like this. The following command (from the part 0 instructions) should achieve that:
$ docker-compose exec pg_normalized_batch bash -c 'rm -rf $PGDATA'
from cmc-csci143.
Thank you for your help. I am sorry, I am confused what to do to fix this. Is there a step I have missed? These are the steps I took:
-
I brought down/stopped all the containers and pruned the volumes.
-
I then ran the following to make sure that the directory was removed:
lambda-server:~/twitter_postgres_indexes (master>) $ docker-compose exec pg_normalized_batch bash -c 'rm -rf $PGDATA'
lambda-server:~/twitter_postgres_indexes (master>) $ docker-compose exec pg_denormalized bash -c 'rm -rf $PGDATA'
lambda-server:~/twitter_postgres_indexes (master>) $ rm -rf /var/lib/postgresql/data
- I checked to see if the directory was removed:
lambda-server:~/twitter_postgres_indexes (master>) $ ls -l /var/lib/postgresql
total 16
drwxr-xr-x 3 postgres postgres 4096 Nov 22 2019 10
drwx------ 2 postgres postgres 4096 Jul 2 2020 pythainlp-data
drwxrwxr-x 10 postgres postgres 4096 Jul 2 2020 spacy
drwxrwxr-x 6 postgres postgres 4096 Jul 2 2020 venv
I do not see it here so I assume it was removed.
However, when I build and brought back up the containers, I am still getting the same error
pg_normalized_batch_1 | initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
pg_normalized_batch_1 | initdb: hint: If you want to create a new database system, either remove or empty the directory "/var/lib/postgresql/data" or run initdb with an argument other than "/var/lib/postgresql/data".
from cmc-csci143.
Whenever you run commands without docker-compose
, they are being run on the lambda server and not inside the container. In particular,
$ ls -l /var/lib/postgresql
is being run on the lambda server. So it can't tell you whether the data directories were successfully removed or not.
In any event, I have deleted these folders for you manually (as root on the lambda server) to get you unstuck on this step.
from cmc-csci143.
Thank you!!
from cmc-csci143.
Related Issues (20)
- How long should creating an index take? HOT 1
- Database not connecting HOT 1
- Final Project Late Policy HOT 3
- Updated late policy for indexes assignment
- trouble installing rum
- Question about creating indexes for denormalized queries for `twitter_postgres_indexes` HOT 6
- Final project: forward host lookup failed: Host name lookup failure : Resource temporarily unavailable HOT 1
- twitter clone
- schema is not being ran when running docker-compose HOT 1
- expectations for search function HOT 1
- "Non-sensitive" project files HOT 1
- What data are people using for the final project? HOT 2
- Final project clarifications? HOT 1
- tables from schema.sql not loading in
- github test actions expectations HOT 2
- Final Exam Clarification HOT 2
- Disk Quota, logging issues HOT 1
- Issue with persisting my data with volumes in prod HOT 5
- Postgres container immediately exits
- Computer Science Internship Opportunity
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmc-csci143.