Oracle Cloud Infra connection between instances not working - oracle-cloud-infrastructure

I have two instances in Oracle Cloud Infra. Both running Ubuntu 20.4. I have very strange problem. I cannot access Apache on instance 1 from 2 or even from public IP. Both instances are part of same Subnet. I have enable traffic from Security list, NSG. I can ping and SSH but just can't access apache page on port 80
ubuntu#docker1:~$ ping 10.100.246.237
PING 10.100.246.237 (10.100.246.237) 56(84) bytes of data.
64 bytes from 10.100.246.237: icmp_seq=1 ttl=64 time=0.410 ms
64 bytes from 10.100.246.237: icmp_seq=2 ttl=64 time=0.662 ms
^C
--- 10.100.246.237 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1022ms
rtt min/avg/max/mdev = 0.410/0.536/0.662/0.126 ms
ubuntu#docker1:~$ curl http://10.100.246.237
curl: (7) Failed to connect to 10.100.246.237 port 80: No route to host
ubuntu#docker1:~$
Instance 1 Docker1 = 10.100.246.50
Instance 2 Docker2 = 10.100.246.237
I tried using Oracle Linux but still same problem.

You also need to open the port 80 in your firewall on your Ubuntu instances.
By default Ubuntu comes with UFW (Uncomplicated Firewall) so you can open the port with something like this : sudo ufw allow 80/tcp.
Oracle Linux uses firewalld.

Related

Locked out of SSH terminal

I manated to lock myself out of SSH on an Canonical-Ubuntu-22.04 SSH always free server. do anyone know how i can get access back?
PS C:\Users\mikel> ssh -i ~/.ssh/ssh-key-2022-10-19.key ubuntu#129.xxx.200.16
ssh: connect to host 129.xxx.200.16 port 22: Connection refused
ssh: connect to host 129.xxx.200.16 port 22: Connection refused
means the remote host is sending the reject flags back, it can be due to
firewall blocking ssh port
iptables blocking port 22
security groups (Ingress, egress) blocking port 22
First check if you have allowed port 22 in console, if yes
then login to instance via console connection and then try to debug 1,2 points

