Minishift on remote machine - openshift

I'm trying to 'start' a minishift cluster on a remote machine (not the standard way on a virtualized machine). Both my machines (the control node and the target) reside in AWS, have access to internet but do not have public IP's. The installation passes through but in the end an error is printed:
'Error during post cluster up configuration: Unable to add sudoer role: The connection to the server 127.0.0.1:8443 was refused - did you specify the right host or port ?'
The start command is as follows:
minishift config set vm-driver generic
minishift start --remote-ipaddress 10.112.33.85 --remote-ssh-user root --remote-ssh-key path_to_key
I tested the installation with public IP's and it passed through without any problems. Does it mean that remote machine installation is not supported for non public IP's ? Firewalls on both machines are fully open, the machines can connect via ssh, control node runs RHEL 7, target Centos 7 (RHEL before, makes no difference). I tried the usual delete ~/.minishift and stuff, nothing works.

Remote machine installation works fine within a private network. The problem was in proxy configuration which is rather tedious.

Related

issues connecting to AWS production database

I've been working in a local and staging database (hosted on AWS) for this app I'm working on with no issues viewing and seeding data in both environments. However, when I try connecting to the production environment to either view or seed data, I get the following error:
mysqli_real_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
I've double checked that the credentials I used matches the credentials of the production environment and I retyped out the credentials also to ensure no whitespace characters accidentally got copied over.
I thought maybe I was having an issue with the administrative tool so I switched from phpMyAdmin to DBeaver which also didn't seem to work.
Disabling my firewall also didn't help out.
After some research online I followed this guide to authorize RDP traffic to my computer's public IPv4 address, but after following these steps I still get the above error.
my phpMyAdmin config file looks like this
/*
* Production Server
*/
$i++;
$cfg['Servers'][$i]['host'] = 'host';
$cfg['Servers'][$i]['user'] = 'user';
$cfg['Servers'][$i]['password'] = 'password';
/*
* End of servers configuration
*/
?>
Using XAMPP v3.2.3 with server version MySQL 5.7.26-log and the platform runs on AWS is PHP 7.2 running on 64bit Amazon Linux/2.8.12
I'm using a Windows 10 machine and I wanted to note that my coworkers are on a Mac and had no issues connecting to the AWS instance in a remote location from me. Neither coworkers added their IPv4 to the security group.
Can anyone point me to the right direction of where the problem could be occurring? I'm stumped on this one...
RDP and RDS are completely different. RDP is remote desktop protocol and is therefore a method to log onto a Windows machine. RDS is AWSes managed Database service which allow you to connect to a database flavour (in this case I expect you've chosen MySQL).
If you want to connect from your local PC to RDS then ensure that you've enabled traffic from your public IP via tcp/3306 in the security group that RDS is using.
If you want to connect from RDS to your own local MySQL instance then you'll probably need to set up a NAT on your local router which maps from it's public ip and tcp/3306 to the appropriate private ip and tcp/3306 but if you do that it's really important to ensure you restrict incoming traffic from the appropriate source IP only.
By the way, is it possible that the person on a Mac is tunnelling through an SSH session to get to the database?

MySQL Remote Connection (Replication)

I have the following topology.
One Ubuntu 16.04. Instance on the Amazon AWS where my global MySQL Server is running. I want to use this Server as a Slave (Multi-Source Replication) for many local Master (Windows Machines MySQL Server).
For Testing Reasons I`ve Managed to make this running on one local Machine (with three different MySQL Server Running).
But now I want to make this Replication work on the mentioned global Server with the local ones. But it fails on the attempt to connect from the EC2 ubuntu Instance to the local Windows MySQL Server.
When I try to connect from my EC2 Instance to the local Computer with MySQL running on Port 3307 it keep saying:
ERROR 2003 (HY000): Can't connect to MySQL server on (113)
The strange Part is, that I can PING the Local Computer but not telnet it.
Telnet just says:
telnet: Unable to connect to remote host: No route to host
I can access the Global (EC2 / Ubuntu MySQL Server) from the local Machine but not the other way around.
I`ve already made a new Rule for this Port on the Windows Firewall Settings.
But the Port 3307 on the IPv4 Address seems to be still Closed.
I have no clue what I am missing to get a Connection from the EC2 Instance to my local Computer via TCP.
Do I have to open the Port Specific on the Router?
I hope for your help.
Best Regards.
It seems like your local computer is not visible, as your incoming ports to your local pc are closed. It may be a problem with your router, or your internet service provider, which is not allowing you to open ports(the most common one).
The possible solutions are:
1.) If your ports are not open due to the router
Try forwarding required ports to your pc.
Try Switching off your NAT firewall that may be blocking ports.
Try switching off your windows or antivirus firewall if any.
2.) If your ports are blocked by your Internet service provider.
Try getting help from ISP
Switch to a static IP connection if on dynamic.
Use a VPN service that provides an unblocked port service to all IPs.(This one solved my problem when I was struck in this situation.)

