Confluent Connect on Different Port Not Working - connect

I'm setting up the Confluent-Stack using portainer on a Linux computer. One of my other containers is already using port 8083 (the default confluent-connect port) - so I replaced 8083 in the docker-compose.yml file with 8089. However, when everything starts up, I cannot see a connect cluster in the control center at all.
This is my base docker-compose.yml file:
https://raw.githubusercontent.com/confluentinc/cp-all-in-one/7.0.1-post/cp-all-in-one/docker-compose.yml
I got this link from here:
https://docs.confluent.io/platform/current/quickstart/ce-docker-quickstart.html
I've spun up the stack in portainer (not using a docker-compose command as suggested in the above tutorial) using the .yml file edited a little to replace the "8083:8083" with "8089:8089" and replace other "8083" occurences with "8089".
I also initially used port 7777 as a replacement, in this case I though I should replace "8083:8083" with "7777:8083" and the other "8083"'s I replaced with "7777". I'm a little new to these ports and clearly not understanding how one is supposed to set this up?
Please help. Thanks!

I ended up being able to reroute the other container that was using the 8083 port without issues, so I could use the default docker-compose file for the confluent stack and then everything worked fine. So my problem is solved, but the issue may still haunt me.

Related

When running two NodeJs apps in same vps one use others .env conf and get connected to the wrong db

I have a VPS with Instance (Debian 9.4 (stretch) 20180404)
There I have a few WordPress sites and also a nodejs app that I will call "prod" running with PM2 without any problem whit apache2.
Now I want to run a new nodejs app on a subdomain which basically will be the dev environment of the previous and working node.
My issue is that when I start dev, prod gets connected to dev's database, no matter if I run dev as "node inde.js" or by PM2.
Each node environment is in its correct web folder and has a specific .env that has the credentials to access each database (one for prod and another for dev)
Could anybody please help me to sort out this issue?
On the apache2 config, I configure a proxypass reverse so I don't have to add the:3000 and I copied the conf to dev, could be that a problem? Are both listening to the same port? if yes, how do you suggest solving it?
Thanks in advance!
I resolved it.
I leave the solution in case anybody comes to the same issue.
The problem was indeed the port, so I'm using port 3000 for production and port 3002 for dev.
Also with the .env files, I decided to have one .env file for each environment and both are in the same location outside the git repository.
Everything works as expected.
Cheers!

Remote debugging nodejs app in Intellij with Docker - port already allocated

