背景
geonode使用过程中遇到的问题
问题列表
1、geonode的安装地址中geonode的启动使用了uwsgi服务,但无法启动该服务 2、vmware 虚拟机 无法挂载以前能挂载的文件
1 geonode服务无法启动
sudo systemctl start geonode-uwsgi.service
sudo systemctl status geonode-uwsgi.service
查询状态后显示如下错误:
× geonode-uwsgi.service - GeoNode UWSGI Service
Loaded: loaded (/etc/systemd/system/geonode-uwsgi.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2025-04-29 14:25:49 CST; 8min ago
Main PID: 4463 (code=exited, status=1/FAILURE)
CPU: 15ms
4月 29 14:25:49 geonode systemd[1]: geonode-uwsgi.service: Scheduled restart job, restart counter is at 5.
4月 29 14:25:49 geonode systemd[1]: Stopped GeoNode UWSGI Service.
4月 29 14:25:49 geonode systemd[1]: geonode-uwsgi.service: Start request repeated too quickly.
4月 29 14:25:49 geonode systemd[1]: geonode-uwsgi.service: Failed with result 'exit-code'.
4月 29 14:25:49 geonode systemd[1]: Failed to start GeoNode UWSGI Service.
这个错误显示不出详细的原因,使用以下命令可以看出详细的原因。
sudo journalctl -u geonode-uwsgi.service -n 50 --since "5 minutes ago"
sudo: 以超级用户(管理员)权限执行命令,因为查看日志通常需要管理员权限。
journalctl: 这是一个用来查看和查询系统日志的命令,适用于基于 systemd 的系统(如 Ubuntu、CentOS 等)。
-u geonode-uwsgi.service: 这表示只查看 geonode-uwsgi.service 这个特定服务的日志。-u 选项指定了要查看的单位(unit),即服务名。
-n 50: 这个选项指定只显示最近的 50 行日志。即使日志量很大,只会显示最后的 50 行。
–since “5 minutes ago”: 这个选项限制日志的显示范围,表示只显示过去 5 分钟内的日志。
这个命令的作用是查看 geonode-uwsgi.service 服务在过去 5 分钟内的最新 50 行日志。这对于诊断问题、查看服务的状态或捕获最近发生的错误非常有用。
4月 29 14:56:25 geonode systemd[1]: Started GeoNode UWSGI Service.
4月 29 14:56:25 geonode uwsgi[51325]: [uWSGI] getting INI configuration from /opt/geonode/uwsgi.ini
4月 29 14:56:25 geonode uwsgi[51325]: open("/var/log/geonode.log"): Permission denied [core/logging.c line 288]
4月 29 14:56:25 geonode systemd[1]: geonode-uwsgi.service: Main process exited, code=exited, status=1/FAILURE
4月 29 14:56:25 geonode systemd[1]: geonode-uwsgi.service: Failed with result 'exit-code'.
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Scheduled restart job, restart counter is at 1.
4月 29 14:56:26 geonode systemd[1]: Stopped GeoNode UWSGI Service.
4月 29 14:56:26 geonode systemd[1]: Started GeoNode UWSGI Service.
4月 29 14:56:26 geonode uwsgi[51328]: [uWSGI] getting INI configuration from /opt/geonode/uwsgi.ini
4月 29 14:56:26 geonode uwsgi[51328]: open("/var/log/geonode.log"): Permission denied [core/logging.c line 288]
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Main process exited, code=exited, status=1/FAILURE
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Failed with result 'exit-code'.
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Scheduled restart job, restart counter is at 2.
4月 29 14:56:26 geonode systemd[1]: Stopped GeoNode UWSGI Service.
4月 29 14:56:26 geonode systemd[1]: Started GeoNode UWSGI Service.
4月 29 14:56:26 geonode uwsgi[51331]: [uWSGI] getting INI configuration from /opt/geonode/uwsgi.ini
4月 29 14:56:26 geonode uwsgi[51331]: open("/var/log/geonode.log"): Permission denied [core/logging.c line 288]
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Main process exited, code=exited, status=1/FAILURE
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Failed with result 'exit-code'.
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Scheduled restart job, restart counter is at 3.
4月 29 14:56:26 geonode systemd[1]: Stopped GeoNode UWSGI Service.
4月 29 14:56:26 geonode systemd[1]: Started GeoNode UWSGI Service.
4月 29 14:56:26 geonode uwsgi[51335]: [uWSGI] getting INI configuration from /opt/geonode/uwsgi.ini
4月 29 14:56:26 geonode uwsgi[51335]: open("/var/log/geonode.log"): Permission denied [core/logging.c line 288]
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Main process exited, code=exited, status=1/FAILURE
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Failed with result 'exit-code'.
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Scheduled restart job, restart counter is at 4.
4月 29 14:56:26 geonode systemd[1]: Stopped GeoNode UWSGI Service.
4月 29 14:56:26 geonode systemd[1]: Started GeoNode UWSGI Service.
4月 29 14:56:26 geonode uwsgi[51338]: [uWSGI] getting INI configuration from /opt/geonode/uwsgi.ini
4月 29 14:56:26 geonode uwsgi[51338]: open("/var/log/geonode.log"): Permission denied [core/logging.c line 288]
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Main process exited, code=exited, status=1/FAILURE
4月 29 14:56:26 geonode systemd[1]: geonode-uwsgi.service: Failed with result 'exit-code'.
4月 29 14:56:27 geonode systemd[1]: geonode-uwsgi.service: Scheduled restart job, restart counter is at 5.
4月 29 14:56:27 geonode systemd[1]: Stopped GeoNode UWSGI Service.
4月 29 14:56:27 geonode systemd[1]: geonode-uwsgi.service: Start request repeated too quickly.
4月 29 14:56:27 geonode systemd[1]: geonode-uwsgi.service: Failed with result 'exit-code'.
4月 29 14:56:27 geonode systemd[1]: Failed to start GeoNode UWSGI Service.
日志中显示操作/var/log/geonode.log文件无权限,需要修改该文件的修改权限。
# 将 /var/log/geonode.log 文件的所有者和用户组都更改为 wt。使用 sudo 提升权限来确保对文件的更改成功。
sudo chown wt:wt /var/log/geonode.log
#该命令的作用是将 /var/log/geonode.log 文件的权限设置为 644,即: 所有者(user)可以读取和修改文件; 用户组(group)和其他用户(others)只能读取文件。
sudo chmod 644 /var/log/geonode.log
#该命令的作用是将 /var/log 目录的权限设置为 755,即:所有者(user)可以读取、修改并进入该目录;用户组(group)和其他用户(others)可以读取目录内容并进入该目录,但不能修改其中的文件。
sudo chmod 755 /var/log
sudo systemctl start geonode-uwsgi.service
sudo systemctl status geonode-uwsgi.service
● geonode-uwsgi.service - GeoNode UWSGI Service
Loaded: loaded (/etc/systemd/system/geonode-uwsgi.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2025-04-29 15:00:36 CST; 12s ago
Main PID: 51429 (uwsgi)
Tasks: 17 (limit: 38369)
Memory: 195.3M
CPU: 3.285s
CGroup: /system.slice/geonode-uwsgi.service
├─51429 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51437 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51438 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51439 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51440 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51441 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51442 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51443 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51444 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51445 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51446 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51447 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51448 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51449 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51450 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
├─51451 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
└─51452 /home/wt/.virtualenvs/geonode/bin/uwsgi --ini /opt/geonode/uwsgi.ini
4月 29 15:00:36 geonode systemd[1]: Started GeoNode UWSGI Service.
4月 29 15:00:36 geonode uwsgi[51429]: [uWSGI] getting INI configuration from /opt/geonode/uwsgi.ini
4月 29 15:00:37 geonode uwsgi[51429]: looking for plugins in '/usr/lib64/sasl2', failed to open directory, error: No such file or directory
2 vmware 虚拟机 无法挂载以前能挂载的文件
如果 VMware Tools 安装无误,但 /mnt/hgfs 仍然为空,尝试手动挂载共享文件夹。
执行以下命令查看共享文件夹:
vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
3 Ubuntu 修改MAC
# 临时修改,重启后将失效
#查看当前的网络接口和MAC地址
ifconfig
#禁用网络接口
sudo ifconfig eth0 down
#修改地址
sudo ifconfig eth0 hw ether 00:11:22:33:44:55
#重新启用网络接口
sudo ifconfig eth0 up