启动失败
# 在linux 系统中执行管理 sh 提示
执行如下命令:(https://blog.csdn.net/perter_liao/article/details/76757605)
# 1.编辑文件
vim filename(文件名)
# 2.进入末行模式(按esc键)
# 3.设置文件格式
:set fileformat=unix
# 4.保存退出
:wq
# 5.#sh filename OK!
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
同时需要注意文件编码格式和内容换行符
# windows 中执行管理bat命令乱码或者执行失败
请修改(Agent.bat、Server.bat)文件编码为当前系统默认的编码(windows中默认为GB2312)、检查文件内容换行符
使用 GB2312 编码后请检查脚本里面是否包含 CHCP 相关命令,如果存在需要将其一并删除
# windows 中上传中文文件名乱码
- 请修改(Agent.bat、Server.bat)文件编码为当前系统默认的编码(windows中默认为
GB2312
)、检查文件内容换行符:\r\n
- 删除(Agent.bat、Server.bat)文件中
CHCP
相关命令,果存在需要将其一并删除 - 添加 JVM 参数:
-Dfile.encoding=UTF-8
# 启动很慢
在 linux 中出现如下日志:Please verify your network configuration.
WARN [main] o.s.b.StartupInfoLogger [StartupInfoLogger.java:117]- x:() InetAddress.getLocalHost().getHostName() took 10084 milliseconds to respond. Please verify your network configuration.
1
解决方法:
- 查看主机名
hostname
1
假设输出:myhostname
- 在/etc/hosts上加上主机名
127.0.0.1 localhost myhostname
::1 localhost myhostname
1
2
2
注意:myhostname 请修改为第一步执行结果
# Ubuntu/Debian 执行脚本错误
Syntax error: "(" unexpected
代码对于标准bash而言没有错,因为Ubuntu/Debian
为了加快开机速度,用dash
代替了传统的bash
,是dash
在捣鬼。
解决方法:
- 就是取消
dash
sudo dpkg-reconfigure dash
在选择项中选No,搞定了!
- 通过
bash ./Agent.sh
、bash ./Server.sh
执行
# Ubuntu 安装出现没有权限 Permission denied
user@user:~$ apt-get install -y wget && \
wget -O install.sh https://jpom.top/docs/install.sh && \
bash install.sh Server jdk
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
1
2
3
4
5
2
3
4
5
这是因为当前账号没有安装软件的权限,可以修改安装命令如下:
sudo apt-get install -y wget && \
wget -O install.sh https://jpom.top/docs/install.sh && \
sudo bash install.sh Server jdk
1
2
3
2
3
# 执行 install.sh 出现多个 Permission denied 错误
参考的错误日志如下:
- mkdir: cannot create directory ‘/usr/java/’: Permission denied
- install.sh: line 63: /etc/profile: Permission denied
- mkdir: cannot create directory ‘/usr/local/jpom-server’: Permission denied
Resolving download.jpom.top (download.jpom.top)... 58.218.208.95, 58.218.208.93, 58.218.208.81, ...
Connecting to download.jpom.top (download.jpom.top)|58.218.208.95|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 195132576 (186M) [application/gzip]
Saving to: ‘jdk-8u251-linux-x64.tar.gz’
jdk-8u251-linux-x64.tar.gz 100%[====================================================================================================>] 186.09M 3.49MB/s in 47s
2022-11-24 08:18:42 (3.96 MB/s) - ‘jdk-8u251-linux-x64.tar.gz’ saved [195132576/195132576]
mkdir: cannot create directory ‘/usr/java/’: Permission denied
tar: /usr/java: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
安装jdk,路径/usr/java/jdk1.8.0_251/
install.sh: line 63: /etc/profile: Permission denied
install.sh: line 64: /etc/profile: Permission denied
install.sh: line 65: /etc/profile: Permission denied
install.sh: line 66: /etc/profile: Permission denied
默认安装目录 /usr/local/jpom-server, 是否使用此目录作为安装目录? 输入 y 确定, 否则请输入安装目录, 需要使用绝对路径 (注意: agent 和 server 不能装到同一个目录!):y
mkdir: cannot create directory ‘/usr/local/jpom-server’: Permission denied
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
这是因为当前账号没有对应目录的写入权限,建议使用 sudo 切换 root 用户安装即可或者跟进日志信息看出路径有如下:
- 自动安装 jdk 的路径:
/usr/java/
.- 提前手动安装 jdk 环境
- 安装 服务端的路径:
/usr/local/jpom-server
- 安装时候根据提示手动填写有权限的路径
帮助我们改善此文档 (opens new window)
上次更新: 2023/09/20, 13:11:05