Redhat CDK could not find matching ip for mac windows/vpn software

Question: How do I get CDK to work on the corporate laptop using virtualbox without running into the 'could not find mathcing ip for mac' issue?
environment: Windows7, CDK 3.2.0, Virtualbox 5.0.x/5.1.x various versions tried. Key callout, corporate machine has VPN software (cisco anyconnect) while home pc does not, home pc works fine. Issue happens regardless if using VPN or not. Virtualbox (all versions) proven to work using vagrant.
Key finding:
minishift ssh -> functions, doing an ifconfig returns eth0 with a 10.0.*
network, instead of the expected 192.168.99.* network segments configured
for virtualbox network host adapters. Explicitly using minishift config set
host-only-cidr 192.168.99.1/24 with matching virtualbox host adapters
doesn't change outcome
Details:
c:\devrh\cdk\bin>minishift version
minishift v1.7.0+204ce19 CDK v3.2.0-1
c:\devrh\cdk\bin>minishift start --vm-driver=virtualbox -- Starting local
OpenShift cluster using 'virtualbox'
hypervisor ... -- Starting Minishift VM ............................ FAIL
E1108 10:27:05.991687 3128 start.go:356] Error starting the VM: Error
configuring authorization on host: Could not find matching IP for MAC
address 0800279fa156. Retrying. Error starting
the VM: Error configuring authorization on host: Could not find matching IP
for MAC address 0800279fa156
corporate workstation has the issue, home PC does not.
Minishift delete and restart, same issue (different MAC address, but same issue).
Virtualbox remove all host adapters, minishift delete, restart (which auto-creates new host adapters), same issue.
Minishift --profile approach, same issue.
Uninstalled virtualbox, installed the version from the RHDevSuite installer with the CDK from the installer, all steps tested with that combination as well, same issue.
Additional notes, Virtualbox is working fine with vagrant (static IP’s in vagrant files), virtualbox/vagrant combo works on both corporate and home machine without issues.

MySQL:Error 2003 lost connection from a virtual machine on the same localnetwork

