/srv/irclogs.ubuntu.com/2016/10/02/#ubuntu-server.txt

lunaphytehi.  i have a 16.04 computer that includes an nfs mount in fstab.  sometimes, the network sucks, and during boot, the share fails to mount.  there is a long, long, timeout when this happens.  how can i change this timeout?00:16
pmp6nlHi, I just installed a new server and I am trying to figure out the best way I can find a directory via the ip address. For example I setup siteabc.com, but I need to access it via the ip address (I havent set up dns yet). I have several sites on the server. Any idea.01:16
pmp6nlTHanks01:17
JanCpmp6nl: you can temporarily(!) add the domain to your local /etc/hosts01:45
eagleeyesWhat command can be used to reconfigure network after an install and bring eth0 up for dhcp req?05:44
Gorianeagleeyes, not sure, but you can manually edit the config file07:49
Gorianhttps://help.ubuntu.com/lts/serverguide/network-configuration.html07:49
Goriannano /etc/network/interfaces07:50
eagleeyesI did it manually but can't ping out.07:50
Gorianthen add "auto eth0" and "iface eth0 inet dhcp"07:50
Goriandid you reset the interfaces?07:51
Gorianwell, I guess, where are you in the "doing it manually" process?07:51
Goriando you have an IP via DHCP? Or you just configured the interface/edited the file?07:51
=== m1dnight1 is now known as m1dnight_
txwizardhello09:33
pterodactylI just disabled ipv6 on my ubuntu xenial server from systemctl and restarted my networking service. I also reloaded systemctl from default file(systemctl -p) but netstat shows that services are still listening on ipv6. How do I stop them?11:03
Ben64pterodactyl: why11:03
pterodactylI'm not using ipv6 at this time and open ports just scares me no matter even if the service on it is not vulnerable. So just want to stop them.11:04
andolpterodactyl: Those services netstat says are listening on IPv6, is that "::" showing up?11:06
pterodactylyup11:06
andolpterodactyl: That being what most services uses to combine all-ipv4 and all-ipv6 by default. Unless you actually have an (global) IPv6 address configured, that doesn't matter.11:07
Ben64weird to disable ipv6 too, it's the future of the internet11:07
andolpterodactyl: If that is still something you want to fix for some odd reason then that has to be fixed on an application basis, by configuring them to explicit bind to 0.0.0.0 or something.11:08
andolpterodactyl: Yet, if you want an extra safety belt it might be easier just to use ip6tables to REJECT all.11:08
andolAside from that I agree with Ben64.11:09
andolWhy not simple also use IPv6? Why would you assume that your applications would be more vulnerable across IPv6 than across IPv4?11:09
pterodactylandol : It's not that I assume so. Looking at open ports just give me a creepy feeling. So I thought I'd just disable them. Anyway I guess I'll just leave them running.11:11
Ben64but the same ports are open on ipv4...11:12
andolpterodactyl: Or you could find some other way to deal with that anxiety, and get on the IPv6 train? :)11:12
Ben64toot toot, here comes the cure for running out of IPs11:13
pterodactylandol and Ben64 : Guess I have to agree with you guys.11:13
andolGood :-)11:14
pterodactylThanks guys. :)11:25
pterodactylGotta go.11:25
=== JanC is now known as Guest35633
=== JanC_ is now known as JanC
=== nick1 is now known as Guest37389
m0ltarHi! Does anyone know how to set the hard "file open limit" systemwide?  I have mongo that is using almost a million open files ... stupid mongo. and it is crashing because the limit is too low, but whatever i try to raise it has no effect21:28
Walexm0ltar: yes.21:34
m0ltarWalex: good21:36
Walexm0ltar: b ut it is not necessary. 'ulimit' values are inherited like evn vars.21:37
Walexm0ltar: so just set in the script that start Mongo.21:37
m0ltarWalex: system uses systemd21:37
m0ltarwhich had the upper limit set to 1 millin21:37
Walexm0ltar: BTW Mongo should not be opening a million files or something like that. That probably needs fixing.21:37
m0ltaryet mongod still didnt start21:38
m0ltarWalex: yes, agreed. But cannot fix it all at once.21:38
m0ltarFor now I need to get it running21:38
m0ltarThen delete some collections21:38
Walexm0ltar: there is also a systemwide limit I think but not sure.21:38
m0ltarWalex: sure, and I set it high, yet still no cigar21:38
Walexm0ltar: you can check the actual limit with 'cat /proc/$PID/limits'21:39
m0ltarIt's set to 6553621:39
Walexm0ltar: or after you set 'ulimit -n ....' use 'ulimit -H -a'21:39
m0ltarWalex: yeah I did all that21:40
Walexman ulimit21:40
m0ltar$pid/limits shows 65536, yet mongo actually has almost million files open21:40
m0ltarverified via "lsof | grep mongod | wc -l"21:40
m0ltarbut i'm running it as root now, so maybe that does not pay attention to limits21:40
Walexm0ltar: that is unlikely21:40
m0ltarit works as root, but dies as mongodb21:41
m0ltarlsof | grep mongod | wc -l -- now reports 118880921:41
m0ltarcrazyness21:41
Walexm0ltar: 'root' can *raise* limits, but not ignore them21:41
m0ltarok well, i have no other explanations :)21:41
m0ltarcat /proc/2690/limits | grep "Max open files"   --- Max open files            65536                65536                files21:42
m0ltarulimit -n -H  ---- 6553621:42
m0ltarlsof | grep mongod | wc -l     ---   118880921:42
Walexto check again 'ls /proc/$PID/fd/ | wc -l21:42
Walexto check again 'ls /proc/$PID/fd/ | wc -l'21:42
Walexto check again 'ls /proc/$PID/fd/ | wc -l' gives you number of file descriptors21:43
m0ltar /fd count is 210721:44
Walexm0ltar: note that 'lsof' also lists mapped segments21:45
m0ltarah ok21:45
m0ltarso actual files open is 2107? then why the hell does mongo complain about not having enough21:45
Walexm0ltar: probably MongoDB has got 1 million 'malloc' segments21:45
m0ltarUnknownError: 24: Too many open files21:46
Walexm0ltar: sometimes error codes are reused for "similar" situations21:46
Walexm0ltar: it is likely that it has run out of memory mappings21:46
m0ltarhm21:46
m0ltarwhen running under root it does seem to use a lot of memory -- in fact all of it21:47
m0ltarand half of used memory also is as swap form21:47
Walexm0ltar: I haven't used Mongo for a while, but I remember that there was  an issue related to that, perhaps the log21:47
m0ltardammit things with mongo are worse than I thought21:47
Walexm0ltar: Mongo is not very "reliable" let's say./21:48
m0ltari agree, and we are moving away from it very fast21:48
m0ltarjust havent really done it fully yet21:48
Walexm0ltar: also it is subject to a rolling-release model, so bug fixes usually don't get backported21:48
m0ltarI was installing from their own repo21:49
m0ltarlatest version21:49
Walexm0ltar: I can look at my notes if you will around to see what kind of similar issue I was having.21:49
m0ltarWalex: that would be great! Thanks21:49
Walexm0ltar: in my case it was an old iussue, but I'll have a look. Not sure I put down a note.21:49
m0ltarI'm surprised it works under root user though21:50
m0ltarif it doesnt have enough mem, then how come it still works21:50
m0ltarmust be some kind of limit too21:50
m0ltarulimit output is the same for root and mongodb user21:51
Walexm0ltar: in the meantime try 'lsof -p $PID | less' to see what is being mapped 1 million times21:53
m0ltarI did do that, but there are a million records, so how do you even review that :D21:53
Walexm0ltar: you just scroll a bit, and if there are a million entries probably they are all similar21:54
m0ltarActually that output only gives me 2129 lines21:55
m0ltarbut if I don't include the pid and grep for mongod in the output, i get millions of lines'21:55
Walexm0ltar: then it is something else...21:55
Walexm0ltar: lsof | sed 's/ .*//' | sort | uniq -c | sort -n | tail -2021:56
m0ltarit seems like it is spawning too many children21:58
Walexm0ltar: then probably the children die and it loops21:59
m0ltari'm scrolling through the list manually and i see the same files over and over, and the PID in the third column goes up by21:59
m0ltar121:59
Walexm0ltar: tryu to 'strace' one of them.21:59
m0ltardont really know how to strace22:00
m0ltari attached to the process, but then don't know what to do22:01
Walexm0ltar: ahhh I remember what was my issue, that the DB files grew enormously because of many transactioons.22:01
Walexm0ltar: you can run something like 'strace -p $PID' and see what comes out22:01
m0ltarProcess 2691 attached22:01
m0ltarrt_sigtimedwait([HUP INT USR1 TERM XCPU], NULL, NULL, 822:01
m0ltarthat's all that came out22:02
m0ltarbut that process is not even live22:02
Walexm0ltar: uhhhh that means they are hanging.22:02
m0ltarif i do ps aux there is no process with that pid22:02
Walexm0ltar: it is a thread most likely22:02
m0ltaryeah22:02
m0ltarso every thread then holds a file open22:02
Walexm0ltar: try 'pmap -p 2691'22:03
m0ltaror are file handles inherited ?22:03
Walexm0ltar: file handles are inherited and shared.22:03
m0ltarok that gave me a lot of output22:03
m0ltarok then counting lsof output is irrelevant22:03
m0ltarour db is def huge though... its 311 GB now :/22:04
Walexm0ltar: have you looked at 'dmesg | trail -50'22:04
Walexm0ltar: have you looked at 'dmesg | tail -50'22:04
Walexm0ltar: also at 'tail -50 /var/log/syslog'22:04
m0ltardmesg tail gives me lots of info22:04
m0ltarbut no idea what it all means22:05
Walexm0ltar: if there is a resource shortage it should affects other daemons22:05
m0ltarthere are no other daemons22:05
Walexm0ltar: don't joke...22:05
m0ltar:D22:06
m0ltarwell no other meaningful ones22:06
Walexm0ltar: also just to be sure look at /proc/meminfo and the top lines of 'slabtop'22:06
Walexm0ltar: the non-meaningful ones are likely to be affected too if there is something badly broken22:07
m0ltaryou wont believe this...22:08
m0ltarthis is so fucking idiotic22:08
m0ltarthis boggles my mind22:09
m0ltarthe service file that came with mongo (/lib/systemd/system/mongod.service)22:09
m0ltarhad limits set22:09
m0ltarIt read: LimitNOFILE=64000 # number of open files22:09
m0ltarsyslog said22:10
m0ltarlimits ignored "64000 # number of open files" is not a valid value...22:10
Walexm0ltar: yes, but that should be plenty22:10
m0ltarW.T.F.22:10
m0ltarit was treating the whole thing as a limit with the comment22:10
Walexahhhh funny22:10
m0ltarso questions arise22:10
m0ltarwhy systemd is not parsing out comments22:10
m0ltarand 2) why mongod is shipped with shitty systemd file22:10
m0ltarin fact, i think systemd unit files are ini files, and you are supposed to use ";" for cmments22:11
m0ltarpossibly # also works, dont know, but i've been always using ; because of windows days & ini files ;)22:11
Walexm0ltar: the problem currently is understanding why there are very many MongoDB threads.22:11
m0ltarwell, it is kind of expected, because its heavily used22:11
m0ltarmutiple  servers connect inside multiple threads22:11
Walexm0ltar: try 'top' and then "H" to show threads22:12
m0ltar1-5 mongod processes22:13
Walexm0ltar: there are must a lot of threads, scroll down until you see them22:13
m0ltaroh ya there are quite a bit22:13
Walexm0ltar: they are all mongod22:13
m0ltaryeah22:14
Walexor something else?22:14
m0ltarnah mostly mongod22:14
Walexm0ltar: I just did a web search for the string "UnknownError: 24: Too many open files22:15
Walexm0ltar: there are some entries22:15
m0ltari did search that too22:15
m0ltarnothing good came out of it :)22:15
m0ltarbasically my understanding is that mongod in the latest version keeps 2 FH for each collection22:16
m0ltarwe have 2000+ collections, so its 4000 FH22:16
m0ltarbut the threads... i am not sure.22:16
m0ltarmost likely it's a thread per connection22:16
m0ltarit currently has 469 connections22:17
m0ltarso that kind of adds up22:17
Walexm0ltar: 469 connections is not that huge.22:19
m0ltarsure, but I think it spawns a new thread per connections, that's why there are so many threads22:19
m0ltarby scrolling thru top it does look like ~ 500 threads22:19
m0ltarso it kinda makes sense22:19
Walexm0ltar: yes, but 469 connections should not be causing resource issues like too many FDs open22:19
m0ltarWalex: I think the issue was that because systemd.service file setting was simply ignored, it was falling back to some default setting22:20
Walexm0ltar: using KDE etc. on my laptop I have 350 processes...22:20
m0ltarwhich was low I am guessing. Altho ulimit was reporting 64k22:20
m0ltaror worse, maybe, because systemd setting was bad, it was defaulted to "null" or 022:21
m0ltarand thereby even 1 FD would be too many22:21
m0ltarsurprisingly mongod has no "issues" tab https://github.com/mongodb/mongo22:22
m0ltarweird22:22
m0ltaroh remember, they were using jira22:22
m0ltarweirdos :/22:22
Walexm0ltar: the default is IIRC 102422:22
m0ltarWalex, well, that would definitely not be enough22:22
m0ltarbecause i read it uses 2 FD per collection22:22
m0ltarand we have 2000+ collections22:23
Walexm0ltar: that's fairly brave...22:23
m0ltarWalex, buddy, you were so helpful. Thanks! Give me your Paypal address I will send you some beer money :D22:23
Walexm0ltar: don't worry.22:23
m0ltarOr bitcoin or whatever, altho I think I don't have many coins left in the wallet22:23
m0ltarI am not worried... just want to share the love the only way I can virtually22:23
Walexm0ltar: so 500 threads maybe each with 2,000 memory mapping, you get 1,000,000 mappings listed by 'lsof'22:24
m0ltarif you have an amazon wish list, let me know i'll buy you something nice22:24
m0ltaryeah it about adds up doesnt it?22:24
m0ltarfuck, what was supposed to be a simple *minor* upgrade turned out to some stressful shit hahaha22:24
Walexm0ltar: been there many times... I had to maintain an old versions of MongoDB used for Juju for OpenStack, and the whole was quite unreliable, lots of race conditions, had to hand-edit the collections a few times.22:26
Walexm0ltar: BTW the manual page on limits and mongodb does not have the comment error: https://docs.mongodb.com/manual/reference/ulimit/#recommended-ulimit-settings22:27
Walexm0ltar: it shows for 'upstart' the comment same line, but for 'systemd' the comments are all previous line.22:27
Walexm0ltar: the people at Mongo that packaged it did not read their own docs :-)22:28
m0ltarWalex: this was actually out of the repo!22:28
m0ltarhttps://github.com/mongodb/mongo/commit/906a6f057f87fb4e51c4a698d9d6fe490fb293a2#diff-53ff8b2b2fd0259e92e2de365e2c4e2722:28
m0ltarI found the broken commit and commented on it22:28
m0ltarNot gonan open a jira account for this22:28
=== van778 is now known as van777

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!