I want to start debugging node.js app using Intellij and node.js interpreter running on Docker. While running the app works, when I try to debug I get the error:
Error running 'index.js'
com.github.dockerjava.api.exception.InternalServerErrorException:
{"message":"driver failed programming external connectivity on
endpoint focused_poincare
(a17137973880d1be7c6a74fc142184fdda31e0dec8ebd539b09d9dbe4cf70014):
Error starting userland proxy: Bind for 0.0.0.0:55578 failed: port is
already allocated"}
Remote interpreter was configured acccording to the documentation. I have created a new Node.js Run/Debug configuration and entered the following data:
.
What might be the cause for debugging not working?
I use:
Intellij Idea Ultimate v. 2019.1.4 Preview
Intellij NodeJS plugin v. 191.7479.1, NodeJS remote interpreter plugin v. 191.6014.8 and Docker plugin v. 191.7141.44
Docker Desktop Community v. 2.0.0.3
EDIT: Adressing the comments:
Local debugging works. The file (index.js) that I am trying to run consists only of console.log('Hello world!') so I don't spawn any child processes on my own. My host system has Windows 10 Pro as OS, so for checking the open ports on host system I used netstat -an | find "55578", which returned nothing. Moreover, if I try to run docker manually from the command line, using docker run -it -p 55578:55578 node, everything runs and no error is given.
Also, each time I try remote debugging, the port number given by Intellij in an error message seems to be random high port number. I tried looking for open ports just after getting error message, but never found one that is open with a number reported by Intellij and those indeed appear in the output:
My Run/Debug configuration:
My Docker configuration (I had to check "Expose daemon on tcp://localhost:2375 without TLS" in Docker configuration to make Intellij and Docker play together):
EDIT: When I add --inspect-brk=0.0.0.0:55432 as "Node Parameters" in "Run/Debug Configurations" Intellij windows (per this bug report) the container nad program start, but debugging seems to be no-op (e.g. the program does not stop on breakpoints).
After updating to Intellij v. 2019.2 I was able to get the container debugging to work using the workaround already mentioned in my question.
I have added a parameter --inspect-brk=0.0.0.0:55432 to Node parameters option in Run/Debug configuration (see the picture below) and everything seems to be working, including the breakpoints.

one linux connect to another ip,How to use docker make them into images and deploy to somewhere else

Now I have two Linux PC,mongodb is in the first PC which IP is 192.168.1.33,and a
java application on another Linux connect to the mongodb on 192.168.1.33
What I want to do is,prepare everything and make both Linux systems into docker images,and when I am in productive environment,I can simply restore the images that I prepared,and everything is OK,so I do not need complex deployment steps.
but the problem is,the IP of mongodb will change,and the IP 192.168.1.33 is written in my configuration file of my java application,it will not change automatically,is there a automated way?
Basics
We create Docker-file with minimal installation steps.
We create docker-Image from that Docker-file in step-1.
We create container from the step-2 image and expose the important port as required.
For your problem.
creating-a-docker-image-with-mongodb This article will help to dockerize the mongodb.
but the problem is,the IP of mongodb will change,and the IP
192.168.1.33 is written in my configuration file of my java application,it
will not change automatically,is there a automated way?
If you expose the mongo-db port to docker host you can use same
docker-host-IP:<exposed-port>
Ref from the article sudo docker run -p 27017:27017 -i -t my_new_mongodb
Example: 192.168.1.33 is your docker-host where mongodb container is running with exposed port 27017. You can add 192.168.1.33:27017 to your JAVA app.
What I want to do is,prepare everything and make both Linux systems
into docker images
You can not convert your VM to direct docker images. Instead you can follow the steps written in Basics and dockerize the both DB and application layer.
2.dockerize-your-java-application refer this link and dockerize you application based on requirements.
Step 1 & 2 will help you to build docker images which you can deploy to multiple servers.

connecting to services on docker host from docker container

Apologies for asking two unrelated questions.
what is the best way of accessing the host machine of the docker container (i.e. I am trying to access a kafka instance running on the host, from my docker container so that I can publish some messages)
when I run docker run ..... on an image which I've modified that may have an issue/syntax error, it will naturally not start - is there a log file anywhere that I would be able to take a look at to debug the issue. (this question is somewhat related to the 1st question, since I did what was suggested on another post, but the image is still not starting)
This is an ongoing discussion on what to use and what not, I don't really know what is best. Using the docker run --net="host" is pretty easy but can be dangerous. See From inside of a Docker container, how do I connect to the localhost of the machine?.
Use docker logs containerid or lookup the raw data in /var/lib/docker/containers/containerid/ for Ubuntu.
You should have no problem connecting to the host using the local lan interface ip address. Suppose you have a host with ip 192.168.0.1:
docker run --rm -ti ubuntu bash
ping 192.168.0.1
should give you a response.
You can use docker logs to see the standard output of your container.

Creating an environmental variable within Docker container when starting up

How would I get the ip address of a mongo container and set it as environmental variable when creating a node image?
I've been running into an issue with conflicting tech stacks: keystone.js, forever, and docker. My problem is that I need to set up an environmental variable for a separate mongo container which would seem easy to do by running a shell script when I start up the container that includes:
export MONGO_URI="mongodb://${MONGODB_PORT_27017_TCP_ADDR}:27017/(db_name)"
The issue comes with starting the keystone app. Normally I would place it in the same script and call it with docker run but this project we need to use forever. Command would be forever keystone.js. There is an issue with this in that the docker container drops immediatly. If I start the app with a simple forever start rather than going to the script the app starts up fine but the env variable needed is not set. It's hard coded in the docker image but of course this is not a good solution as the ip of the mongodb may change in the future and then on the node container restart it would not be able to find the db. See a couple of possibilities:
Switch to just using a node keystone.js, would loose the functionality of the forever start (which will restart the app if there is a critical failure). Tested and this works but maybe someone knows a way to make forever work or a viable alternate?
Find a way to set the above export from the docker file when creating the image. Haven't been able to get this to work but I do know the name that the mongdb is going to use no matter what if that helps
Any help is most appreciated.
The best way is to use docker link this provides you a hostname + your environmental variables.
docker run ... --link mongodb:mongodb ..
Also you can use the command line option from run
docker run -e MONGO_URI="mongodb://${MONGODB_PORT_27017_TCP_ADDR}:27017/(db_name)"
An Option for dynamic dns would be SkyDNS + SkyDock.

Resources