Skip to content

Commit

Permalink
同步master
Browse files Browse the repository at this point in the history
  • Loading branch information
yenniechen committed Sep 14, 2020
1 parent b1e1e7c commit fcdfff4
Show file tree
Hide file tree
Showing 153 changed files with 38 additions and 12,582 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package org.joyqueue.toolkit.network;

import org.apache.commons.lang3.StringUtils;
import sun.net.util.IPAddressUtil;

import java.net.Inet4Address;
Expand Down Expand Up @@ -183,8 +182,9 @@ public static String getLocalIp(final String manageIp) {
public static String getLocalIp() {
// In JD.com IDC, this should be:
// return getLocalIp(NET_INTERFACE, MANAGE_IP);
String preferHostnameOverIp = System.getProperty(PREFER_HOSTNAME_OVERIP);
if (StringUtils.isNotBlank(preferHostnameOverIp) && Boolean.valueOf(preferHostnameOverIp.trim())) {

boolean preferHostnameOverIp = Boolean.valueOf(System.getProperty(PREFER_HOSTNAME_OVERIP));
if (preferHostnameOverIp) {
return getDefaultLocalHost();
} else {
return getDefaultLocalIp();
Expand Down
3 changes: 3 additions & 0 deletions joyqueue-console/joyqueue-portal/src/views/setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<d-menu-item name="namespace" icon="feather" :size="iconSize" :to="`/${ curLang }/setting/namespace`"><!--color="#73C6B6"-->
<span class="layout-text">{{ langConfig.namespace }}</span>
</d-menu-item>
<d-menu-item name="retryMonitor" icon="compass" :size="iconSize" :to="`/${ curLang }/setting/retryMonitor`"><!--color="#73C6B6"-->
<span class="layout-text">{{ langConfig.retryMonitor }}</span>
</d-menu-item>
</d-menu>
</layout-sider>
<layout-content>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Hikari will use the above plus the following to setup connection pooling
spring.main.banner-mode=off
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle=5
Expand All @@ -7,32 +8,35 @@ spring.datasource.hikari.pool-name=hikari
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1

# h2 datasource
#spring.datasource.driver=h2
#spring.datasource.driverClassName=org.h2.Driver
#spring.datasource.url=jdbc:h2:file:/jmq/data/joyqueue_web/h2/code-generator;AUTO_SERVER=TRUE;INIT=RUNSCRIPT FROM 'classpath:/schema/schema.sql'
#spring.datasource.username=sa
#spring.datasource.password=123456
# mysql datasource
spring.datasource.driver=mysql
spring.datasource.url=jdbc:mysql://114.67.253.214:3306/joyqueue_web
spring.datasource.driverClassName=com.mysql.jdbc.Driver
spring.datasource.username=joyqueue_web_admin
spring.datasource.password=lwPvlwXJ16_hsrM6
spring.datasource.schema=classpath:/schema/schema.sql
spring.datasource.initialization-mode=ALWAYS
# vertex
## Web服务端口,默认10031
spring.datasource.driver=h2
spring.datasource.url=jdbc:h2:file:~/.joyqueue_web/h2/code-generator;AUTO_SERVER=TRUE;INIT=RUNSCRIPT FROM 'classpath:/schema/schema.sql'
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=
spring.datasource.password=
spring.h2.console.enabled=true

# vertx
vertx.http.port=10031
vertx.routing.worker=true
vertx.routing.instances=6
vertx.routing.maxWorkerExecuteTime=6000000000
vertx.routing.workerPoolName=routing
vertx.routing.workerPoolSize=30
vertx.routing.multiThreads=true

# mybatis
mybatis.mapper-locations=classpath:mapper/*.xml
mybatis.config-location=classpath:mybatis-config.xml
## 提供元数据服务的JoyQueue Server地址和端口。支持配置多个地址,用逗号分开,默认端口为50091。例如:192.168.1.1,192.168.1.2:8888

# nameserver
joyqueue.servers=127.0.0.1:50091
#web.opts.memory=-DIGNITE_LOG_DIR=/jmq/data/logs
message.query.enabled=false
#s3
# replace by your key
s3.region=region
s3.endpoint=endpoint
s3.bucket.name=name
s3.access.key=accessKey
s3.secret.key=secretKey
Original file line number Diff line number Diff line change
Expand Up @@ -161,30 +161,6 @@ CREATE TABLE IF NOT EXISTS `topic_msg_filter` (
) ENGINE=InnoDB CHARSET=utf8;

-- init default admin USER
INSERT INTO
`user`(
`id`,
`code`,
`name`,
`org_id`,
`org_name`,
`email`,
`mobile`,
`role`,
`sign`,
`create_by`,
`create_time`,
`update_by`,
`update_time`,
`status`)
SELECT
1, 'admin', 'Admin', NULL, NULL, NULL, NULL, 1, 0, NULL, NOW(), -1, NOW(), 1
FROM
Dual
WHERE
NOT EXISTS (SELECT 1 FROM `user`);

-- init default admin USER
-- MERGE INTO `user`
-- (`id`, `code`, `name`, `org_id`, `org_name`, `email`, `mobile`, `role`, `sign`, `create_by`, `create_time`, `update_by`, `update_time`, `status`)
-- VALUES (1, 'admin', 'Admin', NULL, NULL, NULL, NULL, 1, 0, NULL, '2019-01-01 00:00:00', -1, '2019-01-01 00:00:00', 1);
MERGE INTO `user`
(`id`, `code`, `name`, `org_id`, `org_name`, `email`, `mobile`, `role`, `sign`, `create_by`, `create_time`, `update_by`, `update_time`, `status`)
VALUES (1, 'admin', 'Admin', NULL, NULL, NULL, NULL, 1, 0, NULL, '2019-01-01 00:00:00', -1, '2019-01-01 00:00:00', 1);
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
# nameserver.ignite.discoverySpi.networkTimeout 5000 ms Ignite服务发现超时
# nameserver.ignite.discoverySpi.ipFinder.address 127.0.0.1 Ignite本地服务发现地址范围,支持多个地址,例如:1.2.3.4,1.2.3.5:47500..47509
# nameserver.ignite.communicationSpi.localPort 48100 Ignite使用的通信端口号
# broker.opts.memory=-Xms2G -Xmx2G -server -Xss256K -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:CMSMaxAbortablePrecleanTime=20 -XX:-OmitStackTraceInFastThrow -XX:MaxDirectMemorySize=2G -DpreferHostnameOverIp=true -DlogFilePath=/.joyqueue/logs
# broker.opts.memory -Xms2G -Xmx2G -server -Xss256K -XX:SurvivorRatio=8 -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:CMSMaxAbortablePrecleanTime=20 -XX:-OmitStackTraceInFastThrow -XX:MaxDirectMemorySize=2G jvm 参数。
15 changes: 2 additions & 13 deletions joyqueue-distribution/joyqueue-distribution-server/conf/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,17 @@
-->
<!-- 临时 -->
<configuration monitorInterval="30">
<properties>
<property name="log_file" value="${sys:logFilePath:-${sys:user.home}/.joyqueue/logs}" />
</properties>
<configuration>
<appenders>
<console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="[%d{HH:mm:ss:SSS}] [%t] [%p] - %l - %m%n"/>

</console>

<RollingFile name="defaultRollingFile" fileName="${log_file}/error.log"
filePattern="${log_file}/$${date:yyyy-MM}/error-%d{yyyy-MM-dd}-%i.log">
<PatternLayout pattern="[%d{yyyy-MM-dd HH:mm:ss:SSS}] [%t] [%p] - %l - %m%n"/>
<Policies>
<SizeBasedTriggeringPolicy size="2000MB"/>
</Policies>
<DefaultRolloverStrategy max="30"/>
</RollingFile>
</appenders>
<loggers>
<root level="INFO">
<appender-ref ref="Console"/>
<appender-ref ref="defaultRollingFile"/>
</root>
<logger name="org.apache.ignite.internal.IgniteKernal" additivity="false">
<level value ="OFF"/>
Expand Down
6 changes: 1 addition & 5 deletions joyqueue-distribution/joyqueue-distribution-web/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,11 @@ fi
# ------ set CLASSPATH
CLASSPATH="$BASEDIR"/conf/:"$BASEDIR"/root/:"$BASEDIR"/lib/*
echo "$CLASSPATH"
CONFIG_FILE="$BASEDIR/conf/application.properties"

OPTS_MEMORY=`grep -ios '\s*web.opts.memory=.*$' ${CONFIG_FILE} | tr -d '\r'`
OPTS_MEMORY=${OPTS_MEMORY#*=}

#DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"
#JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
# ------ run proxy
"$JAVACMD" $JPDA_OPTS $OPTS_MEMORY \
"$JAVACMD" $JPDA_OPTS \
-classpath "$CLASSPATH" \
-Dbasedir="$BASEDIR" \
-Dfile.encoding="UTF-8" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,4 @@ mybatis.config-location=classpath:mybatis-config.xml


## 提供元数据服务的JoyQueue Server地址和端口。支持配置多个地址,用逗号分开,默认端口为50091。例如:192.168.1.1,192.168.1.2:8888
joyqueue.servers=127.0.0.1:50091

# jvm options
#web.opts.memory=-Xms2G -Xmx2G -Xmn1G -server -XX:+PrintGCDetails -Xloggc:${user.home}/logs/gc.log -Xss256K -XX:SurvivorRatio=8 -XX:+UseG1GC -XX:+PrintGCTimeStamps -DIGNITE_LOG_DIR=${user.home}/.joyqueue/web/logs -DJM.LOG.PATH=${user.home}/.joyqueue/web/logs -Dvertx.logger-delegate-factory-class-name=io.vertx.core.logging.SLF4JLogDelegateFactory
joyqueue.servers=127.0.0.1:50091
21 changes: 2 additions & 19 deletions joyqueue-distribution/joyqueue-distribution-web/conf/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-->
<configuration debug="false">
<property name="log_file" value="${IGNITE_LOG_DIR:-${user.name}/.joyqueue/web/logs}/error" />
<property name="log_file" value="/export/Logs/joyqueue" />
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<!-- reset all previous level configurations of all j.u.l. loggers -->
<resetJUL>true</resetJUL>
Expand All @@ -29,29 +29,12 @@
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %boldYellow([%thread]) %highlight(%-5level) %green(%logger{50}) - %msg%n</pattern>
</encoder>
</appender>
<!-- 按照每天生成日志文件 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log_file}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--日志文件输出的文件名-->
<fileNamePattern>${log_file}.%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<!--每个日志文件大小-->
<maxFileSize>100MB</maxFileSize>
<totalSizeCap>10GB</totalSizeCap>
<!--日志文件保留天数-->
<maxHistory>14</maxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
</encoder>
</appender>

<!-- Spring framework logger -->
<logger name="org.springframework" level="info" />

<!-- 日志输出级别 -->
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
</root>
</configuration>
5 changes: 0 additions & 5 deletions joyqueue-distribution/joyqueue-distribution-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@
<artifactId>joyqueue-web-application</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.joyqueue</groupId>
<artifactId>joyqueue-portal</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
Expand Down
20 changes: 0 additions & 20 deletions joyqueue-server/jmq-broker-jmq2/pom.xml

This file was deleted.

This file was deleted.

Loading

0 comments on commit fcdfff4

Please sign in to comment.