当前位置:网站首页>2022工作中遇到的问题四
2022工作中遇到的问题四
2022-07-06 02:58:00 【今夜月色很美】
1、请求60s超时
现象:同事请求出现60s超时,本地正常,生产环境出现超过60s就报超时错误,提示504 gateway timeout
原因:nginx默认后端服务器处理请求超时时间(页面等待服务器响应时间)60s
解决方法:设置合适的后端服务器处理请求超时时间
nginx的conf配置文件,在location / {}中添加 proxy_read_timeout 600;(别忘了加分号)如下所示:
location / {
...
proxy_read_timeout 150; # 秒
...
}
2、gitlab端口占用
修改puma web应用端口
vim /var/opt/gitlab/gitlab-rails/etc/puma.rb
bind 'tcp://127.0.0.1:9109'
gitlab配置文件/etc/gitlab/gitlab.rb
puma['listen'] = '127.0.0.1'
puma['port'] = 9109 # 默认8080,与 `puma.rb` 中配置相同的端口
puma['socket'] = '/var/opt/gitlab/gitlab-rails/sockets/gitlab.socket'
puma['somaxconn'] = 1024
nginx['listen_port'] = 8083 # 修改内置nginx使用的端口,默认80,避免与服务器上原有nginx端口冲突
重启gitlab服务
gitlab-ctl reconfigure
gitlab-ctl restart
3、查询oracle主键约束
select * from dba_constraints where constraint_name='PK_WM_CONTRL_MATERIAL_RECEIVE_PRICE';
4、jenkins集成迁移到git
1.服务器安装git
yum install git
2.jenkins项目中的源码管理改为git,输入gitlab仓库地址和账号,并指定自动化部署分支
3.如果是后端项目需要给脚本startup.sh添加执行权限
chmod +x ./bin/startup.sh
如:
5、git pull报错
error: Your local changes to the following files would be overwritten by merge:
解决方法:
git stash
git pull origin spd-dev
git stash pop
6、查看oracle约束
SELECT * FROM DBA_CONSTRAINTS WHERE constraint_name like '%FK_CERT_CHA_REFERENCE_BASE_CER%';
SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME like '%BASE_CERT%';
7、sql执行报错ParserException
ExecutorException: Error preparing statement. Cause: com.alibaba.druid.sql.parser.ParserException: TODO : pos 293, line 4, column 27, token ON
进入源码查看statement中的sql语句,发现sql正常
org.apache.ibatis.executor.statement.PreparedStatementHandler#query
public <E> List<E> query(Statement statement, ResultHandler resultHandler) throws SQLException {
PreparedStatement ps = (PreparedStatement) statement;
ps.execute();
return resultSetHandler.handleResultSets(ps);
}
断点发现是封装结果集时解析出错
8、级联查询报错
Caused by: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'id' from result set. Cause: com.alibaba.fastjson.JSONException: syntax error, expect {, actual int, pos 15, line 1, column 16220526000012424
级联查询代码:
<collection property="detailList" ofType="com.xxxDetail"
select="com.xxxDetailMapper.list" column="id"/>
通过源码分析发现,级联子查询的时候mybatis把id作为json解析,所以出现了上述错误信息
public T getNullableResult(ResultSet rs, String columnName) throws SQLException {
String sqlJson = rs.getString(columnName);
if (null != sqlJson) {
return JSONObject.parseObject(sqlJson, clazz);
}
return null;
}
原因分析,子查询中包含多个条件参数,因此mybatis需要把column作为json解析才能知道id是哪个条件参数。
解决方法,修改级联查询代码:
<collection property="detailList" ofType="com.xxxDetail"
select="com.xxxDetailMapper.list" column="{backId=id}"/>
9、oracle模拟drop if exists
BEGIN
EXECUTE IMMEDIATE 'DROP TABLE abc';
EXCEPTION
WHEN OTHERS THEN
IF SQLCODE != -942 THEN
RAISE;
END IF;
END;
/
CREATE TABLE abc
(
ID VARCHAR2(128) NOT NULL,
TASK_STATUS NUMBER(2) NOT NULL,
SURGERY_CODE VARCHAR2(50)
);
10、连接seata报错can not register RM
linux服务器启动Seata后,Spring cloud项目连接seata报错:
can not connect to 192.168.122.1:8091 cause:can not register RM,err:can not connect to services-server
检查seata在nacos中的注册的服务信息发现,seata注册在nacos中的地址是192.168.122.1,本地ping或telnet均不成功,spring cloud项目通过服务名获取ip之后由于与192.168.122.1网络不通,所以报错can not connect to services-server
192.168.122.1来自virbr0网卡,这是因为安装系统的时候附带了libvirt服务才会生成的一个东西。virbr0 是 KVM 默认创建的一个 Bridge,其作用是为连接其上的
虚机网卡提供 NAT 访问外网的功能。
virbr0 默认分配了一个IP 192.168.122.1,并为连接其上的其他虚拟网卡提供 DHCP 服务。
解决方法,启动的时候指定外网ip,不要使用127.0.0.1
./seata-server.sh -h 192.168.xxx
边栏推荐
- 原型图设计
- 微软语音合成助手 v1.3 文本转语音工具,真实语音AI生成器
- 【 kubernets series】 a Literature Study on the Safe exposure Applications of kubernets Service
- [pointer training - eight questions]
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
- My C language learning record (blue bridge) -- under the pointer
- Apt installation ZABBIX
- js 正则过滤和增加富文本中图片前缀
- Which ecology is better, such as Mi family, graffiti, hilink, zhiting, etc? Analysis of five mainstream smart brands
- How does yyds dry inventory deal with repeated messages in the consumption process?
猜你喜欢
js 正则过滤和增加富文本中图片前缀
[Yu Yue education] basic reference materials of digital electronic technology of Xi'an University of Technology
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 9
【 kubernets series】 a Literature Study on the Safe exposure Applications of kubernets Service
My C language learning record (blue bridge) -- under the pointer
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
Apt installation ZABBIX
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
ReferenceError: primordials is not defined错误解决
随机推荐
Custom attribute access__ getattribute__/ Settings__ setattr__/ Delete__ delattr__ method
Introduction to robotframework (II) app startup of appui automation
Referenceerror: primordials is not defined error resolution
What should we pay attention to when using the built-in tool to check the health status in gbase 8C database?
JS regular filtering and adding image prefixes in rich text
[unity3d] GUI control
"Hands on learning in depth" Chapter 2 - preparatory knowledge_ 2.5 automatic differentiation_ Learning thinking and exercise answers
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 24
XSS challenges绕过防护策略进行 XSS 注入
会员积分营销系统操作的时候怎样提升消费者的积极性?
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
故障分析 | MySQL 耗尽主机内存一例分析
XSS challenges bypass the protection strategy for XSS injection
Communication between microservices
Single instance mode of encapsulating PDO with PHP in spare time
Sign SSL certificate as Ca
微服务注册与发现
Add one to non negative integers in the array
Large scale DDoS attacks take Myanmar offline
Network Security Learning - Web vulnerabilities (Part 1)