I have a hadoop cluster we assuming is performing pretty "bad". The nodes are pretty beefy.. 24 cores, 60+G RAM ..etc. And we are wondering if there are some basic linux/hadoop default configuration that prevent hadoop from fully utilizing our hardware.
There is a post here that described a few possibilities that I think might be true.
I tried logging in the namenode as root, hdfs and also myself and trying to see the output of lsof and also the setting of ulimit. Here are the output, can anyone help me understand why the setting doesn't match with the open files number.
For example, when I logged in as root. The lsof looks like this:
[root#box ~]# lsof | awk '{print $3}' | sort | uniq -c | sort -nr
7256 cloudera-scm
3910 root
2173 oracle
1886 hbase
1575 hue
1180 hive
801 mapred
470 oozie
427 yarn
418 hdfs
244 oragrid
241 zookeeper
94 postfix
87 httpfs
...
But when I check out the ulimit output, it looks like this:
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 806018
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 1024
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
I am assuming, there should be no more than 1024 files opened by one user, however, when you look at the output of lsof, there are 7000+ files opened by one user, can anyone help explain what is going on here?
Correct me if I had made any mistake understanding the relation between ulimit and lsof.
Many thanks!
You need to check limits for the process. It may be different from your shell session:
Ex:
[root#ADWEB_HAPROXY3 ~]# cat /proc/$(pidof haproxy)/limits | grep open
Max open files 65536 65536 files
[root#ADWEB_HAPROXY3 ~]# ulimit -n
4096
In my case haproxy has a directive on its config file to change maximum open files, there should be something for hadoop as well
I had a very similar issue, which caused one of the claster's YARN TimeLine server to stop due to reaching magical 1024 files limit and crashing with "too many open files" errors.
After some investigation it came out that it had some serious issues with dealing with too many files in TimeLine's LevelDB. For some reason YARN ignored yarn.timeline-service.entity-group-fs-store.retain-seconds setting (by default it's set to 7 days, 604800ms). We had LevelDB files dating back for over a month.
What seriously helped was applying a fix described in here: https://community.hortonworks.com/articles/48735/application-timeline-server-manage-the-size-of-the.html
Basically, there are a couple of options I tried:
Shrink TTL (time to live) settings First enable TTL:
<property>
<description>Enable age off of timeline store data.</description>
<name>yarn.timeline-service.ttl-enable</name>
<value>true</value>
</property>
Then set yarn.timeline-service.ttl-ms (set it to some low settings for a period of time):
\
<property>
<description>Time to live for timeline store data in milliseconds.</description>
<name>yarn.timeline-service.ttl-ms</name>
<value>604800000</value>
</property>
Second option, as described, is to stop TimeLine server, delete the whole LevelDB and restart the server. This will start the ATS database from scratch. Works fine if you failed with any other options.
To do it, find the database location from yarn.timeline-service.leveldb-timeline-store.path, back it up and remove all subfolders from it. This operation will require root access to the server where TimeLine is located.
Hope it helps.
Related
I'm trying to set up a git repository that contains a laravel project on a server that uses cpanel. After copy missing libraries and dependencias from both composer.json and package.json the project asks me to run npm run dev in order to create the mix manifest file. However, whenever I enter those commands this error keeps coming up:
> # dev /home3/regioye5/repositorios/region-admin
> npm run development
> # development /home3/regioye5/repositorios/region-admin
> mix
node[474]: ../src/node_platform.cc:61:std::unique_ptr<long unsigned int> node::WorkerThreadsTaskRunner::DelayedTaskScheduler::Start(): Assertion `(0) == (uv_thread_create(t.get(), start_thread, this))' failed.
1: 0xa04200 node::Abort() [node]
2: 0xa0427e [node]
3: 0xa7429e [node]
4: 0xa74366 node::NodePlatform::NodePlatform(int, v8::TracingController*) [node]
5: 0x9d1ae6 node::InitializeOncePerProcess(int, char**) [node]
6: 0x9d1d21 node::Start(int, char**) [node]
7: 0x7fbfeb70d555 __libc_start_main [/lib64/libc.so.6]
8: 0x9694cc [node]
Aborted
I've been looking for an answer on internet but nobody seems to have had this issue before. I rean in other posts that may be the job processes or something like that, I share to you the ulimited -a command result on server:
core file size (blocks, -c) 0
data seg size (kbytes, -d) 800000
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 178728
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) 800000
open files (-n) 100
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 15240
cpu time (seconds, -t) unlimited
max user processes (-u) 25
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
I visited laravel mix documentation and I found the following command. For me it worked like a charm!
node_modules/.bin/webpack --config=node_modules/laravel-mix/setup/webpack.config.js
It appears it goes straight to the library and asks it to config the file that contains the mix variables. Hope it works for you.
I manage a small fully distributed hadoop cluster and I was doing my routine cleanup of logs and inspection. I see a bunch of files with the .out extension in the {HADOOP_HOME}/logs path that I configured. There are several such as:
hadoop-<my-system-name>-namenode-<my-system-name>.out
hadoop-<my-system-name>-namenode-<my-system-name>.out.1
hadoop-<my-system-name>-namenode-<my-system-name>.out.2
hadoop-<my-system-name>-datanode-<my-system-name>.out
hadoop-<my-system-name>-historyserver-<my-system-name>.out
hadoop-<my-system-name>-historyserver-<my-system-name>.out.2
hadoop-<my-system-name>-historyserver-<my-system-name>.out.3
hadoop-<my-system-name>-resourcemanager-<my-system-name>.out
hadoop-<my-system-name>-resourcemanager-<my-system-name>.out.1
hadoop-<my-system-name>-secondarynamenode-<my-system-name>.out
hadoop-<my-system-name>-secondarynamenode-<my-system-name>.out.1
hadoop-<my-system-name>-secondarynamenode-<my-system-name>.out.2
etc. etc. etc.
When I look at one of them with an editor, such as the hadoop-<my-system-name>-namenode-<my-system-name>.out.1 file, I get:
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 514997
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 16384
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 8092
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
What are these files? Do they serve a purpose to keep or can they be deleted?
Like all good applications, logs serve a great purpose - finding out what is happening with your service. You should probably be putting the logs into something like Elasticsearch/Solr/Graylog/etc to search/alert on them
Anything that ends in a number can be safely deleted.
They are managed by the log4j.properties RollingFileAppender that is started with Hadoop.
When I start elasticseach, I am getting this Warning:
[2018-08-05T15:04:27,370][WARN ][o.e.b.BootstrapChecks ] [bDyfvVI] max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
I have set the needed value to 65536 as running through this tutorial https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html. I have also tried these steps:
Check ulimit -n, it would be 4096.
Edit /etc/security/limits.conf and add following lines:
* soft nofile 65536
* hard nofile 65536
root soft nofile 65536
root hard nofile 65536
Edit /etc/pam.d/common-session and add this line session required pam_limits.so
Edit /etc/pam.d/common-session-noninteractive and add this line session required pam_limits.so
Reload session and check for ulimit -n, it would be 65536.
Unfortunately I am still getting this warning. Can someone help me why?
We've raised the MAX_OPEN_FILES set to 1024000 by changing the value in
/etc/default/elasticsearch
More information here:
https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html
Elasticsearch uses a lot of file descriptors or file handles. Running out of file descriptors can be disastrous and will most probably lead to data loss. Make sure to increase the limit on the number of open files descriptors for the user running Elasticsearch to 65,536 or higher.
For the .zip and .tar.gz packages, set ulimit -n 65535 as root before starting Elasticsearch, or set nofile to 65535 in /etc/security/limits.conf.
On macOS, you must also pass the JVM option -XX:-MaxFDLimit to Elasticsearch in order for it to make use of the higher file descriptor limit.
RPM and Debian packages already default the maximum number of file descriptors to 65535 and do not require further configuration.
You can check the max_file_descriptors configured for each node using the Nodes Stats API, with:
GET _nodes/stats/process?filter_path=**.max_file_descriptors
I have plain vanilla CouchDB from Apache, which runs as an App running on a Mac OS X 10.9. If I try to attach an attachment to a document that is above 1 Meg in size, it just hangs and does nothing.
I have tried to use couchdbs on Linux, and there the sky is the limit.
I first thought it had to do with low limits on the mac but it doesn't seem so :
➜ ~ ulimit -a
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 8192
-c: core file size (blocks) 0
-v: address space (kbytes) unlimited
-l: locked-in-memory size (kbytes) unlimited
-u: processes 709
-n: file descriptors 256
What is causing this ? Why ? And how to fix this ?
Check the config files given by couchdb -c. You probably have this somewhere in them (for some unknown reason):
[couchdb]
max_attachment_size = 1048576 ; bytes
Remove or comment the line and you should be fine.
Or maybe it was compiled with this hardcoded so you could add this line to one of the config file and increase the value.
Update
max_attachment_size is undocumented so probably not safe to use. I leave the original answer as it seems to have solved the problem of the OP but according to the docs, the attachment size should be unlimited. Also attachment_stream_buffer_size is the config key controlling the chunk size of the attachments which might relevant.
It seems like I always get this error on one of my scripts:
/Users/amosng/.rvm/gems/ruby-1.9.3-p194/gems/ruby-prof-0.11.2/lib/ruby-prof/profile.rb:25: stack level too deep (SystemStackError)
Has anyone encountered this error before? What could be causing it, and what can I be doing to prevent it from happening?
I run my ruby-prof scripts using the command
ruby-prof --printer=graph --file=profile.txt scraper.rb -- "fall 2012"
Edit I'm on Mac OS X, if that matters. Doing ulimit -s 64000 doesn't seem to help much, unfortunately. Here is what ulimit -a gives:
$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 256
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 64000
cpu time (seconds, -t) unlimited
max user processes (-u) 709
virtual memory (kbytes, -v) unlimited
Edit 2
Andrew Grimm's solution worked just fine to prevent ruby-prof from crashing, but the profiler seems to have problems of its own, because I see percentages like 679.50% of total time taken for a process...
One workaround would be to turn tail call optimization on.
The following is an example of something that works with TCO on, but doesn't work when TCO is off.
RubyVM::InstructionSequence.compile_option = {
:tailcall_optimization => true,
:trace_instruction => false
}
def countUpTo(current, final)
puts current
return nil if current == final
countUpTo(current+1, final)
end
countUpTo(1, 10_000)
Stack level too deep usually means an infinite loop. If you look at the ruby-prof code where the error happens you will see that it's a method that detects recursion in the call stack.
Try looking into the code where you are using recursion (how many places in your code can you be using recursion?) and see if there is a condition that would cause it to never bottom-out?
It could also mean that your system stack just isn't big enough to handle what you are trying to do. Maybe you are processing a large data set recursively? You can check your stack size (unixy systems):
$ ulimit -a
and increase the stack size:
$ ulimit -s 16384
You can also consider adjusting your algorithm. See this stack overflow quesion
I hope I'm not just re-hashing an existing question...
Having percentages go over 100% in Ruby-prof has been a known bug, but should be fixed now.