Can't connect to database: Host 'XX.XX.XX.XX' is not allowed to connect to this MySQL server [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 9 months ago.
Improve this question
I am trying to connect my database from my Perl program on linux, it is actually a work project. I need to fetch some values which are present in different tables.
The code I am using for the connection is below :
my $dbType = "mysql";
my $database = "trustid";
my $host="XXX.XX.X.XX";
my $dsn="";
my $userid="";
my $password="";
if($dbType eq "mysql") {
$dsn = "DBI:$dbType:database=$database;host=$host:port=3306";
$userid = "user_id";
$password = 'password';
} else {
$dbType = "postgres";
$userid = "postgres";
$password = "postgres";
$dsn = "DBI:$dbType:database=$database;host=$host,port=XXXX";
}
my $dbcon = DBI->connect($dsn, $userid, $password) or
die "Can't connect to database: $DBI::errstr\n";
print "connected to the database\n";
When I am trying to execute it by ./aa.pl it is showing the following error:
root#tc-lab-02:/home/abcdefgi/Ajay_POC/XL_Parsing# ./aa.pl
DBI connect('database=abcdefgi;host=XXX.XX.X.XX:port=XXXX','trusavc_sa',...) failed: Host 'YYY.YY.Y.YY' is not allowed to connect to this MySQL server at ./aa.pl line 40.
Can't connect to database: Host 'YYY.YY.Y.YY' is not allowed to connect to this MySQL server
I have changed the user to the root, still I am unable to make the connections.
You need to connect to localhost (instead of XXX.XX.X.XX) if the database server is local (i.e. on the same machine as the Perl program).
If the database is remote, you'll need to create a tunnel to that machine's localhost, or you'll need to adjust the MySQL server's configuration to accept connections from your machine.
When communicating over the internet, one doesn't communicate with a machine so much as with a network adapter on that machine. A machine might have multiple network adapters, each with its own network address. These logical network adapters correspond to physical network adapters (e.g. ethernet, wifi, etc) and to virtual network adapters (e.g. an interface between a host system and a VM hosted on that system).
All internet-capable systems have a special virtual adapter known as the loopback adapter. This is the one assigned the IP address to which localhost resolves (usually 127.0.0.1 [IPv4] and/or ::1 [IPv6]).
What's special about this adapter is that it can only be used to communicate with itself. This means two things:
When you communicate with localhost, you also communicate from localhost.
When you communicate to something other from localhost, you also from something other than localhost.
For security reasons, MySQL only authorizes connections from this interface by default. This ensures that you only expose your database to programs running on your system.
But because of the "rules" listed above, it means you must connect to localhost to access your database, not some other interface such as a your ethernet or wifi interface.
For example, consider a system with these interfaces:
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.24.241.85 netmask 255.255.240.0 broadcast 172.24.255.255
inet6 fe80::215:5dff:feef:f494 prefixlen 64 scopeid 0x20<link>
ether 00:15:5d:ef:f4:94 txqueuelen 1000 (Ethernet)
RX packets 620620 bytes 187701194 (187.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 179 bytes 12626 (12.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
(This is from Linux. On Windows, you can use ipconfig, but newer version don't actually show the loopback adapter.)
If this machine runs MySQL with its default configuration, it will listen to all interfaces for connections. However, it will only authorize connection coming from 127.0.0.1 and from ::1.
This can be achieved by connecting to 127.0.0.1 or ::1, but it can't be achieved by connecting to 172.24.241.85 or fe80::215:5dff:feef:f494. The latter two would reach the MySQL server (since it listens to all interfaces on the machine), but it would reject the connection with the error message you obtained ("Host 'ADDRESS' is not allowed to connect to this MySQL server").

How to Debug CUDA code on a remote server?

I want to debug the CUDA code on the remote server, My equipment is as follows:
Pc: Ubuntu 16.04,CUDA 8.0.61,nvcc v8.0.61,Geforce MX150 and integrated graphics
Server: Ubuntu 14.04,CUDA 8.0.61,nvcc v8.0.61,Tesla P100-PCIE*2
I have installed the Nsight Eclipse Edition 7.5 on my pc, What I want is to use the remote debug function that I can use the Visual debug window on my PC and remote gdbserver,But I have encountered some problems.
When I configure remote debugging to try to connect to a remote server,the Connection timed out return from the connection.
I don't know if it's related to the port. When I log in to the server, it looks like this:
SSH -P 50034 username#xxx.xxx.xxx.xxx
When setting up the connection, I noticed that port 2345 seems to be used, so I don't know if there is a conflict.The setting page is like this:
So far,I have tried the following:
Reinstall the Nsight Eclipse Edition,and debug sample code on the server in the command line which runs correctly.
Some forums mention that port 2345 should be opened,AFAIK,You can use this port as long as the port is not occupied when requested,but,I am not sure about it.
Considering that the server has certain restrictions on the visitor's IP address,so I tried to change the network several times but failed in the end.
Any ideas?
This problem was finally solved and I got a sigh of relief.
Since my server is in a cluster, ports are mapped. For example, the command when connecting to the server the port id should be attached with (i.e.ssh -p 50034 uesrname#xxx.xxx.xxx.xxx), so when the nsight eclipse edition's port 2345 (default) accesses the server, it does not recognize the port, then the time out delay is given, so I mapped the port 2345 to the server's port 2345, The map roughly as shown below:
-A PREROUTING -d xxx.xxx.xxx.xxx -p tcp -m tcp --dport 2345 -j DNAT --to-destination xxx.xxx.xxx.xxx:2345
The first xxx.xxx.xxx.xxx is the server's IP adress while the last one is the real adress of ur server in the cluster such as 11.11.11.24,which is Owing to the different conditions.

“Unable to connect to gear” in scaled openshift app

I'm having php-5.4 scaled app with mysql-5.5. Since it's scaled app mysql is placed on separate gear than app instances.
Since around 03/08/2015 I'm unable to connect to mysql gear, nor my application. I've been trying the following:
Restart all apps and deps with ctl_all.
$ rhc ssh --gears -a loot ctl_all restart
Unable to connect to gear 556c74555973caffa300022c#556c74555973caffa300022c-honourforever.rhcloud.com
(...)
SSH connection to mysql gear.
$ ssh -vvv 556c74555973caffa300022c#556c74555973caffa300022c-honourforever.rhcloud.com
OpenSSH_6.6.1, OpenSSL 1.0.1m 19 Mar 2015
debug2: ssh_connect: needpriv 0
debug1: Connecting to 556c74555973caffa300022c-honourforever.rhcloud.com [54.166.94.12] port 22.
debug1: connect to address 54.166.94.12 port 22: Attempt to connect timed out without establishing a connection
ssh: connect to host 556c74555973caffa300022c-honourforever.rhcloud.com port 22: Bad file number
Check gear storage used percentage.
$ rhc show-app loot --gear quota
Unable to connect to gear
556c74555973caffa300022c#556c74555973caffa300022c-honourforever.rhcloud.com
Gear Cartridges Used Limit
------------------------ ------------------- ----- -----
556b44544382ec7b32000050 haproxy-1.4 php-5.4 92 MB 1 GB
556c74555973caffa300022c mysql-5.5 error 1 GB
Therefore I have no means at the moment to connect to mysql or gear it's sitting on.
Unfortunately this is not a programming problem and cannot be fixed from user side. To fix this problem it is needed to contact OpenShift support.

can't connect to mysql remote

I have a client on linux and the mysql server on windows
I wanted to connect to mysql remotely 2 computers can ping each other without any problem in mysql server I set the permission correctly so the specified client is allowed to connect
WIN IP: 192.168.1.2
Linux IP:192.168.1.3
in windows system:
GRANT ALL ON *.* TO 'parsa'#'192.168.1.3' IDENTIFIED BY 'parsa';
flush all privileges;
in my linux,in my.cnf I wrote this line in mysqld section
bind-address=192.168.1.2
skip-networking was commented and I didn't change it
I restarted the mysql
when I use
telnet 192.168.1.2 3306
telnet:connect to address 192.168.1.2:Connection timed out
and using this command:
mysql -h 192.168.1.2 -u parsa -p parsa
Error 2003:can't connect to mysql server on 192.168.1.2
The firewalls in both sides are disabled what should I do?
command:net stats srv
Statistics since 2/29/2012 4:52:22 PM
Sessions accepted 1
Sessions timed-out 0
Sessions errored-out 0
Kilobytes sent 0
Kilobytes received 0
Mean response time (msec) 0
System errors 0
Permission violations 0
Password violations 0
Files accessed 0
Communication devices accessed 0
Print jobs spooled 0
Times buffers exhausted
Big buffers 0
Request buffers 0
The command completed successfully.
Connection timed out can mean two things:
Your server is too busy to respond
There is a firewall between your client computer and the server which blocks the connection.
To see how busy the server is, use uptime. Load average > 10 means "busy". Load average < 1 means "idle".
If the server is idle, check for the firewall settings on the server, then check the client.