Java image processing optimized tuning of the Linux geoserver (JAI and ImageIO native and java default library interchangeable)

Note: geoserver version of Linux geoserver2.15.0 installation: bin installed (embedded jetty, non-war installation)
 
One. Tuning of the image processing optimization geoserver Java
 
1. Native JAI and ImageIO
GeoServer image processing functions that use Java JAI and JAI ImageIO function, but because of the JAI and JAI ImageIO Java library implemented in Java by default, if it replaced the native library can significantly improve the image processing speed. Note that only the 32-bit Java environment is available in windows, 64-bit Java environment is unavailable native library. Operation and download the library file copy native reference to the following codes:
 
cd /tmp
# Unzip
gunzip -c jai-1_1_3-lib-linux-amd64.tar.gz | tar xf -
gunzip -c jai_imageio-1_1-lib-linux-amd64.tar.gz | tar xf -
# Copy relevant documents after the extract to the jre directory (jdk installation directory)
# / usr / lib / jvm / java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64 refers to jdk installation directory, view the jdk installation directory, Reference: https://www.cnblogs.com/luminccs -5308 / p / 10043338.html
cp /tmp/jai-1_1_3/lib/*.jar /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/ext/
cp /tmp/jai-1_1_3/lib/*.so /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/amd64/
cp /tmp/jai_imageio-1_1/lib/*.jar /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/ext/
cp /tmp/jai_imageio-1_1/lib/*.so /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/amd64/
 
 
2. Restart geoserver error geoserver start Could not initialize class javax.media.jai.JAI
 
The reason: jdk under a jar and add new JAI under geoserver of web-lib directory jar package conflicts of             https://blog.csdn.net/zhang88lei/article/details/6050424
 
 
3. Solution: Remove $ CATALINA_BASE / webapps / jai_codec-1.1.3.jar under geoserver / WEB-INF / lib directory; jai_core-1.1.3.jar; jai_imageio-1.1.jar three files
 
 
Note: After the first backup deleted
 
mkdir -p  /tmp/geoserver/
cp /usr/local/geoserver-2.15.0/webapps/geoserver/WEB-INF/lib/jai*.jar    /tmp/geoserver/
 
cd /usr/local/geoserver-2.15.0/webapps/geoserver/WEB-INF/lib
ls
ls * jai
rm -f -r jai_codec-1.1.3.jar
ls * jai
rm -f -r jai_core-1.1.3.jar
ls
ls * jai
rm -f -r jai_imageio-1.1.jar
ls * jai
 
4. Restart geoserver
 
 
two. Native library java library back
 
1. Delete the original jar package under jre (check whether it is before your own copy of those past jar package)
 
 
rm -f -r /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/ext/jai_codec.jar
rm -f -r /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/ext/jai_core.jar
rm -f -r /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/ext/jai_imageio.jar
 
rm -f -r /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/ext/mlibwrapper_jai.jar
 
rm -f -r /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/ext/clibwrapper_jiio.jar
 
 
2. Delete the files in the native so jre (check whether it is before your own copy those files past)
 
rm -f -r /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/amd64/libmlib_jai.so
 
rm -f -r /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.171-8.b10.el7_5.x86_64/jre/lib/amd64/libclib_jiio.so
 
 
3. The previously deleted / webapps / geoserver / WEB-INF / jai_codec-1.1.3.jar lib directory; jai_core-1.1.3.jar; jai_imageio-1.1.jar three files to restore
 
cp s /tmp/geoserver/*.jar /usr/local/geoserver-2.15.0/webapps/geoserver/WEB-INF/lib/
 

Guess you like

Origin www.cnblogs.com/ejQiu-123/p/11420554.html