can two mysql version can share same port number? - mysql5

Hi
I have mysql 5.0 and going to install mysql 5.5
Can i use the same port 3306 for the both versions of mysql?
Will it create any problems?

Two services cannot listen on the same IP address and Port concurrently.
You have to either
Change the port number of one of the instances.
Run one instance on a second network interface (i.e. a different IP address).
Do not run them concurrently.
This is not due to any Mysql version restrictions. Its just a port cannot be taken by more than one application to listen on, on the same network address.

Yes you can, on different ip's.

Two running servers cannot share the same port on the same computer.
But if you only ever start exactly one of the servers then it shouldn't be a problem.

Related

How to use Ansible to update a client machine without having its IP address

Ansbile can be used to update a machine via ssh, and in order to establish such connection, you need an accessible IP address.
How to use it to update a fleet of distributed machines on different networks (consumers) which don't have a public address?
One solution I was thinking of, is to reverse the procedure, have Ansible configured on the client machine, that connects each day to the server, read a file to see if it has a new update for it and loads that update.
I find this not straightforward, is there another way?
ansible-pull is exacly what you are looking for.

Access xampp from VMWARE to Public IP

Is it possible to access 127.0.0.1:8080 publicly i have a project application that is running on VM, What should I do?
Diagram:
VMachine( where xampp is installed) IP <-> Global(external) IP (167.1.174.21:8080)
I don't have any option left what should i do i'm really new to this. #respect
Yes, this is possible but there are multiple steps to the configuration and the details for each steps differ depending on the hardware/software used. In general though it can be accomplished like this:
VMware config
Configure the VM with a bridged network
Configure the guest OS to either have a dhcp reservation or static ip.
Router config
Add a dhcp reservation for the VM (if using DHCP)
Add a port forwarding rule pointing to the VM's IP address
XAMPP config
Make sure the XAMPP server is listening on all interfaces.
The key point is to make the Virtual Machine to have bridged connection.
You can do it by looking at this one.
After that do a Port Forwarding to the virtual machine like it a real machine on your LAN.
Step 1 : Apart from above solution, in your local network where xampp is installed, make your local ip as static one, like "192.168.1.125" from router settings->Address reservation option.
Once you reserve address
Step 2 : Open your router->port forwarding->set port & ip to forward.
Step 3 : Now you check your public ip, and bingo now you can go to your public ip from vmware or from any other network.
As long as the vm has a configured network and is therefor able to communicate with your LAN (using Bridged networks in the VM configuration is a good way to go) and the internet, it is possible to make it accessible to the external web/internet.
Therefor you would most likely need to define a port-redirect/port forwarding on your router, that all incoming packets on the external IP (167.1.174.21) on port 8080 gets forwarded to the local ip of your vm and the related xampp session.
A possible problem at that point might be changing IP addresses of the VM based on a possible DHCP configuration. Either use a fixed IP on the VM or configure some mac-based rule for fixed IP or increase the lease time of the dhcp-server (your router to unlimited)
That's the theory, but please think twice before you do so. Running a webserver which is available in the wild is not recommended if you are not used to IT security. And even if you decide to do so, using xampp sounds wrong to me ears. xampp is designed for local development & testing purposes, not for productive use.

Vagrant: Why forward database ports?

I'm a vagrant newbie trying to configure his first instance. But wherever I look on Vagrantfiles configuring PostgreSQL they're always using port forwarding to the host.
config.vm.network :forwarded_port, host: 5432, guest: 5432
What is the point of forwarding database's port to the host?
Shouldn't the database be operating inside the box?
Or is it just a practice to have better data persistance?
And even if this is desired workflow and everything's forwarded then what is the point of installing the database inside the box after all?
This is mainly so that you can use Graphical Database SQL tools to query your Postgres database from your host machine. Since vagrant is used mainly by programmers and they need to frequently check the database for testing/debugging, this is in place. IDEs like IntelliJ and Eclipse have tools that you use to query databases and they would run on the host machine and thus would need to have access to the database port.
If you don't need to query your database from your host machine and it is only accessed by the guest VM, then you don't need this set.
Shouldn't the database be operating inside the box?
Yes.
Or is it just a practice to have better data persistence?
There is no relation between port forwarding and data persistence.
And even if this is desired workflow and everything's forwarded then what is the point of installing the database inside the box after all?
What is the point of forwarding database's port to the host?
There is no need to always forward port. Port forwarding is only needed when you want to access that port from host machine, e.g. using graphical tools as pointed by blownie55's answer. If you don't need to access the port from host then there is no need to forward it.
And this is true for all kind of port forwarding, not only for database port.
As a side note, there are other ways to access resource inside guest from host, e.g. configuring a private network.

java socket server hosting

I am creating an android client app connected to a Java server using sockets. At the moment I am working both on my pc. How can I upload my Java server to an online server so I can set my app to friends and test it?
I used OpenShift but could figure our how and if I can use it for what I want.
Also I looked at Amazon ec2, but they need credit card information, something that I would prefer not sharing for this.
Is there any way I can do this for free?
Thanks
Make sure you have a computer able to connect to the internet, and that can run 24/7. Then run your server on that computer, assume you run it on port 8080. Make sure that your host computer's IP address is it to static, otherwise DHCP will give it a different IP every time it connects to the router.
To allow your friends to connect, unless if they're on the same LAN as your host, you will need to port forward port 80 -> ComputerIP:8080 on your router. Once that's done, you will need to retrieve your router's global IPv4 address from it's configuration page and then send that to your friends.
If they're on the same LAN as your host, then you can just give them the IP address of your host computer.
If you port forwarded your server and you would like to get a host name, like stackoverflow.com, you're going to need to buy that from whoever owns the host name you would like to use. I don't know many details about how to update the DNS servers though.
If your server is local and you would like a host name, then just go onto your router configurations page and tell it to automatically assign each computer the default gateway as the primary DNS and then add a mapping in the router's DNS settings to map the host name to your computer's local IPv4 address. Note that not all routers support this feature.
Edit: You'll also need a good bandwidth to support multiple simultaneous connections.

Docker Minecraft Host

I am trying to host Minecraft servers in docker containers on an ec2 instance, and point a different subdomain to each container, for example
a.example.com -> container 1
b.example.com -> container 2
c.example.com -> container 3
...and so on.
If these containers were running a website, I could forward the traffic with Apache, or node-http-proxy, etc. But because these servers are running TCP services, I cannot route the traffic this way.
Is this possible? And if so, how?
The Minecraft client has supported SRV DNS records for a while now (since 1.3.1 according to google). I suggest you assign your Docker containers a stable set of port mapping with the -p flag, and then create SRV records for each FQDN pointing to the same IP but different ports.
Google gives several hits on the SRV entry format - this one is from the main MCF site: http://www.minecraftforum.net/topic/1922138-using-srv-records-to-hide-ports-on-your-server-ip/
I have four MC servers running on the same physical host with a single IP address, each with a separate friendly entry for players to use in the Minecraft client, so none of my users need to remember a port. It did cause confusion for a couple of my more technical players when they had a connectivity issue, tested with dig/ping, then thought the DNS resolution was broken when there was no A record to be found. Overall, I think that's a very small downside.
Doesn't HAProxy http://haproxy.1wt.eu/ route tcp traffic?

Resources