Max hostname length?


(Chrispomeroy) #1

Hi,

I found a possible bug whereby Elasticsearch won't start (results in "Failed!" when starting the daemon using Debian) if the hostname is greater than approximately 26 letters.

Does this seem possible?

I'm creating 3-node clusters of the following hostname combinations, and below I've listed where the server will start or won't.

(#=single digit node number e.g. 1,2,3)

elasticsearch-#-vm works
elasticsearch-2-elasticsearch-#-vm fails
elasticsearch-3-elasticsearch-#-vm fails
e2lasticsearch-#-vm works
elasticsearchelasticsearch-#-vm fails
elasti-#-vm works


(David Pilato) #2

Hey Chris!

Do you get any error message or stacktrace?


(Chrispomeroy) #3

Hi David!

I get the elusive "Failed!" message when service elasticsearch start is run on any instance in the cluster if the yml file includes 3 "long" hostnames in the zen.hosts string.

Just to make sure I'm using zen.hosts correctly, using the example elasticsearch1-elasticsearch-#-vm, I would put the following in the yml file:

discovery.zen.ping.unicast.hosts: ["elasticsearch1-elasticsearch-1-vm", "elasticsearch1-elasticsearch-2-vm", "elasticsearch1-elasticsearch-3-vm"]

I am NOT listing port numbers. I didn't before and never had an issue.

I have no problems starting elasticsearch when the hostname is short and /_cluster/health shows 3 data nodes with a green status.

I do not get any error logs entries in the log files in /var/log/elasticsearch/*

To give you some more background, I'm updating the click to deploy feature on the Google Console and we now support multiple deployments per project. As a result we ask the user for a deployment name and autopopulate the name elasticsearchn. We insert the deployment name as a prefix to the instance name to avoid instance name conflicts. Therefore the deployment name elasticsearch1 will create the following instances:

elasticsearch1-elasticsearch-1-vm
elasticsearch1-elasticsearch-2-vm
elasticsearch1-elasticsearch-3-vm.

This has never been an issue with the current click to deploy version because we capped instance names to about ~20 characters and there was no prefix. this is what's leading me to think the hostname needs to be shorter.

Let me know if I can help clarify further.


(Mark Walkom) #4

I don't think this is an ES problem, I was able to start a node with the name elasticsearch1-elasticsearch-1-vm without problems.

Is there anything in /var/log/syslog or /var/log/daemon or /var/log/upstart?


(Chrispomeroy) #5

syslog:

Aug 26 06:29:06 elasticsearchelasticsearch-1-vm rsyslogd-2177: imuxsock begins to drop messages from pid 2554 due to rate-limiting
Aug 26 06:29:06 elasticsearchelasticsearch-1-vm safe_format_and_mount: Running: mount -o discard,defaults /dev/disk/by-id/google-elasticsearchelasticsearch-1-vm-data /elasticsearch
Aug 26 06:29:06 elasticsearchelasticsearch-1-vm kernel: [ 24.347134] EXT4-fs (sdb): mounted filesystem with ordered data mode. Opts: discard
Aug 26 06:30:03 elasticsearchelasticsearch-1-vm dbus[2057]: [system] Activating service name='org.freedesktop.ConsoleKit' (using servicehelper)
Aug 26 06:30:04 elasticsearchelasticsearch-1-vm dbus[2057]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Aug 26 06:30:04 elasticsearchelasticsearch-1-vm polkitd[3104]: started daemon version 0.105 using authority implementation local' version0.105'
Aug 26 06:30:04 elasticsearchelasticsearch-1-vm dbus[2057]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Aug 26 06:30:04 elasticsearchelasticsearch-1-vm dbus[2057]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'

cpomeroy@elasticsearchelasticsearch-1-vm:~$ cat /var/log/daemon
cat: /var/log/daemon: No such file or directory

cpomeroy@elasticsearchelasticsearch-1-vm:~$ cat /var/log/upstart
cat: /var/log/upstart: No such file or directory


(Chrispomeroy) #6

I added some functionality to convert the hostnames into internal IPs for the yml config file.

Funny thing is the original problem still continues...

If I use short instance names like:
elasti-1-vm, elasti-2-vm, elasti-3-vm

or

ela-1-vm, ela-2-vm, ela-3-vm

it works fine,

but if I try

elasticsearchelasticsearch-1-vm, elasticsearchelasticsearch-2-vm, elasticsearchelasticsearch-3-vm

elasticsearch doesn't start up and the deployment fails.

Might need to think if there's anything else going on in my environment that might cause this.


(system) #7