Fresh install of DataStax Cassandra fails with "Install Errored: The installed agent doesn't seem to be responding" - cassandra

I have 4 fresh Ubuntu 12.04 instances that I am trying to install Cassandra (DataStax Enterprise) on. I have installed and configured everything (from a known good installation procedure) and I am at the point of connecting to OpsCenter and creating a cluster. The OpsCenter agent seems to install fine on 3 out of the 4 nodes, but the one that is actually running OpsCenter (dual-purposed as an OpsCenter and Cassandra node) fails with:
Install Errored: The installed agent doesn't seem to be responding
In the /var/log/opscenter/opscenterd.log I see this:
WARN: HTTP request http://10.1.1.26:61621/alive? failed: 503 Service Unavailable
This is the node with OpsCenter on it. The opscenterd service is running, 61621 is listening and accessible from other nodes and from itself, I tested wget to that URL and it indeed throws a 503. All other nodes respond with a 200. Not sure what to look for... Any suggestions? Let me know if you need more details - I didn't want to clutter the post with too much useless/irrelevant details...

i found same error like you.
I did change rules Iptables , and the issue resolve.
[root#ip-172-xxxxx ~]# iptables -I INPUT -p tcp --dport 61620 -j ACCEPT
[root#ip-172-xxxxx ~]# iptables -I INPUT -p tcp --dport 50031 -j ACCEPT
[root#ip-172-xxxxx ~]# iptables -I OUTPUT -p tcp --dport 50031 -j ACCEPT
[root#ip-172-xxxxx ~]# iptables -I OUTPUT -p tcp --dport 61620 -j ACCEPT
iptables -L
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:61620
ACCEPT tcp -- anywhere anywhere tcp dpt:50031
ACCEPT tcp -- anywhere anywhere tcp dpt:ddi-tcp-1
Lucky!

Related

mongodb service cannot start

mongodb service cannot start with systemctl start mongodb.service, it would ask for a password. After then when I try mongo command, it throws :
MongoDB shell version v3.6.2
connecting to: mongodb://127.0.0.1:27017
2018-03-18T16:05:39.307+0700 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2018-03-18T16:05:39.307+0700 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:251:13
#(connect):1:6
exception: connect failed
I've been through all google page 1 solution but did nothing, also I try another query, but still again dont work for me, uninstall & install again also didnt work. My current OS distribution is Linux Manjaro.
Any help is appreciated.
Try this:
Type "Mongod" in the terminal to start MongoDB
and then open another terminal and type mongo to start the shell.
This works fine for me.
The connection refused error sounds like a firewall issue.
I would check the appropriate logs for the real reason. In Linux check /var/log/system or /bar/log/messages or other files in that location.
If it turns out firewall issue or /etc/hosts blocking, the allow/open the appropriate port in.
Update:
Opening firewall (iptables for MongoDB port). Type sudo before the following commands and put of where the request is coming from.
iptables -A INPUT -s <ip-address> -p tcp --destination-port 27017 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -d <ip-address> -p tcp --source-port 27017 -m state --state ESTABLISHED -j ACCEPT
**Background **
https://docs.mongodb.com/manual/tutorial/configure-linux-iptables-firewall/
Update 2: Add this additional rule to your firewall and type "sudo" in front of it : Outbound traffic must be accepted for the loopback (127.0.0.1) as well. credits go to: iptables blocking local connection to mongodb
iptables -A OUTPUT -o lo -j ACCEPT

MongoDB cannot connect from remote computer

I've installed MongoDB 3.6 on CentOS 7 and am able to connect to it locally:
# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
# mongo
MongoDB shell version v3.6.2
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.2
Welcome to the MongoDB shell.
...
>
My server IP address is 192.168.83.45, but I can't login to the MongoDB from the same server via the IP address instead of 127.0.0.1:
# ip addr | grep 'inet '
inet 127.0.0.1/8 scope host lo
inet 192.168.83.45/24 brd 192.168.83.255 scope global enp0s3
inet 10.0.3.15/24 brd 10.0.3.255 scope global dynamic enp0s8
# mongo --host 192.168.83.45
MongoDB shell version v3.6.2
connecting to: mongodb://192.168.83.45:27017/
2018-01-31T23:29:35.817-0500 W NETWORK [thread1] Failed to connect to 192.168.83.45:27017, in(checking socket for error after poll), reason: Connection refused
2018-01-31T23:29:35.818-0500 E QUERY [thread1] Error: couldn't connect to server 192.168.83.45:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:251:13
#(connect):1:6
exception: connect failed
I have checked the following:
iptables rules: appended (meanwhile my Apache HTTP server is not
blocked)
SELinux status: disabled
MongoDB IP bind: commented out
The check is shown below:
iptables (rule added):
# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:21
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:3000
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:27017
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
My Apache HTTP server works well on port 80 and is not blocked:
# curl http://192.168.83.45
<html>
<head>
<title>Hello World!</title>
</head>
<body>
Hello World!
</body>
</html>
SELinux (disabled):
# sestatus
SELinux status: disabled
mongod.conf (IPbind was commented out, and I clearly understand the risk of simply commenting out this line but this is a virtual machine and is under host only network so it's fine):
# cat /etc/mongod.conf
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log
# Where and how to store data.
storage:
dbPath: /var/lib/mongo
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# how the process runs
processManagement:
fork: true # fork and run in background
pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile
timeZoneInfo: /usr/share/zoneinfo
# network interfaces
net:
port: 27017
# bindIp: 127.0.0.1 # Listen to local interface only, comment to listen on all interfaces.
#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options
#auditLog:
#snmp:
I've not only restarted the services, but also restarted the whole computer, but it still doesn't work. I can neither access my MongoDB from the same computer but via the IP address, nor from a remote computer.
I tested one more thing and now I'm sure it has nothing to do with my firewall. I stopped the MongoDB, changed the default listening port of Apache HTTP server from 80 to 27017 and restarted. Now I can get the HTML document via 27017 port with IP address 192.168.83.45. So I think my firewall rule is OK. There must be something wrong with the MongoDB:
# curl 'http://192.168.83.45:27017'
<html>
<head>
<title>Hello World!</title>
</head>
<body>
Hello World!
</body>
</html>
Despite #Sridharan r.g's solution doesn't work, my resolution was inspired by his answer.
I was so close to the solution:
Change the "bindIp" value from "127.0.0.1" in /etc/mongod.conf AND KEEP TWO SPACES BEFORE THE "bindIp", like this:
...
# network interfaces
net:
port: 27017
bindIp: 0.0.0.0
...
Please note:
There must be exactly two spaces before "bindIp": neither too many
nor too few.
In the default file format of MongoDB 3.6, it doesn't use
"bind_ip = " but rather "bindIp:"
There MUST BE AT LEAST ONE SPACE between the colon after "bindIp"
and the IP address (here it is 0.0.0.0)
If you want to add more than one IP addresses, use comma to separate
each values, and KEEP AT LEAST ONE SPACE between the comma and the
next IP address.
The file format is a little bit tricky, check here the file format specification.
make sure that mongodb daemon is running, and listening on 0.0.0.0, but not 127.0.0.1 port
check the specify mongodb port is listing are not with help of netstat command
still you facing the problem change the
$ vim /etc/mongod.conf
/etc/mongod.conf
Listen to local, LAN and Public interfaces.
bind_ip = 127.0.0.1,192.168.161.100,45.56.65.100

cannot run node.js webservice on port 80 or 443

I have a VPS running CENTOS and I'm experimenting with Node.js.
I ran an example node.js server running correctly on various ports, but whenever I tried to run node on port 80 (same error for 443) I get the following error:
root#mic [~/Projects/NodeTutorial2]# node index.js
Server running on port 80.
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:883:11)
at Server._listen2 (net.js:1021:14)
at listen (net.js:1043:10)
at Server.listen (net.js:1109:5)
at Object.<anonymous> (/root/Projects/NodeTutorial2/index.js:8:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
I've tried to redirect port 80 to 3000 by doing:
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
Apparently I executed this command twice because:
when I did a: sudo iptables -t nat -L, it returned:
root#mic [~]# sudo iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 3000
REDIRECT tcp -- anywhere anywhere tcp dpt:http redir ports 3000
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
but to no avail, I still get the same error.
I tried to see what is running on port 80 with the netstat -tulpn | grep:80 command and it returns:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 477/httpd
tcp 0 0 :::80 :::* LISTEN 477/httpd
So I had killed the process running on port 80 and I got kicked off my VPS immediately.
What ports should I be running my node.js webservice?
According to my putty settings the port I'm accessing is port 22, so I don't understand what is going on there.
Additionally, I'm not planning to run my webservice as root.
I've created another user with less permissions that will run the node.js webservice.
Setup nodejs to use port 8000
install nginx and set it up as a reverse proxy for your nodejs app.
Don't use Apache, it creates a thread/process for every request, while nginx doesn't. It works similar to nodejs event loop where you have a queue of request that need to be processed and nginx worker processes take each request from the queue and process it - in your case send a request to nodejs server and then wait for the response.
And never use nodejs on port 80, there are just too many use-cases to handle and there is no need to reinvent the wheel

mongodb remote connection problems

I took several days trying to configure my environment running linux mongodb without results. This platform is running on AWS EC2.
mongodb is configured with auth=truecommented, and with port=27017
My problem is when I try to connect remotely (or even from the same machine), I got:
-bash-4.1# mongo myIP:27017/mybd
MongoDB shell version: 2.4.9
connecting to: myIP:27017/mybd
Wed Apr 2 20:57:28.250 Error: couldn't connect to server myIP:27017 at src/mongo/shell/mongo.js:147
exception: connect failed
But if I try with localhost:
-bash-4.1# mongo localhost:27017/mybd
MongoDB shell version: 2.4.9
connecting to: localhost:27017/mybd
>
Now more info:
-bash-4.1# netstat -a
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:27017 *:* LISTEN
tcp 0 0 *:28017 *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost:smtp *:* LISTEN
tcp 0 48 ip-10-187-41-156.ec2.in:ssh 186-79-194-159.baf.mo:55311 ESTABLISHED
tcp 0 0 *:ssh *:* LISTEN
-bash-4.1# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:27017
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:27017 state ESTABLISHED
And finally, I've made sure that the security group is right. I've opened 27017 and 28017 to anything from the outside with 0.0.0.0/0.
edit your /etc/mongod.conf
bind_ip = 0.0.0.0
that's it,now you can connect to your remote mongodb instance.

Not start play! application in Microsoft Azure on CentOS

I created a virtual machine CentOS.
Created end-point in the control panel on port 80 and 443. In CentOS added rules to iptables:
# Generated by iptables-save v1.4.7 on Thu Aug 9 18:07:49 2012
*filter
:INPUT ACCEPT [142:12032]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [146:18544]
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
COMMIT
# Completed on Thu Aug 9 18:07:49 2012
Run the application:
CompilerOracle: exclude jregex/Pretokenizer.next
Listening for transport dt_socket at address: 8000
18:07:05,799 INFO ~ Starting /srv/play-1.2.5/localevent
18:07:05,808 INFO ~ Module .svn is ignored, name starts with a dot
18:07:06,820 WARN ~ You're running Play! in DEV mode
18:07:06,975 INFO ~ Listening for HTTP at /127.0.0.1:80 (Waiting a first request to start) ...
I went to the address: *.сloudapp.net
But the application does not start. In what may be the reason?
#update1
SELinux is disabled. Version of CentOS - 6.2
#update2
For the test was installed Apache. Home Apache displayed.
Added proxy from 80 to 9000 port in httpd.conf. Play was launched at the 9000 port.
Apache returns a 503 error. Wget 127.0.0.1:9000 gets everything right.
AFAIK, you have to add an endpoint to your Azure virtual machine in order to allow to connect to the 80 TCP port.
For instance, see this doc, under the "Expose Redis to the outside" section, by setting your private and public ports to 80.
Looked logs Apache:
[error] (13) Permission denied: proxy: HTTP: attempt to connect to 127.0.0.1:9000 (127.0.0.1) failed
[error] ap_proxy_connect_backend disabling worker for (127.0.0.1)
Solution:
setsebool httpd_can_network_connect 1

Resources