环境:CentOS7.3 64位 + DM8数据库
首先按照官网要求安装完数据库,一开始还可以正常打开管理工具,过了一段时间后发现用dmdba登录manager管理工具异常,具体如下截图:
具体报错内容如下:
[dmdba@localhost tool]$ ./manager
(Manager:3952): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(Manager:3952): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
(Manager:3952): Gtk-CRITICAL **: IA__gtk_settings_get_for_screen: assertion 'GDK_IS_SCREEN (screen)' failed
(Manager:3952): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window
(Manager:3952): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window
(Manager:3952): Gdk-CRITICAL **: IA__gdk_screen_get_display: assertion 'GDK_IS_SCREEN (screen)' failed
(Manager:3952): Gdk-CRITICAL **: IA__gdk_display_get_pointer: assertion 'GDK_IS_DISPLAY (display)' failed
(Manager:3952): Gdk-CRITICAL **: IA__gdk_screen_get_monitor_at_point: assertion 'GDK_IS_SCREEN (screen)' failed
(Manager:3952): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window
(Manager:3952): Gdk-CRITICAL **: IA__gdk_screen_get_n_monitors: assertion 'GDK_IS_SCREEN (screen)' failed
(Manager:3952): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window
(Manager:3952): Gdk-CRITICAL **: IA__gdk_screen_get_monitor_geometry: assertion 'GDK_IS_SCREEN (screen)' failed
(Manager:3952): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap: assertion 'GDK_IS_SCREEN (screen)' failed
(Manager:3952): Gdk-CRITICAL **: IA__gdk_colormap_get_visual: assertion 'GDK_IS_COLORMAP (colormap)' failed
(Manager:3952): Gdk-CRITICAL **: IA__gdk_screen_get_default_colormap: assertion 'GDK_IS_SCREEN (screen)' failed
(Manager:3952): Gdk-CRITICAL **: IA__gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed
(Manager:3952): Gdk-CRITICAL **: IA__gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed
(Manager:3952): Gdk-CRITICAL **: IA__gdk_window_new: assertion 'GDK_IS_WINDOW (parent)' failed
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f3127ed02b7, pid=3952, tid=139849844127488
#
# JRE version: OpenJDK Runtime Environment (8.0_20-b26) (build 1.8.0_20-b26)
# Java VM: OpenJDK 64-Bit Server VM (25.20-b23 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [libgdk-x11-2.0.so.0+0x7b2b7] gdk_window_enable_synchronized_configure+0x7
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /dm8/tool/hs_err_pid3952.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
./manager: line 20: 3952 Aborted (core dumped) "$JAVA_HOME/bin/java" -Xms256m -Xmx2048m -XX:+PerfDisableSharedMem -DDM_HOME="$DM_HOME" -Djava.library.path="$DM_HOME/bin" -Ddameng.log.file="$TOOL_HOME/log4j.xml" -DeclipseHome="$TOOL_HOME" -Dosgi.nl="$INSTALL_LANGUAGE" -Ddameng.dts.explorer.root="$TOOL_HOME/workspace/local/dts" -Ddameng.isql.explorer.root="$TOOL_HOME/workspace/local/isql" -Duse_bak2=true -Dapp.name=manager -jar "$TOOL_HOME/plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar" -os linux -ws gtk -arch x86_64 -showsplash "$TOOL_HOME/manager.bmp" -data "$TOOL_HOME/workspace/manager" -product com.dameng.manager.product -name Manager
[dmdba@localhost tool]$
首先确认DM8数据库服务正常,可以通过disql登录;
其次根据上述报错“Screen for GtkWindow not set; you must always seta screen for a GtkWindow before using the window”提示的是图形化界面窗口设置异常,即问题属于图形化界面调用异常;
在Linux/Unix类操作系统上的GUI应用程序使用X Window系统(X Window System),它旨在允许多个用户使用窗口化的应用程序通过网络访问计算机。 DISPLAY环境变量用来设置将图形显示到何处。
然后我们确认当前环境设置的环境变量DISPLAY:
根据上面截图可以看出,root用户下DISPLAY变量是:0,而dmdba下查询发现变量为空,即不生效了,这里需要设置dmdba变量和root的一致,才能在dmdba用户下,启动manager时调用图形化界面;
xhost + 这个命令,是允许别的用户启动的图形程序将图形显示在当前屏幕上;
接下来我们发现,启动manager程序再次报错,这次则是提示“/dm8/tool/configuration/org.eclipse.osgi/.manager/.fileTableLock (Permission denied)”
首先我们先查看一下这个文件:
虽然暂时不知道这个文件是干什么的,但是发现configuration子目录下,好几个文件属主属组都已经变成root了;
正常情况下,我们创建达梦数据库的安装目录,下面所有的文件,属主属组都应该是dmdba:dinstall,而报错提示的也是fileTablelock文件锁相关的问题,这里推测是文件属性问题导致,修改属主属组测试:
chown -R dmdba:dinstall /dm8
后续启动发现再次报错DISPLAY的问题,查看发现DISPLAY变量再次被还原为空了,再次设置一遍
export DISPLAY=:0
xhost +
echo $DISPLAY
然后再次启动manager管理程序,问题解决;
针对DISPLAY变量失效问题,需要设置永久生效:
vim .bashrc
把export DISPLAY=:0写入文件最下面,然后执行命令重新加载:
source .bashrc
关于/dm8下面的部分文件,属主属组发生改变,这个问题产生的原因还不太清楚,可能是实验中途切换成root执行过启动程序命令,导致生成root为属主属组的文件?原因待进一步探讨。