Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地运行配置改动 #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion novel-core/novel-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>io.github.xxyopen</groupId>
<artifactId>novel-cloud</artifactId>
<artifactId>novel-core</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
19 changes: 13 additions & 6 deletions novel-core/novel-config/src/main/resources/application-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ spring:
cloud:
nacos:
discovery:
server-addr: 192.168.10.110:8848
server-addr: 192.168.0.151:8848
openfeign:
lazy-attributes-resolution: true

Expand All @@ -23,7 +23,7 @@ spring:
--- #---------------------数据库配置---------------------------
spring:
datasource:
url: jdbc:mysql://localhost:3306/novel_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
url: jdbc:mysql://192.168.0.151:3306/novel-cloud?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: test123456
# ShardingSphere-JDBC 配置
Expand Down Expand Up @@ -53,7 +53,7 @@ spring:
ds_0:
type: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl: jdbc:mysql://localhost:3306/novel_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
jdbcUrl: jdbc:mysql://192.168.0.151:3306/novel-cloud?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
username: root
password: test123456
# 规则配置
Expand Down Expand Up @@ -85,13 +85,13 @@ spring:
data:
# Redis 配置
redis:
host: 127.0.0.1
host: 192.168.0.151
port: 6379
# password: 123456
password: test123456

# RabbitMQ 配置
rabbitmq:
addresses: "amqp://xxyopen:[email protected].10.110"
addresses: "amqp://xxyopen:[email protected].0.151"
virtual-host: novel
template:
retry:
Expand All @@ -112,6 +112,13 @@ management:
exposure:
# 公开所有的 Web 端点
include: "*"
# 端点启用配置
endpoint:
logfile:
# 启用返回日志文件内容的端点
enabled: true
# 外部日志文件路径
external-file: logs/novel.log
info:
env:
# 公开所有以 info. 开头的环境属性
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ spring:
cloud:
nacos:
config:
server-addr: 192.168.10.110:8848
server-addr: 192.168.0.151:8848
file-extension: yml
extension-configs[0]:
data‐id: novel-mysql.yml
Expand Down
2 changes: 1 addition & 1 deletion novel-gateway/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spring:
cloud:
nacos:
discovery:
server-addr: 192.168.10.110:8848
server-addr: 192.168.0.151:8848
gateway:
routes:
- id: novel-home-front
Expand Down
2 changes: 1 addition & 1 deletion novel-gateway/src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ spring:
cloud:
nacos:
config:
server-addr: 192.168.10.110:8848
server-addr: 192.168.0.151:8848
file-extension: yml


2 changes: 1 addition & 1 deletion novel-monitor/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ spring:
cloud:
nacos:
discovery:
server-addr: 192.168.10.110:8848
server-addr: 192.168.0.151:8848
boot:
admin:
discovery:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@

import co.elastic.clients.json.jackson.JacksonJsonpMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.elasticsearch.RestClientBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;

/**
* Elasticsearch 相关配置
*
Expand All @@ -42,8 +33,9 @@ JacksonJsonpMapper jacksonJsonpMapper() {
*/
@Bean
RestClient elasticsearchRestClient(RestClientBuilder restClientBuilder,
ObjectProvider<RestClientBuilderCustomizer> builderCustomizers) {
restClientBuilder.setHttpClientConfigCallback((HttpAsyncClientBuilder clientBuilder) -> {
ObjectProvider<RestClientBuilderCustomizer> builderCustomizers) {
//注释ssl报错 elasticsearch Unrecognized SSL message, plaintext connection?
/*restClientBuilder.setHttpClientConfigCallback((HttpAsyncClientBuilder clientBuilder) -> {
TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
@Override
public void checkClientTrusted(X509Certificate[] chain, String authType) {
Expand Down Expand Up @@ -73,7 +65,8 @@ public X509Certificate[] getAcceptedIssuers() {

builderCustomizers.orderedStream().forEach((customizer) -> customizer.customize(clientBuilder));
return clientBuilder;
});
});*/

return restClientBuilder.build();
}

Expand Down
6 changes: 3 additions & 3 deletions novel-search/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ spring:
active: dev
elasticsearch:
uris:
- https://127.0.0.1:9200
- http://192.168.0.151:9200
username: elastic
password: Fy2JWjJ1hcO2mi1USFLR
password: Fy2JWjJ1hcO2mi1USFL1

# XXL-JOB 配置
xxl:
job:
admin:
### 调度中心部署根地址 [选填]:如调度中心集群部署存在多个地址则用逗号分隔。执行器将会使用该地址进行"执行器心跳注册"和"任务结果回调";为空则关闭自动注册;
addresses: http://127.0.0.1:8080/xxl-job-admin
addresses: http://192.168.0.151:8080/xxl-job-admin
executor:
### 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
appname: xxl-job-executor-novel
Expand Down