New Linux experiences Too program open files

Source: Internet
Author: User
Tags openssh server arch linux

Recently, I need to run an Oracle BPM Enterprise for WebLogic Server VM for testing, and the operating system must be Linux x86, while my own machines are running x86_64.

Although Ubuntu and Oracle 10g XE are not supported Configurations Based on Configuration Matrix, the release is not a problem during testing. I 've been using Debian or Ubuntu for testing for a long time :-)

Environment:
OS: Ubuntu 8.10 Intrepid Ibex x86
Kernel: 2.6.27-7-generic
JDK: Sun JDK 1.6.0 _ 10
Weblogic Server 10gR3 on JRockit 1.6.0 _ 05 (R27.6.0-50 linux ia32)
Note: I am using the Oracle Service Bus 10gR3 installation media, including Weblogic Server 10gR3.
Oracle 10g XE for Debian/Ubuntu. deb package

Note: It is recommended to create a new user and target directory to install and run OBPM and WLS for security reasons.-) Of course, you can install sudo-s first, then, change the owner of the target directory and its sub-directories to the newly created user.

After installing Oracle Service Bus and Oracle BPM 10gR3
1. Start admin center with root
/Opt/OracleBPMwlHome/bin/./obpmadmcenter

2. Configure-Directory tab to add directory. For more information, see the official installation guide.

Generally, the configuration is automatically completed. Unlike earlier versions of 5.7, all Data Source, JMS modules, and Realm must be manually configured, and WAR/EAR must be manually deploy.

Unfortunately, the SS bar stops at 70% and is told to check the logs.

After reading the WLS and BPM Admin Center logs, we found the following Exception. The problem is obviously caused by the execution of WLST:
Java. io. FileNotFoundException:/opt/bea/user_projects/domains/bpm/config. xml (Too program open files)

The reason is very simple. Almost all Linux releases limit the maximum number of files (actually File Descriptors) that can be opened in the Terminal session based on security considerations. 1024 max open files is definitely not enough for WLS deployment ;-)

Note: For popular Release versions, for example, Debian/Ubuntu/Arch Linux/Gentoo's shell session limit is 1024.

Temporary solution:
Only applies to the current Terminal session. Use the following command to increase the value.
Ulimit-n 131072
Start obpmadmcenter in this session to configure directory and create a WLS domain to deploy bpm. If you select to modify an existing WLS domain, you must use the same method to add this value in the Terminal session of the startup script. Otherwise, most of them will get the same error.
Soft limit ulimit-
Hard limit ulimit-aH
It can be used to view various restrictions on the current session user, including modified values.


Permanent solution:
1. Modify/etc/security/limits. conf (root)
Add the following
$ User hard nofile 131072
$ User is the user used to start WLS.
2048 is the recommended value. If the same problem occurs, it may need to be increased again.

* Indicates all users:

* Soft nofile 131072
* Hard nofile 131072

Refer to the Recommended settings for Oracle Enterprise Linux:

Oracle hard nofile 131072
Oracle soft nofile 131072
Hard nproc 131072
Oracle soft nproc 131072
Oracle soft core unlimited
Oracle hard core unlimited
Oracle soft memlock 3500000
Oracle hard memlock 3500000
# Recommended stack hard limit 32 MB for oracle installations
# Oracle hard stack 32768

2. For other solutions from the official Debian GNU/Linux documents and Oracle Technology Network, directly modify kernel parameters without restarting the system.
Sysctl-w fs. file-max 65536
Or
Echo "65536" type = "codeph" text = "codeph">/proc/sys/fs/file-max
The two functions are the same. The former changes the kernel parameters, and the latter directly acts on the files corresponding to the kernel parameters in the Virtual file system (procfs, psuedo file system.
You can use the following command to view the new limits.
Sysctl-a | grep fs. file-max
Or
Cat/proc/sys/fs/file-max

Modify Kernel Parameters
/Etc/sysctl. conf
Echo "fs. file-max = 65536">/etc/sysctl. conf
Sysctl-p

View the current file handles usage:

Sysctl-a | grep fs. file-nr

Or

Cat/proc/sys/fs/file-nr
825 0 65536

Output Format: The number of allocated file handles, the number of free file handles, and the maximum number of file handles.

Another command:
Lsof | wc-l
What puzzles me a bit is that the results obtained by the above two commands are always different;-(the reason is as follows:
Put simply, file-nr provides File Descriptors (file descriptor, data structure, handle required by the program to Open the File), while lsof lists Open Files (Files ), including non-file descriptors. For example, the current directory is mapped to the library file in the memory and executable text files (scripts ?). Generally, lsof output is larger than file-nr.

For example, the number of files opened by Firefox in the current system:
Lsof-p pid | wc-l
Or
Lsof | grep pid | wc-l
Let's look at the number of file descriptors occupied by the pid of the process.
Ls/proc/pid/fd | wc-l
For more information, see/proc/pid/maps.

In addition, use sysctl to modify the Kernel Parameter fs. the difference between file-max and ulimit has taken a lot of time to study the concept and difference of Jockey, a Linux/FreeBSD/Solaris/OpenSolaris veteran.

Priority (Open File Descriptors ):
Soft limit

The Linux kernel provides the getrlimit and setrlimit system callto get and set resource limits per process. each resource has an associated soft and hard limit. the soft limit is the value that the kernel enforces for the corresponding resource. the hard limit acts as a ceiling for the soft limit: an unprivileged process may only set its soft limit to a value in the range from 0 up to the hard limit, and (irreversibly) lower its hard limit. A privileged process (one with the CAP_SYS_RESOURCE capability) may make arbitrary changes to either limit value.

As a test environment, especially in the form of VMWare guest OS, installing OpenSSH Server, webmin, phpsysinfo and other tools can improve efficiency.

Quick solutions for Oracle Enterprise Linux and Red Hat Enterprise Linux:
In addition, OEL and RHEL can directly install the oracle-validated package to solve the package dependency and system configuration problems required to install the Oracle database and middleware. We recommend that you!
Yum install oracle-validated
Or manually install it after the download.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.