Storing Postgres data on a separate AWS EBS volume. [closed] - postgresql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have an Amazon EC2 instance running postgres. I would like to connect another EBS volume to this that is used ONLY for postgres data. I can add the volume, but how do configure postgres so it uses the mounted ebs drive for it's data storage?

Create a file system on the EBS and then mount it. See
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html
Set ownership of your filesystem to postgres.
Use the initdb command to initialize your new space.
Tell postgres to use your new file system, by using the -D option to
the postgres binary, setting the PGDATA environment variable, or by
setting the value of data_directory in postgresql.conf

You would edit the postgres pgdata and point it to the directory mapped to your EBS volume, as described in the thread here -
http://www.linuxquestions.org/questions/linux-server-73/change-postgresql-data-directory-649911/

Related

Where does mongodump saves data by default? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm trying to backup a database which uses mongodb (Ubuntu LTS 18.04)
So I managed to run mongodump command without any errors but still I can't find the location of the backup database. I only used the mongodump command so it must save it in the default location. Can someone help me?
Thanks
By default it will save your dumped data into directory dump which will be created in the same directory you run the mongodump command.
You can also specify the out folder for the dump like so:
mongodump -u"username" -p"xxxxxx" --db=dbname --out=mongodata/

Good strategy for using docker with mongo and data [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I already have a mongo running on my computer. I would like to move this to a docker container.
Now, I understand that a container should be immutable,and I agree.
In this case, how should I actually use my local data or import it to the mongo container?
You don't have to import it, you can mount your host mongodb "data" directory to your container's /data directory where your mongodb is running within. Then your mongodb running inside a container will share the same data as you are currently using with your mongo running on your host.
This link will help: https://docs.docker.com/engine/userguide/containers/dockervolumes/
If you run mongo in a container and don't mount the data volumes out of the container then when that container stops running the data is gone with it.

Create a Database on DB2 on Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I have just instally successfully db2 on my linux machine, but I am not able to create a database.
When I make CREATE DATABASE ABC; I get the error that I haven't the authorization to create it...how can I get this authorization?
When you install DB2, you most probably use the root user of the Linux server.
Then in installing phase, you provide a user which will have the SYSADM and DBADM rights. That means DB2 creates a user which has all rights on the database(database admin).
So, after installation, you have to switch to that user to have rights to create a new database.
Depending on the version you installed, that username might be changed. But DB2 uses db2inst1 by default as administrator user.
Check your /home directory. You will see a new user(most probably db2inst1). Then switch to that user with:
su - db2inst1
then issue:
db2 CREATE DATABASE ABC
Let me know if you have a problem, also please provide your /home directory and the error message you get.
You can check details of create db command and related authorization required here on DB2 Info Center:
http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0001941.html?cp=SSEPGG_10.5.0%2F3-5-2-4-21&lang=en
As said above, this should work if you login as instance user. Most of times you do not need root access with DB2.

OSX: How to change user password when account was created without one? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
When I installed the PostgreSQL database server on my Mac, I created the "postgres" account so that it wouldn't have a password:
sudo dscl . -create /Users/postgres Password \*
I thought this would be a good security precaution to take. However, it also prevents me from logging in via the su command so that I can use psql to administer the database:
su - postgres # <- prompts me for password
I've tried to change the postgres password using the "passwd" and "dscl . -passwd /Users/postgres" commands but they always prompt me for the old password. How do I set the password in this situation?
Thanks.
Use sudo su - postgres instead. Enter the sudo password, and you'll be postgres.

back up a postgres db and restore on another computer [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I've just purchased a new computer (mac OSX) and I want to continue developing using the same database I had on the old computer. I don't want it remotely done cause I dont want to keep the other computer on. I just want to copy the db and put it on this computer for development. I have a USB stick I can use but I'm not sure how to proceed. brew, rails, ruby, rvm, pg are all installed and configured.
pg_dumpall ?
To dump all databases:
$ pg_dumpall > db.out
To reload this database use, for example:
$ psql -f db.out postgres
I had to do it with -o option for the oids