NTP Server Not Working showing init on centos - amazon-ec2

I am trying to configure ntp server on centos 7 instead of ip address its showing INIT while executing ntpq -p command.
my ntp server configuration file.
/etc/ntp.conf
driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1
# Hosts on local network are less restricted.
Allow 10.0.3.0/24 network clients to syncronize time with this server
restrict 10.0.3.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 2.in.pool.ntp.org
server 1.asia.pool.ntp.org
server 3.asia.pool.ntp.org
includefile /etc/ntp/crypto/pw
keys /etc/ntp/keys
disable monitor
I have have following outputs while executing ntpq -q command
[centos#ip-10-0-3-53 etc]$ ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
ntp.your.org .INIT. 16 u - 128 0 0.000 0.000 0.000
ns3.weiszhostin .INIT. 16 u - 128 0 0.000 0.000 0.000
resolver2.skyfi .INIT. 16 u - 128 0 0.000 0.000 0.000
ntp2.wiktel.com .INIT. 16 u - 128 0 0.000 0.000 0.000
[spryiq#ip-10-0-3-53 etc]$
Port 123 is listening correctly
[centos#ip-10-0-3-53 etc]$ netstat -plnu | grep 123
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
udp 0 0 10.0.3.53:123 0.0.0.0:* -
udp 0 0 127.0.0.1:123 0.0.0.0:* -
udp 0 0 0.0.0.0:123 0.0.0.0:* -
udp6 0 0 fe80::10c9:ecff:fe9:123 :::* -
udp6 0 0 ::1:123 :::* -
udp6 0 0 :::123 :::* -
[centos#ip-10-0-3-53 etc]$ ntpstat
timeout
[centos#ip-10-0-3-53 etc]$ ntpq
ntpq> as
ind assid status conf reach auth condition last_event cnt
===========================================================
1 1255 8011 yes no none reject mobilize 1
2 1256 8011 yes no none reject mobilize 1
3 1257 8011 yes no none reject mobilize 1
4 1258 8011 yes no none reject mobilize 1
I have configured iptables correctly.instead of INIT it should display ip addresses How can i troubleshoot this problem??

Related

Storm nimbus incorrectly bind to localhost

Below is my config file:
storm.zookeeper.servers:
- "10.13.0.91"
- "10.13.0.93"
- "10.13.0.104"
nimbus.seeds: ["10.13.0.91", "10.13.0.93", "10.13.0.104"]
storm.local.dir: "/data1/storm/state"
storm.log.dir: "/data1/storm/log"
nimbus.childopts: "-Xmx2048m -XX:MaxPermSize=1024m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -verbose:gc -Xloggc:/data1/storm/log/gc-storm-nimbus.log"
worker.childopts: "-Xmx2048m -XX:MaxPermSize=1024m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -verbose:gc -Xloggc:/data1/storm/log/gc-storm-worker-%ID%.log"
supervisor.childopts: "-Xmx512m -XX:MaxPermSize=512m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -verbose:gc -Xloggc:/data1/storm/log/gc-storm-supervisor.log"
supervisor.slots.ports:
- 6700
- 6701
- 6702
- 6703
client.jartransformer.class: "org.apache.storm.hack.StormShadeTransformer"
When I run bin/storm nimbus on 10.13.0.91, I can see the nimbus progress bind to 10.13.0.91.
However, when I run the same command with same configuration
tcp 0 0 :::6627 :::* LISTEN 54981/java
tcp 0 0 ::ffff:127.0.0.1:6627 ::ffff:127.0.0.1:34507 ESTABLISHED 54981/java
tcp 0 0 ::ffff:10.13.0.93:46929 ::ffff:10.13.0.91:6627 ESTABLISHED 54981/java
tcp 0 0 ::ffff:10.13.0.93:53760 ::ffff:10.13.0.93:2181 ESTABLISHED 54981/java
tcp 0 0 ::ffff:127.0.0.1:34495 ::ffff:127.0.0.1:6627 ESTABLISHED 54981/java
tcp 0 0 ::ffff:10.13.0.93:46944 ::ffff:10.13.0.91:6627 ESTABLISHED 54981/java
tcp 0 0 ::ffff:10.13.0.93:20261 ::ffff:10.13.0.91:2181 ESTABLISHED 54981/java
tcp 0 0 ::ffff:10.13.0.93:20175 ::ffff:10.13.0.91:2181 ESTABLISHED 54981/java
tcp 0 0 ::ffff:10.13.0.93:26995 ::ffff:10.13.0.104:2181 ESTABLISHED 54981/java
tcp 0 0 ::ffff:10.13.0.93:46949 ::ffff:10.13.0.91:6627 ESTABLISHED 54981/java
tcp 0 0 ::ffff:10.13.0.93:26994 ::ffff:10.13.0.104:2181 ESTABLISHED 54981/java
tcp 0 0 ::ffff:127.0.0.1:6627 ::ffff:127.0.0.1:34495 ESTABLISHED 54981/java
tcp 0 0 ::ffff:127.0.0.1:34507 ::ffff:127.0.0.1:6627 ESTABLISHED 54981/java
Searched a long time on google but nothing help. Does any one meet the same issue before?
add this line in storm.yaml
storm.local.hostname: "your-host-name"
and put your-host-name in /etc/hosts and restart storm-nimbus

Starting multiple nodes do not allocate replica shards

So, I had just started out with Elasticsearch on my local machine.
I have started 5 instances of Elasticsearch nodes. (simple ./bin/elasticsearch)
curl -s 'localhost:9200/_cat/nodes?v' gives:
host ip heap.percent ram.percent load node.role master name
127.0.0.1 127.0.0.1 5 99 3.13 d m Shirow Ishihara
127.0.0.1 127.0.0.1 7 100 3.13 d m Madame Web
127.0.0.1 127.0.0.1 5 100 3.13 d m Anthropomorpho
127.0.0.1 127.0.0.1 5 100 3.13 d m Paste-Pot Pete
127.0.0.1 127.0.0.1 2 100 3.13 d * Mephisto
My index has 2 primary shards and 5 replicas (total 10 replicas).
I had read that ES automatically scales horizontally and assigns/moves shards to new nodes. However, still all the 10 replicas are unassigned and both the 2 primary shards are in the same node.
curl -s 'localhost:9200/_cat/allocation?v' gives:
shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
0 0b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Shirow Ishihara
0 0b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Paste-Pot Pete
2 318b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Mephisto
0 0b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Anthropomorpho
0 0b 105.5gb 6.2gb 111.8gb 94 127.0.0.1 127.0.0.1 Madame Web
10 UNASSIGNED
You have too few available disk space an ES is actually trying to move away some shards. But all your nodes are on the same machine so there is nowhere else where to move them and they stay unassigned. The used disk space is more than 90% of the total disk size and ES is hitting the the high watermark.
Read here more about this.

Vagrant VirtualBox Cisco AnyConnect routing issues with VPN

So I'm having what I believe is a common issue with Cisco AnyConnect and Vagrant/VirtualBox, i'm using host-only networking so that I can stand up a virtual server at an ip such as 10.10.10.11 and then I can map this in my /etc/hosts to :
# IP to hostname mapping
10.10.10.10 vagrant.dev
And then I can pull a webpage from curl vagrant.dev for example. Real standard stuff.
Things go awry when I connect to my work VPN which makes this nice little dev box kind of useless as I can no longer hit it by hostname or ip any longer. I can still do a vagrant ssh to the box but there is no other way to hit it.
I tried taking a look at the routing table and it appears that my pre-vbox route entry (netstat -rn):
Internet:
Destination Gateway Flags Refs Use Netif Expire
PreVPN
10.10.10/24 link#11 UCS 1 0 vboxnet
10.10.10.11 8:0:27:96:91:84 UHLWIi 1 70 vboxnet 1197
PostVPN
10.10.10/24 link#19 UCS 1 0 utun1
10.10.10.11 link#19 UHW3I 0 4 utun1 62
Route Flag Description
|PRE|POST| Flag Description |
|---|----|-----------------------------------------------|
| U | U | Route usable |
| H | H | Host entry (net otherwise) |
| L | | Valid protocol to link address translation |
| W | W | Route was generated as a result of cloning |
| | 3 | Protocol specified route flag #3 |
| I | I | Route is assocaited with an interface scope |
| i | | Route is a holding reference to the interface |
Question
Is it possible to restore the routes changed by VPN in order to make my vagrant connections work again? And if-so how?
Other Data
Full Route Table (PRE) (IP4 only)
Internet:
Destination Gateway Flags Refs Use Netif Expire
default 192.168.2.1 UGSc 23 1 en0
10.10.10/24 link#11 UCS 1 0 vboxnet
10.10.10.11 8:0:27:96:91:84 UHLWIi 1 70 vboxnet 1197
127 127.0.0.1 UCS 0 7 lo0
127.0.0.1 127.0.0.1 UH 11 128344 lo0
169.254 link#4 UCS 0 0 en0
192.168.2 link#4 UCS 0 0 en0
192.168.2.1 68:7f:74:81:8b:b0 UHLSr 27 126 en0
192.168.2.106/32 link#4 UCS 0 0 en0
Full Route Table (POST) (IP4 only)
Internet:
Destination Gateway Flags Refs Use Netif Expire
default link#19 UCS 9 0 utun1
default 192.168.2.1 UGScI 3 0 en0
10.10.10/24 link#19 UCS 1 0 utun1
10.10.10.11 link#19 UHW3I 0 4 utun1 62
17.158.10.25 link#19 UHW3I 0 1 utun1 62
17.158.10.42 link#19 UHW3I 0 20 utun1 62
17.158.10.46 link#19 UHW3I 0 1 utun1 62
127 127.0.0.1 UCS 0 7 lo0
127.0.0.1 127.0.0.1 UH 15 128507 lo0
128.29.154.114 link#19 UHWIi 31 117 utun1
129.83.20.9 link#19 UHW3I 0 20 utun1 61
129.83.26.209 link#19 UHWIi 2 2 utun1
129.83.100.38 link#19 UHW3I 0 46 utun1 62
169.254 link#19 UCS 0 0 utun1
172.31.160/19 link#19 UCS 0 0 utun1
172.31.163.172/32 127.0.0.1 UGSc 3 67 lo0
192.80.55.9/32 192.168.2.1 UGSc 1 0 en0
192.168.2 link#19 UCS 0 0 utun1
192.168.2.1 68:7f:74:81:8b:b0 UHLSr 7 8 en0
192.168.2.1/32 link#19 UCS 0 0 utun1
192.168.2.106/32 link#4 UCS 0 0 en0
216.58.217.132 link#19 UHW3I 0 2 utun1 59
239.255.255.250 link#19 UHmW3I 0 17 utun1 62
Components
OSX
Cisco Any Connect
VirtualBox 5.0.8
Unfortunately there is no fix for the issue, only work-around/help I could think of is after disconnecting the VPN, you could use "route -n add" to establish the connectivity back - at least by this way u could save whole reboot of machines.
Ex:
sudo route -n add -net 192.168.56.0/24 -interface vboxnet0
(Try this after disconnecting from VPN - This method wont work when VPN is on)
In your case, something like, "sudo route -n add -net 10.10.10.0/24 -interface vboxnet0" - depends on your subnet obviously !
Also please see Ticket #14293
When facing this exact same problem what worked for us is to change the address of the Vagrant box to 11.0.0.100

Cassandra is forcing to open CQL native port on ipv6 interface

I'm trying to connect to one of nodes of running instance of Cassandra servers. Nodetool shows that they synchronized well.
[root#cassandra1 ~]# /opt/dsc-cassandra-2.1.8/bin/nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 10.0.17.20 100.4 KB 256 100.0% rack1
UN 10.0.17.24 249.39 KB 256 100.0% rack1
When I run netstst -tulnap I can see following settings
tcp 0 0 127.0.0.1:44907 0.0.0.0:* LISTEN 4428/java
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 756/sshd
tcp 0 0 10.0.17.20:7000 0.0.0.0:* LISTEN 4428/java
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 842/master
tcp 0 0 127.0.0.1:7199 0.0.0.0:* LISTEN 4428/java
tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 744/snmpd
tcp 0 0 127.0.0.1:9160 0.0.0.0:* LISTEN 4428/java
tcp 0 0 10.0.17.20:7000 10.0.17.24:46314 ESTABLISHED 4428/java
tcp 0 0 10.0.17.20:43083 10.0.17.24:7000 ESTABLISHED 4428/java
tcp 0 0 10.0.17.20:22 10.0.17.50:53665 ESTABLISHED 4662/sshd
tcp 0 0 ::ffff:127.0.0.1:9042 :::* LISTEN 4428/java
tcp 0 0 :::22 :::* LISTEN 756/sshd
tcp 0 0 ::ffff:127.0.0.1:34705 ::ffff:127.0.0.1:44907 TIME_WAIT -
tcp 0 0 ::ffff:127.0.0.1:43039 ::ffff:127.0.0.1:7199 TIME_WAIT -
What tells that 7199 port used to syncing between nodes works in ipv4, ssh on ipv4/6 and the port I'm insterested in is only listening on ipv6 interface.
To enforce using ipv4, even when it is not nesecary I set flag listen_interface_prefer_ipf6: false
listen_address: 10.0.17.20
listen_interface_prefer_ipv6: false
org.apache.cassandra.auth.AllowAllInternodeAuthenticator
start_native_transport: true
native_transport_port: 9042
I don't know how to force Cassandra service to open 9042 port on ipv4.

SNMP hrStorageIndex may changed sometimes. How to identify a disk in SNMP?

hrStorageIndex and ifIndex may changed after reboot sometimes.
How to identify a specific disk and network interface in SNMP, both under Linux and windows?
There are columns for hrStorageDescr and hrStorageType in the HOST-RESOURCES-MIB::hrStorageTable table.
Here is an example ...
snmptable -M +. -m +ALL -v 2c -Ci -c public -Pu myhost HOST-RESOURCES-MIB::hrStorageTable
SNMP table: HOST-RESOURCES-MIB::hrStorageTable
index hrStorageIndex hrStorageType hrStorageDescr hrStorageAllocationUnits hrStorageSize hrStorageUsed hrStorageAllocationFailures
1 1 HOST-RESOURCES-TYPES::hrStorageRam Physical memory 1024 Bytes 8057980 7268792 ?
3 3 HOST-RESOURCES-TYPES::hrStorageVirtualMemory Virtual memory 1024 Bytes 18347124 7687064 ?
6 6 HOST-RESOURCES-TYPES::hrStorageOther Memory buffers 1024 Bytes 8057980 124288 ?
7 7 HOST-RESOURCES-TYPES::hrStorageOther Cached memory 1024 Bytes 2366160 2366160 ?
10 10 HOST-RESOURCES-TYPES::hrStorageVirtualMemory Swap space 1024 Bytes 10289144 418272 ?
31 31 HOST-RESOURCES-TYPES::hrStorageFixedDisk / 4096 Bytes 12901535 11461911 ?
35 35 HOST-RESOURCES-TYPES::hrStorageFixedDisk /dev/shm 4096 Bytes 1007247 0 ?
36 36 HOST-RESOURCES-TYPES::hrStorageFixedDisk /boot 1024 Bytes 495844 100151 ?
37 37 HOST-RESOURCES-TYPES::hrStorageFixedDisk /home 4096 Bytes 44531330 5981531 ?
Same principle for IF-MIB::ifTable which has a ifDescr column ...
snmptable -M +. -m +ALL -v 2c -Ci -c public -Pu myhost IF-MIB::ifTable
SNMP table: IF-MIB::ifTable
index ifIndex ifDescr ifType ifMtu ifSpeed ifPhysAddress ifAdminStatus ifOperStatus ifLastChange ifInOctets ifInUcastPkts ifInNUcastPkts ifInDiscards ifInErrors ifInUnknownProtos ifOutOctets ifOutUcastPkts ifOutNUcastPkts ifOutDiscards ifOutErrors ifOutQLen ifSpecific
1 1 lo softwareLoopback 16436 10000000 up up 0:0:00:00.00 723382401 729363414 0 0 0 0 723382401 729363414 0 0 0 0 SNMPv2-SMI::zeroDotZero
2 2 eth0 ethernetCsmacd 1500 1000000000 0:21:5e:4d:15:b7 up up 0:0:00:00.00 1030103587 37542077 3449194 0 0 0 1570760541 32130390 0 0 0 0 SNMPv2-SMI::zeroDotZero
3 3 eth1 ethernetCsmacd 1500 0 0:21:5e:4d:15:b8 down down 0:0:00:00.00 0 0 0 0 0 0 0 0 0 0 0 0 SNMPv2-SMI::zeroDotZero

Resources