Apologies for the bad english, i'm french. :D
I've been looking for an answer since approximatively 4 days, and I don't know how to fix my issue.
So:
I want to virtualize two servers using virtualBox on Windows7 and i want them all on the same local network.
My VMs are running on Ubuntu 16.04
On the first VM I installed a lamp web server with MySQL 5.7 and i add phpmyadmin.
On the second VM I installed Jira standalone
--> I need to connect to my Database from my Jira server
So I used the Bridge adapter on each machine:
network configuration
network configuration
Ip adresses are attributed with the DHCP protocol.
The SQL machine ip is 192.168.6.80
The Jira machine ip is 192.168.6.101
The Host machine ip is 192.168.6.87
I'm able to ping each machine so there is no problem.
SQL server
When I start the machine everything seems to work, i can access from my SQL server:
localhost : home page of apache 2 saying "It Works"
localhost:5671 :
[���
5.7.18-0ubuntu0.16.04.1� ���UKBeM�ÿ÷�ÿ����������T(DGKg1hwd=�mysql_native_password���ÿ„Got
packets out of order
localhost/phpmyadmin : the index page where I can connect perfectly with root.
Host Machine (Windows)
192.168.6.80 : home page of apache 2 saying "It Works"
192.168.6.80:5671 :
[���
5.7.18-0ubuntu0.16.04.1� ���UKBeM�ÿ÷�ÿ����������T(DGKg1hwd=�mysql_native_password���ÿ„Got
packets out of order
192.168.6.80/phpmyadmin : the index page where I can connect perfectly with root.
Jira server
Here when i start the machine it works during approximatively 2-3 minutes,
I'am able to connect via:
mysql -u root -p -h 192.168.6.80 -P 5671
I am perfectly connected and i can also access to all the other adresses.
And then it stop working on this machine only.
Unable to connect
Firefox can’t establish a connection to the server at 192.168.6.80.
The site could be temporarily unavailable or too busy. Try again in a few moments.
If you are unable to load any pages, check your computer’s network connection.
If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
And when i re-try to connect via mysql on terminal I get the Error 2003 (HYOOO)
This happen only when i use the connection of my work, at home it works perfectly without stopping!!
I have few leads:
problems of proxy authentication
problems of firewall configuration
i am in a private network with a domain name called something.eu
And when i launch firefox the proxy shows up automatically:
and-etc-ha.something.eu:9090
So i'm invited to enter my id and password.
My id is : luc.myName#something.eu
After that i'm connected to internet with firefox but not in terminal when i want to use apt.
I search on the web and i found this:
export http_proxy="http://Username:password#proxyip:port/"
and
export http_proxy="http://Domain\user:pasword#proxyip:port/"
So I tried different ways and i was able to download with apt. But the internet connexion with firefox was unstable. But if I use firefox on my host machine the connexion is perfect.
I also tried with settings -> network -> network proxy -> method manual
http: and-etc-ha.something.eu port: 9090
I don't know if I was understandable, tell me!^^
If you have any ideas to help me to solve this problem let me know.
Bye!
I found the cause: In fact there was a ip conflict inside the LAN because the DHCP was giving in-use ip address.
I decide to use the NAT connection with Port Forwarding on VirtualBox.
With that configuration I'm able to access my VMs on my LAN using the host ip address followed by the port of my choice.

phpstorm debugging mamp but not my remote server

I have tried many ways to debug my remote server but I am unable to do so. My ftp and sftp and remote db is configures to my phpstorm 9 but I cannot debug my remote server it is connecting to my mamp server and debugging ,y local files but not connecting to server username and password . Basically it fails at mysql_connect but works for mamp.How can I make it deubug with server.Everything else is synced with server but I cannot debug. I really appreciate any help.
Edit: Should I install x-debug on my server(cpanel) also ?
php.ini
[xdebug]
zend_extension="/usr/local/opt/php55-xdebug/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_connect_back=1
Maybe I didn't understand your question/problem. These are the ways you can debug your code
Debug the local code that uses the local database
This is the easiest setup and it probably already works on your system. You have all the files on the local computer and also you have an instance of MySQL running on it. The code connects to localhost:3306, the xdebug extension is installed and it can connect to PhpStorm, everybody is happy.
Debug the local code that uses the remote database
You can have all the PHP files on localhost and use the local mamp stack to debug it; you control the environment, xdebug works and happily collaborates with PhpStorm. You want the code to be able to use the remote (live) database.
In this case you need a way to access the database. Either you create a MySQL user that allows you to connect from the IP address of the local computer (a firewall along the way might prevent this), or start a ssh session that creates a tunnel from the local port 3306 (or any other open port you choose) to port 3306 of the database server (assuming the host where you ssh is allowed to connect to it). You can do this by running
ssh user#remote_host -L 3306:database_host:3306
(replace user, remote_host and database_host with your actual values)
If you have a MySQL server installed and running on localhost then the local port 3306 is not open and ssh cannot use it as the source port of the tunnel. Use another port instead (let's say you use 13306):
ssh user#remote_host -L 13306:database_host:3306
Modify the local configuration files of your application to use localhost as database server and 13306 as database port.
Debug the remote code
If you want to debug the live code (it uses the live database) then you have to upload the code on the web server (the live environment) and make it work there (be able to connect to the database etc).
In order to be able to debug it you need to have the xdebug PHP extension installed on the server and properly configured in the server's php.ini configuration file.
The debugger (the remote xdebug extension) needs to connect to your local computer where PhpStorm is listening on port 9000. This is either impossible or making it happen requires changing configuration here and there in several places (that might be out of your control); we better forget about it.
We can use the ssh tunnel trick: start a ssh connection to the server that creates a tunnel from local port 9000 to the servers port 9000:
ssh user#remote_host -L 9000:localhost:9000
Test if it works
PhpStorm provides a tool that uploads a script on the web server then tries to access it to check if the xdebug extension is properly configured. Depending on the version of PhpStorm you use, you can find it either in the menu (Run -> Web Server Debug Validation, on PhpStorm 9) or somewhere in the Settings (PHP -> Servers or around, on older versions).