I installed HiveMQ on my Ubuntu 16.04 server (dropped the zip file inside my server and unzip it) then I started it via terminal (with SSH connection) and I connected a client all was good.
Then I closed the terminal to see if I would able to connect again and I would, I could also connect after 2 hours but suddenly I couldn't.
Is there any command to use to keep it always on?
Thanks in advance
Check this list on the HiveMQ User Guide. Starting at point 10 describes, how to run HiveMQ from a run script.
Install the init script (optional)
For Debian-based linux like Debian, Ubuntu, Raspbian using init.d scripts
cp /opt/hivemq/bin/init-script/hivemq-debian /etc/init.d/hivemq
chmod +x /etc/init.d/hivemq
For Debian-based linux like Debian, Ubuntu, Raspbian using systemd
cp /opt/hivemq/bin/init-script/hivemq.service /etc/systemd/system/hivemq.service
Modify /etc/init.d/hivemq (optional)
Set the HIVEMQ_HOME and the HIVEMQ_USER variable to the correct values for your system.
By default this would be:
HIVEMQ_HOME=/opt/hivemq
HIVEMQ_USER=hivemq
If you installed HiveMQ to a different directory than /opt/hivemq please point the HIVEMQ_HOME in your init script to the correct directory. Otherwise the daemon will not start correctly.
Start HiveMQ on boot (optional)
For Debian-based linux like Debian, Ubuntu, Raspbian
update-rc.d hivemq defaults
For Debian-based linux like Debian, Ubuntu, Raspbian using systemd
systemctl enable hivemq
Related
I have to do PHP development, for this I was given an Windows 10 machine, this is something I cannot change. So I use the WSL2 feature to setup and development server using Ubuntu 20.04.
First attempt:
Used Windows with Docker Desktop. I configured the environment but was had issues. The mapping between of the project volume and Docker caused important processed like Composer, git etc to be very slow. So this is considered unworkable for me.
Second attempt:
Setup a development environment directly in the WSL2 instance. This works. I'm able to connect with the Xdebug debugger using PhpStorm. But again the rest of the operations are very slow and is considered unworkable for me.
Third attempt:
I was advised to do the following: Create WSL2 Ubuntu 20.04 instance. Install docker on it and store the project folder directly in \\wsl$. In this WSL2 instance I run a docker webserver container. The webserver becomes accessible by localhost.
This seems to work very good, not sure why though... The websites running on the docker webserver are very fast and executing git or composer commands are fast. I open the project folder directly from the \\wsl$ location with PhpStorm.
The only issue I'm having is that I'm unable to create Xdebug session using PhpStorm.
My question is: How to configure the development environment so I can use Xdebug?
Facts & specs
Windows 10 as host machine.
WSL instance: Ubuntu 20.04
Docker webserver instance: Ubuntu 20.04 (php7.4-fmp and apache2, xdebug 3.0.3 port 9000)
The docker webserver container can access the host network (192.x.x.x.)
The docker webserver container can access the WSL network (172.20.x.x)
I use the following xdebug settings:
xdebug.mode = debug
xdebug.client_host = host.docker.internal (this goes to the 192.x.x. address)
Any advise on how to make Xdebug work in this setup?
can not run docker on windows7 command after installation, and there is nothing in virtualbox.
I have tried uninstall and install other versions, run install application administrately and try another dirver but above does not work.
...
when installation finished, i clicked the docker quickstart terminal, and it show me this error message:
dial tcp 127.0.0.1:53822: connectex: No connection could be made because the tar
get machine actively refused it.
Looks like something went wrong in step ´Checking if machine default exists´...
Press any key to continue...
Just a reminder, there are sort of 3 ways to use docker on Windows, if one doesn't work you may want to try another one:
use docker Desktop: it requires windows 10 Pro (In fact Hyper-V maybe it's an option for you)
use docker Toolbox: the one you may have installed on windows 7, it uses Virtualbox and a docker machine VM.
use Virtualbox directly: install a linux distribution with shared folder only for your docker usage
Now since you are on option 2, you should have a virtualbox installed, so you can check if the underlying docker machine is launched by launching virtualbox, it should list the installed vm.
If the vm is not started: you will have to search the problem on virtualbox side, error logs or popup: trying to launch the vm manually directly from virtualbox application will help you
If the vm is started: there may be a connection problem between your host (windows) and your vm (boot2docker), you could try to connect to the vm via bash using "boot2docker ssh" as it is indicated in the quick start. If it works, the connection problem could come from a firewall.
Check if the quick start happened correctly when you have luanched it.
I don't want to make proselitism on other solution, but it may be simpler to use a linux directly in virtualbox (option 3), at least at the beginning to get more familar with docker.
The other simpler option would be to use windows 10
I'm sorry it's not a complete solution, but indications, and it was too long for a comment.
docker server is not running properly. check is you can run docker ps or docker version command successfully.
I have Windows 10 with Windows Subsystem for Linux installed (Bash on Ubuntu on Windows), have Docker installed on Windows, and a Docker client running on the linux subsystem per this walkthrough. All works well, however, when I want to be able to access a volume on my default mount "/mnt/c/../". I am using the mount flags at docker launch and have tried both:
docker run -v $PWD:/mount
docker run --mount type=bind,source="$(PWD)",target=/mount
and most variations shown here.
I have reason to think this is a permissions issue. When launching from the linux subsystem, there is always one empty folder from the original source directory. When launching from windows powershell, everything is fine. The only difference between the two would be the docker client being used.
I have shared C in the docker host settings in windows, however, do I need to do something similar for the client inside of windows subsystem for linux?
Versions:
Docker client: Docker version 18.03.0-ce, build 0520e24
Docker host: Docker version 18.03.0-ce-win59 (16762)
I had the same issue with the same set-up. After a lot of trial and error and googling, here is what resolved the issue:
Change Windows password to not include special characters.
Reset credentials for docker.
Worked! Weird bug.
Is windows based image for "couchbase" available to install with docker? or any way around so that couchbase can be installed with docker in windows container.
The images are based always on Linux. You know an image is based on other image recursively till reach a base image like ubuntu, debian or whatever. Anyway, it is suppossed they are not related to the host O.S. They can be run on a Docker using a Windows host, Linux host or OSX host in the same way. On Windows or OSX you can install Docker to run container based on Linux images, there is no problem about that.
Depending of the use of the container, if it needs some hardware to be useful (like wireless cards or something like that), then the host is important because there are drivers and kernel directly involved. But usually, any image can be used to run containers independently of the Docker host.
As of today (2017-10-02), I don't think there is an official Couchbase Docker image for Windows container. Their Dockerfile shows that their images are built off of Ubuntu.
You can try setting everything up manually by following the steps below. (Note that installing via Chocolatey is just a convenience. You can choose another method.)
Get Windows Server Core image.
host> docker pull microsoft/windowsservercore
Start the container in interactive mode
host> docker run -it --name couchbase-on-windows microsoft/windowsservercore
Switch to PowerShell
container-cmd> PowerShell
Install Chocolatey
container-ps> Set-ExecutionPolicy Bypass; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Install Couchbase. (The version on chocolatey might be a bit behind the latest.)
container-ps> choco install couchbase-server-community
If all this works to your liking, then you can create a Dockerfile to make your own Docker image. You can see what this person did to create an image for Redis on Windows. Here's his Dockerfile.
I'm new to a docker and tried to create docker host with docker-machine.
Currently, I use VirutalBox for trial environment.
When I created docker host with docker-mahine, it created VM with Boot2Docker on VirtualBox by default. But I want to create a docker host with Ubuntu 15.10 on Virtualbox.
Is it possible to use docker-machine for creating Ubuntu based docker host on VirtualBox?
OP didn't describe how they used the generic driver to solve their problem, so here's how I did it in case anyone's interested:
Get Ubuntu Server ISO
Create a machine in VirtualBox. I called mine "Ubuntu template" because I want to learn Swarm locally, so I want a machine that I'll be able to duplicate and get subsequent machines quickly after the longer initial setup.
Enable bridged networking instead of NAT for the machine in the settings
Start the machine and install Ubuntu using the ISO. During installation it'll give you an option to install OpenSSH, select that option. It'll also ask you to create a new user. I called mine "ubuntu" with password "ubuntu". You'll use this user a few times, so set the credentials to something easy to remember
After installation, switch to root: sudo su
Change root's password to something easy to remember using passwd
Generate keys: ssh-keygen
Make the keys you just generated authorized: cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
Edit the file /etc/ssh/sshd_config and change the line with "PermitRootLogin" so it reads PermitRootLogin yes
Restart SSH to activate the changes: service ssh restart
Run ifconfig and take note of the machine's IP
Open terminal on your host computer
Run (with your machine's IP substituted):
ssh root#10.10.10.89 'cat ~/.ssh/id_rsa' > ~/.ssh/docker_test
Run:
ssh root#10.10.10.89 'cat ~/.ssh/id_rsa.pub' > ~/.ssh/docker_test.pub
Run (back in the VM) shutdown now
In VirtualBox, clone the template machine (check the checkbox to reinitialize MAC address). I named mine ubuntu-1
Start the new virtual machine and run echo 'ubuntu-1' > /etc/hostname and then reboot. That's only necessary if you're going to create more machines from the same template, then you'd name them ubuntu-1, ubuntu-2 and so on
Run ifconfig to find out the IP of the cloned machine
On your host machine run:
docker-machine create --driver generic --generic-ip-address 10.10.10.90 --generic-ssh-key ~/.ssh/docker_test ubuntu-1
It might take a few minutes to complete (mostly on the "Installing docker" step) but you should then have a working Ubuntu-based docker machine. You can verify that it works by running docker-machine use ubuntu-1 and then docker run hello-world
It's more involved than using Boot2Docker, but after the initial setup it should be quite workable. I haven't done too much with it yet, I just verified that it seems to work by running hello-world, so there might be more gotchas down the road like there often are with Docker.
Extra tip: VirtualBox allows you to run machines in headless mode. After the initial setup and allowing root access via SSH it'll probably be more convenient to run the machines headless and connect to them via SSH if necessary and you can close VB's GUI and the machines are now running like services in the background.
Is it possible to use docker-machine for creating Ubuntu based docker host on VirtualBox?
Yes, but not with docker-machine directly, which relies on a TinyCore-based linux distribution of 30 Mo only.
You can try and launch a full-fledge Ubuntu VM, and in it follows the regular docker installation for Ubuntu.