I have a specific question :
Can someone explain me what is the option 'o' (usually used with 'bind' value) in driver_opts section of a volume in a docker-compose file ?
I searched on the Internet but I found no answer.
Related
I've placed a docker compose file project.yaml at the location /etc/project/project.yaml
the file and well as the project directory have the same file permission, i.e. -rxwrxxrwx
but when I run docker-compose
sudo docker-compose -f ./project.yaml up -d
if errors out with the following
Cannot find the file ./project.yaml
I have checked various times and it seems there is no permission issue. Can anyone tell why we have this problem and what would be the solution
Beside using the full path, as commented by quoc9x, double-check your current working directory when you call a command with a relative path ./project.yaml
If you are not in the right folder, that would explain the error message.
I try to use the original riak-kv image in docker-compose and I want on init add one bucket but docker-compose up won't start. How I can edit volumes.schemas to add bucket on init?
Original image allows to add riak.conf file in docker-compose ? If yes, then how can I do that?
Creating a bucket type with a custom datatype
I assume you want to create a bucket type when starting your container. You have to create a file in the /etc/riak/schemas directory with the bucket's name, like bucket_name.dt. The file should contain a single line with the type you would like to create (e.g. counter, set, map, hll).
You can also use the following command to create the file:
echo "counter" > schemas/bucket_name.dt
After that you have to just mount the schemas folder with the file to the /etc/riak/schemas directory in the container:
docker run -d -P -v $(pwd)/schemas:/etc/riak/schemas basho/riak-ts
Creating a bucket type with default datatype
Currently creating a bucket type with default datatype is only available if you add a custom post-start script under the /etc/riak/poststart.d directory.
Create a shell script with the command you would like to run. An example can be found here.
You have to mount it as a read-only file into the /etc/riak/poststart.d folder:
docker run -d -P -v $(pwd)/poststart.d/03-bootstrap-my-datatype.sh:/etc/riak/poststart.d/03-bootstrap-my-datatype.sh:ro basho/riak-ts
References
See the whole documentation for the docker images here. The rest can be found in GitHub.
Also, the available datatypes can be found here.
My problem was originally that I am unable to use PostgreSQL because I do not know the password - nor have I ever made one. I was trying to reset or recover the password and followed various advice in trying to do this.
At first I tried to edit the pg_hba.conf file, which I located by using the following command:
sudo vim /etc/postgresql/9.3/main/pg_hba.conf
But this just took me to a blank screen that I could do nothing with except close the window.
I was told to try:
sudo nano /etc/postgresql/9.3/main/pg_hba.conf
...which was better because this included key commands at the bottom of the page, but the file was blank, and so couldn't be edited.
After going back into this, and I suppose causing some error, if I go back into it now, I get this:
E325: ATTENTION
Found a swap file by the name "/var/tmp/pg_hba.conf.swp"
owned by: root dated: Tue Oct 17 15:57:30 2017
file name: /etc/postgresql/9.3/main/pg_hba.conf
modified: YES
user name: root host name: Roberts-MacBook-Pro.local
process ID: 2668
While opening file "/etc/postgresql/9.3/main/pg_hba.conf"
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r
/etc/postgresql/9.3/main/pg_hba.conf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file
"/var/tmp/pg_hba.conf.swp"
to avoid this message.
Swap file "/var/tmp/pg_hba.conf.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit,
(A)bort:
I tried deleting the .swp file by typing D, but this didn't seem to do anything.
I'm really confused about all of this and I don't really know how I can learn more to understand what I'm doing. When I go to the PostgreSQL website I read what the pp_hba.conf file should look like, but the only way I can access this file, it has been completely empty.
I don't know where to go from here so I would really appreciate advice from anyone who can point me in the right direction, thanks.
As long as PostgreSQL has been started, you can find out which pg_hba.conf you should be editing by running:
ps -ef | grep 'postgres -D'
In my bizarre setup, this returns:
/opt/boxen/homebrew/opt/postgresql/bin/postgres -D /opt/boxen/homebrew/var/postgres
so I know to edit the file:
/opt/boxen/homebrew/var/postgres/pg_hba.conf
to change which connections are allowed to which databases, etc. See also the pg_hba.conf docs for more info.
I am just very new to PostgresSQL.I would like to restore backup database by type the following command psql -d library < joins.sql,but the return result will always bezsh: no such file or directory: joins.sql.I have searched for google and stackoverflow,but it seems there is no similar situation as what I had,which make me very confused.
I am wondering maybe is the path of the file and and the postgres are not the same.I also tried to check the path,but didn't get some idea.Does anyone have met this issue,and know what is the reason and how to solve it?
Does anybody know syntax for wget command in windows. I tried its basic syntax but the problem is file gets downloaded in the directory on which I have opened command prompt. I want to know whether we can explicitly specify destination in its command. If possible then let me know that would be much helpful for me.
If anyone reading this wants to save files downloaded to a directory, use "-P".
Example:
wget LINKHERE -P %USERPROFILE%/Downloads
This saves whatever is served by your link to C:\Users\username\Downloads.
According to the manual -O, --output-document=FILE write documents to FILE.
So you must give a file name after a valid directory as such:
C:\cronjobs>wget -q -O C:\Users\Public\Documents\tmp1.txt "http://google.com/"
note: -q option is to say quiet but -O is to say save file to a given file name and it will work!
Sure you can.
Use the -O syntax, and the path to use.
I've just tested this with:
C:\users\julien>wget google.com -O "C:\here.html"
And "here.html" was google's index page on the root of my "C:" drive