Unable to export map image for resource

本文介绍了解决在使用ArcGIS Server for Java 9.2开发过程中遇到的地图导出错误问题。通过升级到SP3、确保创建了专用的ArcGIS SOC和SOM账户以及替换arcobjects.jar文件等步骤,成功解决了这一难题。

使用ArcGISServer for Java 9.2开发时出现以下错误:

严重: Unable to export map image for resource: test
com.esri.adf.web.ags.ADFAGSException: Unable to export map image.

 

Subject  Re: App unable to export map for ArcGIS Server Internet app
Author  David Neufeld
Date  Oct 15, 2007
Message  Ouch! This one is a bear, as it seems to crop on some Windows2003 servers but not others.

I did two things to resolve this:
1) Upgraded to SP3 for desktop and server
2) Made sure that I created an ArcGISSOC and ArcGISSOM accounts during post install (i.e. don't use an existing account)
3) Copied the new arcobjects.jar (from SP3) into my deployed webapp. Reload webapp.

Error is gone!

cheers,
Dave
http://www.mapportal.net

 

http://forums.esri.com/thread.asp?c=158&f=2279&t=226998&m=691500

EPRobot@EPRobot:~/robot_ws$ roscd usb_cam EPRobot@EPRobot:/opt/ros/melodic/share/usb_cam$ source/opt/ros/melodic/setup.bash bash: source/opt/ros/melodic/setup.bash: No such file or directory EPRobot@EPRobot:/opt/ros/melodic/share/usb_cam$ cd ~/robot_ws EPRobot@EPRobot:~/robot_ws$ source devel/setup.bash EPRobot@EPRobot:~/robot_ws$ roslaunch eprobot_start one_car_start.launch ... logging to /home/EPRobot/.ros/log/99f833d2-6236-11f0-a6b3-e45f0131f240/roslaunch-EPRobot-14068.log Checking log directory for disk usage. This may take a while. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB. started roslaunch server http://EPRobot:33445/ SUMMARY ======== CLEAR PARAMETERS * /ekf_se/ PARAMETERS * /amcl/base_frame_id: base_footprint * /amcl/global_frame_id: map * /amcl/gui_publish_rate: 10.0 * /amcl/initial_pose_a: 0.0 * /amcl/initial_pose_x: 0.0 * /amcl/initial_pose_y: 0.0 * /amcl/kld_err: 0.05 * /amcl/kld_z: 0.99 * /amcl/laser_lambda_short: 0.1 * /amcl/laser_likelihood_max_dist: 5.0 * /amcl/laser_max_beams: 60 * /amcl/laser_max_range: 12.0 * /amcl/laser_model_type: likelihood_field * /amcl/laser_sigma_hit: 0.2 * /amcl/laser_z_hit: 0.7 * /amcl/laser_z_max: 0.1 * /amcl/laser_z_rand: 0.3 * /amcl/laser_z_short: 0.1 * /amcl/max_particles: 2000 * /amcl/min_particles: 600 * /amcl/odom_alpha1: 0.2 * /amcl/odom_alpha2: 0.2 * /amcl/odom_alpha3: 0.2 * /amcl/odom_alpha4: 0.2 * /amcl/odom_alpha5: 0.1 * /amcl/odom_frame_id: odom * /amcl/odom_model_type: diff * /amcl/recovery_alpha_fast: 0.2 * /amcl/recovery_alpha_slow: 0.005 * /amcl/resample_interval: 0.4 * /amcl/transform_tolerance: 0.5 * /amcl/update_min_a: 0.05 * /amcl/update_min_d: 0.05 * /amcl/use_map_topic: True * /base_control/base_kd: 0.0 * /base_control/base_ki: 100.0 * /base_control/base_kp: 1000.0 * /base_control/base_kv: 1.0 * /base_control/is_send_anger: false * /camera_uri: http://192.168.3.... * /ekf_se/base_link_frame: /base_footprint * /ekf_se/debug: False * /ekf_se/debug_out_file: /path/to/debug/fi... * /ekf_se/frequency: 30 * /ekf_se/imu0: /imu_data * /ekf_se/imu0_config: [False, False, Fa... * /ekf_se/imu0_differential: False * /ekf_se/imu0_nodelay: True * /ekf_se/imu0_pose_rejection_threshold: 0.8 * /ekf_se/imu0_queue_size: 8 * /ekf_se/imu0_relative: True * /ekf_se/imu0_remove_gravitational_acceleration: True * /ekf_se/initial_estimate_covariance: [&#39;1e-9&#39;, 0, 0, 0,... * /ekf_se/map_frame: /map * /ekf_se/odom0: /odom * /ekf_se/odom0_config: [False, False, Fa... * /ekf_se/odom0_differential: False * /ekf_se/odom0_nodelay: True * /ekf_se/odom0_queue_size: 5 * /ekf_se/odom0_relative: True * /ekf_se/odom_frame: /odom * /ekf_se/print_diagnostics: True * /ekf_se/process_noise_covariance: [0.01, 0, 0, 0, 0... * /ekf_se/publish_acceleration: True * /ekf_se/publish_tf: True * /ekf_se/sensor_timeout: 0.025 * /ekf_se/transform_time_offset: 0.0001 * /ekf_se/transform_timeout: 0.025 * /ekf_se/two_d_mode: True * /ekf_se/world_frame: /odom * /image_view/autosize: True * /laser_filter/scan_filter_chain: [{&#39;type&#39;: &#39;laser_... * /lslidar_driver_node/angle_disable_max: 0 * /lslidar_driver_node/angle_disable_min: 0 * /lslidar_driver_node/compensation: False * /lslidar_driver_node/frame_id: base_laser_link * /lslidar_driver_node/high_reflection: False * /lslidar_driver_node/interface_selection: serial * /lslidar_driver_node/lidar_name: M10 * /lslidar_driver_node/max_range: 100.0 * /lslidar_driver_node/min_range: 0.1 * /lslidar_driver_node/pubPointCloud2: False * /lslidar_driver_node/pubScan: True * /lslidar_driver_node/scan_topic: scan * /lslidar_driver_node/serial_port: /dev/EPRobot_laser * /lslidar_driver_node/use_gps_ts: False * /map_server/frame_id: map * /move_base/TebLocalPlannerROS/acc_lim_theta: 0.3 * /move_base/TebLocalPlannerROS/acc_lim_x: 0.2 * /move_base/TebLocalPlannerROS/allow_init_with_backwards_motion: True * /move_base/TebLocalPlannerROS/cmd_angle_instead_rotvel: False * /move_base/TebLocalPlannerROS/costmap_converter_plugin: * /move_base/TebLocalPlannerROS/costmap_converter_rate: 5 * /move_base/TebLocalPlannerROS/costmap_converter_spin_thread: True * /move_base/TebLocalPlannerROS/costmap_obstacles_behind_robot_dist: 1.0 * /move_base/TebLocalPlannerROS/dt_hysteresis: 0.1 * /move_base/TebLocalPlannerROS/dt_ref: 0.3 * /move_base/TebLocalPlannerROS/dynamic_obstacle_inflation_dist: 0.2 * /move_base/TebLocalPlannerROS/enable_homotopy_class_planning: False * /move_base/TebLocalPlannerROS/enable_multithreading: True * /move_base/TebLocalPlannerROS/exact_arc_length: False * /move_base/TebLocalPlannerROS/feasibility_check_no_poses: 3 * /move_base/TebLocalPlannerROS/footprint_model/line_end: [0.1, 0.0] * /move_base/TebLocalPlannerROS/footprint_model/line_start: [-0.1, 0.0] * /move_base/TebLocalPlannerROS/footprint_model/type: line * /move_base/TebLocalPlannerROS/force_reinit_new_goal_dist: 0.5 * /move_base/TebLocalPlannerROS/free_goal_vel: False * /move_base/TebLocalPlannerROS/global_plan_overwrite_orientation: True * /move_base/TebLocalPlannerROS/global_plan_viapoint_sep: 3.0 * /move_base/TebLocalPlannerROS/h_signature_prescaler: 0.5 * /move_base/TebLocalPlannerROS/h_signature_threshold: 0.1 * /move_base/TebLocalPlannerROS/include_costmap_obstacles: True * /move_base/TebLocalPlannerROS/include_dynamic_obstacles: True * /move_base/TebLocalPlannerROS/inflation_dist: 0.35 * /move_base/TebLocalPlannerROS/is_footprint_dynamic: False * /move_base/TebLocalPlannerROS/legacy_obstacle_association: False * /move_base/TebLocalPlannerROS/max_global_plan_lookahead_dist: 10.0 * /move_base/TebLocalPlannerROS/max_number_classes: 2 * /move_base/TebLocalPlannerROS/max_vel_theta: 1.0 * /move_base/TebLocalPlannerROS/max_vel_x: 0.6 * /move_base/TebLocalPlannerROS/max_vel_x_backwards: 0.3 * /move_base/TebLocalPlannerROS/max_vel_y: 0.0 * /move_base/TebLocalPlannerROS/min_obstacle_dist: 0.55 * /move_base/TebLocalPlannerROS/min_turning_radius: 0.6 * /move_base/TebLocalPlannerROS/no_inner_iterations: 5 * /move_base/TebLocalPlannerROS/no_outer_iterations: 4 * /move_base/TebLocalPlannerROS/obstacle_association_cutoff_factor: 5.0 * /move_base/TebLocalPlannerROS/obstacle_association_force_inclusion_factor: 1.5 * /move_base/TebLocalPlannerROS/obstacle_cost_exponent: 5.5 * /move_base/TebLocalPlannerROS/obstacle_heading_threshold: 0.45 * /move_base/TebLocalPlannerROS/obstacle_keypoint_offset: 0.1 * /move_base/TebLocalPlannerROS/obstacle_poses_affected: 15 * /move_base/TebLocalPlannerROS/odom_topic: odom * /move_base/TebLocalPlannerROS/optimization_activate: True * /move_base/TebLocalPlannerROS/optimization_verbose: False * /move_base/TebLocalPlannerROS/oscillation_recovery: True * /move_base/TebLocalPlannerROS/penalty_epsilon: 0.08 * /move_base/TebLocalPlannerROS/roadmap_graph_area_length_scale: 1.0 * /move_base/TebLocalPlannerROS/roadmap_graph_area_width: 5 * /move_base/TebLocalPlannerROS/roadmap_graph_no_samples: 15 * /move_base/TebLocalPlannerROS/selection_alternative_time_cost: False * /move_base/TebLocalPlannerROS/selection_cost_hysteresis: 1.0 * /move_base/TebLocalPlannerROS/selection_obst_cost_scale: 1.0 * /move_base/TebLocalPlannerROS/selection_viapoint_cost_scale: 1.0 * /move_base/TebLocalPlannerROS/shrink_horizon_backup: True * /move_base/TebLocalPlannerROS/simple_exploration: False * /move_base/TebLocalPlannerROS/teb_autosize: True * /move_base/TebLocalPlannerROS/via_points_ordered: False * /move_base/TebLocalPlannerROS/visualize_hc_graph: False * /move_base/TebLocalPlannerROS/weight_acc_lim_theta: 1 * /move_base/TebLocalPlannerROS/weight_acc_lim_x: 1 * /move_base/TebLocalPlannerROS/weight_adapt_factor: 1.0 * /move_base/TebLocalPlannerROS/weight_dynamic_obstacle: 100 * /move_base/TebLocalPlannerROS/weight_dynamic_obstacle_inflation: 0.6 * /move_base/TebLocalPlannerROS/weight_inflation: 1.0 * /move_base/TebLocalPlannerROS/weight_kinematics_forward_drive: 800 * /move_base/TebLocalPlannerROS/weight_kinematics_nh: 1000 * /move_base/TebLocalPlannerROS/weight_kinematics_turning_radius: 6.0 * /move_base/TebLocalPlannerROS/weight_max_vel_theta: 1 * /move_base/TebLocalPlannerROS/weight_max_vel_x: 2 * /move_base/TebLocalPlannerROS/weight_obstacle: 190 * /move_base/TebLocalPlannerROS/weight_optimaltime: 15 * /move_base/TebLocalPlannerROS/weight_shortest_path: 5.0 * /move_base/TebLocalPlannerROS/weight_viapoint: 10.0 * /move_base/TebLocalPlannerROS/wheelbase: 0.3 * /move_base/TebLocalPlannerROS/xy_goal_tolerance: 0.1 * /move_base/TebLocalPlannerROS/yaw_goal_tolerance: 0.1 * /move_base/base_local_planner: teb_local_planner... * /move_base/clearing_rotation_allowed: False * /move_base/conservative_reset_dist: 0.2 * /move_base/controller_frequency: 5.0 * /move_base/controller_patience: 15.0 * /move_base/global_costmap/footprint: [[-0.18, -0.18], ... * /move_base/global_costmap/global_frame: map * /move_base/global_costmap/inflation_layer/cost_scaling_factor: 10.0 * /move_base/global_costmap/inflation_layer/enabled: True * /move_base/global_costmap/inflation_layer/inflation_radius: 0.3 * /move_base/global_costmap/inflation_radius: 0.4 * /move_base/global_costmap/laser_scan_sensor/clearing: True * /move_base/global_costmap/laser_scan_sensor/data_type: LaserScan * /move_base/global_costmap/laser_scan_sensor/marking: True * /move_base/global_costmap/laser_scan_sensor/topic: scan * /move_base/global_costmap/map_type: costmap * /move_base/global_costmap/observation_sources: laser_scan_sensor * /move_base/global_costmap/obstacle_layer/combination_method: 1 * /move_base/global_costmap/obstacle_layer/enabled: True * /move_base/global_costmap/obstacle_layer/inflation_radius: 0.2 * /move_base/global_costmap/obstacle_layer/obstacle_range: 6.5 * /move_base/global_costmap/obstacle_layer/raytrace_range: 6.0 * /move_base/global_costmap/obstacle_layer/track_unknown_space: False * /move_base/global_costmap/plugins: [{&#39;type&#39;: &#39;costma... * /move_base/global_costmap/publish_frequency: 5.0 * /move_base/global_costmap/robot_base_frame: base_footprint * /move_base/global_costmap/static_layer/enabled: True * /move_base/global_costmap/static_layer/map_topic: /map * /move_base/global_costmap/static_map: True * /move_base/global_costmap/transform_tolerance: 0.5 * /move_base/global_costmap/update_frequency: 5.0 * /move_base/local_costmap/cost_scaling_factor: 10 * /move_base/local_costmap/footprint: [[-0.18, -0.18], ... * /move_base/local_costmap/global_frame: map * /move_base/local_costmap/height: 3 * /move_base/local_costmap/inflation_layer/cost_scaling_factor: 10.0 * /move_base/local_costmap/inflation_layer/enabled: True * /move_base/local_costmap/inflation_layer/inflation_radius: 0.3 * /move_base/local_costmap/inflation_radius: 0.16 * /move_base/local_costmap/laser_scan_sensor/clearing: True * /move_base/local_costmap/laser_scan_sensor/data_type: LaserScan * /move_base/local_costmap/laser_scan_sensor/marking: True * /move_base/local_costmap/laser_scan_sensor/topic: scan * /move_base/local_costmap/map_type: costmap * /move_base/local_costmap/observation_sources: laser_scan_sensor * /move_base/local_costmap/obstacle_layer/combination_method: 1 * /move_base/local_costmap/obstacle_layer/enabled: True * /move_base/local_costmap/obstacle_layer/inflation_radius: 0.2 * /move_base/local_costmap/obstacle_layer/obstacle_range: 6.5 * /move_base/local_costmap/obstacle_layer/raytrace_range: 6.0 * /move_base/local_costmap/obstacle_layer/track_unknown_space: False * /move_base/local_costmap/plugins: [{&#39;type&#39;: &#39;costma... * /move_base/local_costmap/publish_frequency: 5.0 * /move_base/local_costmap/resolution: 0.05 * /move_base/local_costmap/robot_base_frame: base_footprint * /move_base/local_costmap/rolling_window: True * /move_base/local_costmap/static_layer/enabled: True * /move_base/local_costmap/static_layer/map_topic: /map * /move_base/local_costmap/static_map: False * /move_base/local_costmap/transform_tolerance: 0.5 * /move_base/local_costmap/update_frequency: 5.0 * /move_base/local_costmap/width: 3 * /move_base/oscillation_distance: 0.2 * /move_base/oscillation_timeout: 10.0 * /move_base/planner_frequency: 1.0 * /move_base/planner_patience: 5.0 * /robot_description: <?xml version="1.... * /rosdistro: melodic * /rosversion: 1.14.13 * /time0: 5.0 * /time1: 15.0 * /time2: 2.0 * /time3: 10.0 * /time4: 2.0 * /time5: 5.0 * /usb_cam/camera_frame_id: usb_cam * /usb_cam/color_format: yuv422p * /usb_cam/image_height: 960 * /usb_cam/image_width: 1280 * /usb_cam/io_method: mmap * /usb_cam/pixel_format: yuyv * /usb_cam/video_device: /dev/video0 NODES / amcl (amcl/amcl) base_control (eprobot_start/art_racecar.py) base_to_camera (tf/static_transform_publisher) base_to_gyro (tf/static_transform_publisher) base_to_laser (tf/static_transform_publisher) base_to_link (tf/static_transform_publisher) ekf_se (robot_localization/ekf_localization_node) image_view (image_view/image_view) joint_state_publisher (joint_state_publisher/joint_state_publisher) laser_filter (laser_filters/scan_to_scan_filter_chain) lslidar_driver_node (lslidar_driver/lslidar_driver_node) map_server (map_server/map_server) move_base (move_base/move_base) one_car_start (eprobot_start/one_car_start.py) robot_state_publisher (robot_state_publisher/robot_state_publisher) usb_cam (usb_cam/usb_cam_node) auto-starting new master process[master]: started with pid [14090] ROS_MASTER_URI=http://EPRobot:11311 setting /run_id to 99f833d2-6236-11f0-a6b3-e45f0131f240 process[rosout-1]: started with pid [14119] started core service [/rosout] process[usb_cam-2]: started with pid [14127] [ INFO] [1752664718.321383044]: using default calibration URL [ INFO] [1752664718.324520524]: camera calibration URL: file:///home/EPRobot/.ros/camera_info/head_camera.yaml [ INFO] [1752664718.326800107]: Starting &#39;head_camera&#39; (/dev/video0) at 1280x960 via mmap (yuyv) at 30 FPS [ WARN] [1752664718.735313971]: unknown control &#39;focus_auto&#39; process[image_view-3]: started with pid [14141] [ INFO] [1752664719.297416290]: Initializing nodelet with 4 worker threads. [ INFO] [1752664719.636365059]: Using transport "raw" Unable to init server: Could not connect: Connection refused (image_raw:14141): Gtk-WARNING **: 19:18:39.655: cannot open display: process[base_to_link-4]: started with pid [14162] [image_view-3] process has died [pid 14141, exit code -7, cmd /opt/ros/melodic/lib/image_view/image_view image:=/usb_cam/image_raw __name:=image_view __log:=/home/EPRobot/.ros/log/99f833d2-6236-11f0-a6b3-e45f0131f240/image_view-3.log]. log file: /home/EPRobot/.ros/log/99f833d2-6236-11f0-a6b3-e45f0131f240/image_view-3*.log process[base_to_gyro-5]: started with pid [14179] process[base_to_laser-6]: started with pid [14185] process[base_to_camera-7]: started with pid [14207] process[joint_state_publisher-8]: started with pid [14230] process[robot_state_publisher-9]: started with pid [14236] /opt/ros/melodic/lib/python2.7/dist-packages/roslib/packages.py:470: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal if resource_name in files: process[base_control-10]: started with pid [14254] process[lslidar_driver_node-11]: started with pid [14290] [ INFO] [1752664729.962119437]: Lidar is M10 [ INFO] [1752664729.966360145]: Opening PCAP file port = /dev/EPRobot_laser, baud_rate = 460800 open_port /dev/EPRobot_laser OK ! [ INFO] [1752664729.975351998]: Initialised lslidar without error process[laser_filter-12]: started with pid [14294] [ INFO] [1752664731.668764248]: clear_inside(!invert): true [INFO] [1752664731.987782]: base control start... [INFO] [1752664732.050161]: LaserMode : Express [INFO] [1752664732.054070]: is_pub_odom_tf : false [INFO] [1752664732.058682]: is_send_anger : false [INFO] [1752664732.064063]: Opening Serial [INFO] [1752664732.068745]: Serial Open Succeed process[map_server-13]: started with pid [14302] process[amcl-14]: started with pid [14345] [ INFO] [1752664734.603713766]: Subscribed to map topic. process[move_base-15]: started with pid [14392] [ INFO] [1752664738.288776006]: Received a 113 X 155 map @ 0.050 m/pix [ INFO] [1752664738.342521599]: Initializing likelihood field model; this can take some time on large maps... [ INFO] [1752664738.564463605]: Done initializing likelihood field model. process[ekf_se-16]: started with pid [14487] ERROR: cannot launch node of type [eprobot_start/one_car_start.py]: Cannot locate node of type [one_car_start.py] in package [eprobot_start]. Make sure file exists in package path and permission is set to executable (chmod +x) [ WARN] [1752664744.622110021]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist. canTransform: source_frame base_footprint does not exist.. canTransform returned after 0.100855 timeout was 0.1. [ WARN] [1752664749.662226961]: Timed out waiting for transform from base_footprint to map to become available before running costmap, tf error: canTransform: target_frame map does not exist.. canTransform returned after 0.100879 timeout was 0.1. [ WARN] [1752664750.045300032]: No laser scan received (and thus no pose updates have been published) for 1752664750.045188 seconds. Verify that data is being published on the /scan_filtered topic. [ WARN] [1752664750.909388277]: global_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided [ WARN] [1752664750.910831334]: global_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided [ INFO] [1752664750.913784170]: global_costmap: Using plugin "static_layer" [ INFO] [1752664750.939597140]: Requesting the map... [ INFO] [1752664752.449678715]: Resizing costmap to 113 X 155 at 0.050000 m/pix [ INFO] [1752664752.547678812]: Received a 113 X 155 map at 0.050000 m/pix [ INFO] [1752664752.561273484]: global_costmap: Using plugin "obstacle_layer" [ INFO] [1752664752.575820460]: Subscribed to Topics: [ INFO] [1752664752.633974493]: global_costmap: Using plugin "inflation_layer" [ WARN] [1752664752.791761769]: local_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided [ WARN] [1752664752.792967329]: local_costmap: Pre-Hydro parameter "map_type" unused since "plugins" is provided [ INFO] [1752664752.796072737]: local_costmap: Using plugin "static_layer" [ INFO] [1752664752.811786347]: Requesting the map... [ INFO] [1752664752.817690388]: Resizing static layer to 113 X 155 at 0.050000 m/pix [ INFO] [1752664752.917396353]: Received a 113 X 155 map at 0.050000 m/pix [ INFO] [1752664752.929664634]: local_costmap: Using plugin "obstacle_layer" [ INFO] [1752664752.939666756]: Subscribed to Topics: [ INFO] [1752664752.965128769]: local_costmap: Using plugin "inflation_layer" [ INFO] [1752664753.095626908]: Created local_planner teb_local_planner/TebLocalPlannerROS [ INFO] [1752664753.341522310]: Footprint model &#39;line&#39; (line_start: [-0.1,0]m, line_end: [0.1,0]m) loaded for trajectory optimization. [ INFO] [1752664753.342274171]: Parallel planning in distinctive topologies disabled. [ INFO] [1752664753.342459132]: No costmap conversion plugin specified. All occupied costmap cells are treaten as point obstacles. [ INFO] [1752664754.285150804]: Recovery behavior will clear layer &#39;obstacles&#39; [ INFO] [1752664754.293909996]: Recovery behavior will clear layer &#39;obstacles&#39; [ INFO] [1752664754.905121673]: odom received! ^C[ekf_se-16] killing on exit [move_base-15] killing on exit [amcl-14] killing on exit [map_server-13] killing on exit [laser_filter-12] killing on exit [lslidar_driver_node-11] killing on exit [base_control-10] killing on exit [joint_state_publisher-8] killing on exit [robot_state_publisher-9] killing on exit [base_to_camera-7] killing on exit ^C[base_to_laser-6] killing on exit lslidar_driver_node: /usr/include/boost/thread/pthread/condition_variable_fwd.hpp:116: boost::condition_variable::~condition_variable(): Assertion `!ret&#39; failed. [base_to_gyro-5] killing on exit [base_to_link-4] killing on exit ^C[usb_cam-2] killing on exit ^C^C^C^C^C^C[rosout-1] killing on exit [master] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done
07-17
spark-submit --master yarn --class org.apache.spark.examples.SparkPi $SPARK_HOME/examples/jars/spark-examples_2.12-3.1.1.jar 25/11/21 19:51:50 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 25/11/21 19:51:50 INFO SparkContext: Running Spark version 3.1.1 25/11/21 19:51:50 INFO ResourceUtils: ============================================================== 25/11/21 19:51:50 INFO ResourceUtils: No custom resources configured for spark.driver. 25/11/21 19:51:50 INFO ResourceUtils: ============================================================== 25/11/21 19:51:50 INFO SparkContext: Submitted application: Spark Pi 25/11/21 19:51:50 INFO ResourceProfile: Default ResourceProfile created, executor resources: Map(cores -> name: cores, amount: 1, script: , vendor: , memory -> name: memory, amount: 1024, script: , vendor: , offHeap -> name: offHeap, amount: 0, script: , vendor: ), task resources: Map(cpus -> name: cpus, amount: 1.0) 25/11/21 19:51:50 INFO ResourceProfile: Limiting resource is cpus at 1 tasks per executor 25/11/21 19:51:50 INFO ResourceProfileManager: Added ResourceProfile id: 0 25/11/21 19:51:50 INFO SecurityManager: Changing view acls to: root 25/11/21 19:51:50 INFO SecurityManager: Changing modify acls to: root 25/11/21 19:51:50 INFO SecurityManager: Changing view acls groups to: 25/11/21 19:51:50 INFO SecurityManager: Changing modify acls groups to: 25/11/21 19:51:50 INFO SecurityManager: SecurityManager: authentication disabled; ui acls disabled; users with view permissions: Set(root); groups with view permissions: Set(); users with modify permissions: Set(root); groups with modify permissions: Set() 25/11/21 19:51:50 INFO Utils: Successfully started service &#39;sparkDriver&#39; on port 44407. 25/11/21 19:51:50 INFO SparkEnv: Registering MapOutputTracker 25/11/21 19:51:50 INFO SparkEnv: Registering BlockManagerMaster 25/11/21 19:51:50 INFO BlockManagerMasterEndpoint
11-22
<think> 首先,用户的问题是:“我想查找解决无法为来宾内存映射后备存储问题的方法 请问解决 unable to map backing store for guest RAM 问题的方法”。这翻译成英文是:“I want to find a solution to the problem of being unable to map backing store for guest RAM. Please provide methods to solve the &#39;unable to map backing store for guest RAM&#39; issue.” 根据系统级指令: - 所有行内数学表达式必须使用$...$格式,但在这个问题中,似乎没有数学表达式,所以可能不需要。 - 独立公式必须使用$$...$$格式并单独成段,但同样,这里可能没有公式。 - LaTeX语法正确:确保在需要时使用正确的LaTeX。 - 使用中文回答:整个响应必须是中文。 - 生成相关问题:在回答后,添加一个“相关问题”部分,生成相关问题。 - 回答中引用的段落末尾自然地添加引用标识:例如[^1]。 用户可见层指令:回答结构清晰,帮助用户逐步解决问题,保证回答真实可靠。 参考提供的引用: - [^1]: 开启客户机时,客户机的内存大小要小于宿主机设置的大页hugepage的大小。否则会报错。 - [^2]: 虚拟机错误解决方法,提到内存分配问题。 - [^3]: 如果内存是16G,host的hugepage必须设置大于16G。 - [^4]: 类似[^1],并提到使用-mem-prealloc参数可以确保内存分配一致。 用户的问题是基于这些引用,寻求解决“unable to map backing store for guest RAM”错误的方法。 关键点从引用中提取: 1. 错误原因:客户机的内存大小超过了宿主机的大页(hugepage)大小。 2. 解决方法:确保宿主机的大页大小足够大,以容纳客户机的内存需求。 3. 具体步骤:设置宿主机的大页大小大于客户机的内存大小。 4. 额外建议:使用-mem-prealloc参数来预分配内存。 现在,构建回答: - 结构清晰:逐步引导用户解决问题。 - 步骤包括: a. 确认错误原因。 b. 检查宿主机的大页设置和客户机的内存大小。 c. 调整大页大小。 d. 使用qemu参数如-mem-prealloc。 - 引用来源:在相关部分添加引用标识。 最终回答结构: 1. 解释错误原因。 2. 提供解决步骤。 3. 给出示例或命令。 4. 结束时生成相关问题。 确保回答真实可靠:基于引用内容。 完整回答大纲: - 引言:解释错误。 - 步骤1:检查客户机内存和宿主机大页大小。 - 步骤2:调整宿主机大页大小。 - 步骤3:使用预分配参数。 - 总结。 - 相关问题部分。 相关问题生成:基于主题,如大页设置、优化等。 相关问题示例: 1. 如何设置宿主机的大页大小? 2. 什么是大页内存及其优势? 3. 其他导致“Cannot allocate memory”错误的原因? 4. 如何监控大页使用情况? 现在,编写响应。 </think> ### 解决 "unable to map backing store for guest RAM" 错误的方法 当您在虚拟化环境(如KVM/QEMU)中启动客户机时,遇到 "unable to map backing store for guest RAM: Cannot allocate memory" 错误,这通常是由于客户机的内存需求超过了宿主机的大页(hugepage)配置所致。大页内存是一种优化机制,能提升虚拟机的性能,但如果配置不当,会导致内存分配失败。以下是基于引用内容的逐步解决方法,确保问题得到可靠解决。 **重要提示**:在执行任何操作前,请备份宿主机配置文件(如`/etc/sysctl.conf`)和虚拟机配置(如XML文件),以防意外错误。 #### 步骤1: 确认错误原因并检查当前设置 首先,错误的核心是客户机的内存大小超过了宿主机的大页可用内存。大页大小通常以2MB或1GB为单位,总可用内存为`大页数量 × 大页大小`。 - **检查客户机内存设置**: 查看虚拟机配置文件(例如Libvirt的XML文件),确认`<memory>`和`<currentMemory>`元素的值。引用[^3]指出,如果客户机内存设置为16GB(如`<memory unit=&#39;KiB&#39;>16777216</memory>`),则宿主机大页总大小必须大于此值。否则,启动时会报错。 - **检查宿主机大页状态**: 在宿主机终端运行以下命令: ```bash cat /proc/meminfo | grep HugePage ``` 输出示例: ``` HugePages_Total: 200 # 总大页数量 HugePages_Free: 100 # 空闲大页数量 Hugepagesize: 2048 kB # 单个大页大小(通常为2MB) ``` 计算总可用大页内存:`HugePages_Total × Hugepagesize`。如果此值小于客户机内存,则错误必然发生。引用[^1]和[^4]都强调,客户机内存必须小于宿主机大页大小(例如,客户机200MB,宿主机大页400MB)[^1][^4]。 #### 步骤2: 调整宿主机大页大小 如果宿主机大页不足,需要增加大页数量。操作步骤如下: 1. **临时设置(重启失效)**: 在宿主机终端运行: ```bash echo 新大页数量 > /proc/sys/vm/nr_hugepages ``` 例如,客户机内存为16GB(16384MB),大页大小为2MB,则需设置大页数量至少为8192(因为$16384 \div 2 = 8192$)。 2. **永久设置(需重启生效)**: - 编辑`/etc/sysctl.conf`文件: ```bash sudo nano /etc/sysctl.conf ``` - 添加行:`vm.nr_hugepages = 新大页数量`(例如`vm.nr_hugepages = 8192`)。 - 应用更改:`sudo sysctl -p`。 - **重启宿主机**:确保设置生效。引用[^3]强调,大页总大小必须严格大于客户机内存[^3]。 #### 步骤3: 使用预分配参数启动客户机 调整大页后,启动客户机时添加`-mem-prealloc`参数,确保内存分配在启动时完成,避免运行时错误。 - **如果使用QEMU命令行**: 在启动命令中加入`-mem-path /dev/hugepages/ -mem-prealloc`。例如: ```bash qemu-system-x86_64 -m 200 -drive file=/path/to/image.img -mem-path /dev/hugepages/ -mem-prealloc ``` 其中`-m 200`表示客户机内存为200MB。引用[^4]说明,此参数能让`HugePages_Free`减少量与客户机内存一致,避免启动时分配不足[^4]。 - **如果使用Libvirt(如virt-manager)**: 在虚拟机XML配置的`<memoryBacking>`部分添加`<hugepages/>`和`<locked/>`(确保内存锁定)。示例: ```xml <memory unit=&#39;KiB&#39;>16777216</memory> <currentMemory unit=&#39;KiB&#39;>16777216</currentMemory> <memoryBacking> <hugepages/> <locked/> </memoryBacking> ``` 然后重启Libvirt服务:`sudo systemctl restart libvirtd`。 #### 步骤4: 验证解决效果 启动客户机后,重新检查大页使用情况: ```bash cat /proc/meminfo | grep HugePage ``` 如果`HugePages_Free`减少量匹配客户机内存(例如客户机200MB,则减少约100个2MB大页),说明问题已解决。引用[^4]中提到,未使用`-mem-prealloc`时,减少量可能不一致,但添加后应恢复正常[^4]。 #### 常见错误排除 - **如果问题依旧**: - 确保宿主机物理内存充足:运行`free -h`,确认空闲内存大于客户机内存。 - 检查内核支持:运行`grep Huge /proc/meminfo`,如果无输出,表示内核未启用大页(需在内核编译时启用`CONFIG_HUGETLBFS`)。 - 其他原因:如内存碎片或权限问题,引用[^2]建议检查日志(`dmesg | grep kvm`)[^2]。 通过以上步骤,您应能解决 "unable to map backing store for guest RAM" 错误。核心原则是:**宿主机大页总大小必须大于客户机内存大小**,并结合预分配参数优化启动过程。如果您在实施中遇到问题,请提供更多细节(如客户机内存大小和宿主机大页输出),以便进一步诊断。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值