Skip to content

Commit

Permalink
[INLONG-9806][Agent] Add installer configuration file (#9815)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinwwhuang authored Mar 14, 2024
1 parent b6e1064 commit b08d161
Show file tree
Hide file tree
Showing 4 changed files with 319 additions and 0 deletions.
63 changes: 63 additions & 0 deletions inlong-agent/agent-installer/assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>bin</id>
<formats>
<format>dir</format>
<format>tar.gz</format>
</formats>

<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!-- for bin -->
<fileSet>
<directory>../bin</directory>
<includes>
<include>*.*</include>
</includes>
<excludes>
<exclude>*rock*</exclude>
</excludes>
<fileMode>0755</fileMode>
<outputDirectory>bin</outputDirectory>
<lineEnding>unix</lineEnding>
</fileSet>

<!-- for configs -->
<fileSet>
<directory>conf</directory>
<includes>
<include>*.*</include>
</includes>
<outputDirectory>conf</outputDirectory>
<lineEnding>unix</lineEnding>
</fileSet>
</fileSets>
<!-- for sub-module dependencies -->
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<useTransitiveDependencies>true</useTransitiveDependencies>
<outputDirectory>lib</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
43 changes: 43 additions & 0 deletions inlong-agent/agent-installer/conf/installer.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#######################
# common config
#######################
local.ip=127.0.0.1
agent.enable.oom.exit=false

############################
# manager config
############################
manager.addr=http://127.0.0.1:8083
manager.auth.secretId=
manager.auth.secretKey=

############################
# cluster config for automatically report and register
############################
cluster.tag=default_cluster
cluster.name=default_agent

############################
# audit config
############################
# whether to enable audit
audit.enable=true
# audit proxy address
audit.proxys=127.0.0.1:10081
175 changes: 175 additions & 0 deletions inlong-agent/agent-installer/conf/log4j2.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<configuration status="WARN" monitorInterval="30">
<Properties>
<property name="basePath">${sys:agent.home}/logs</property>
<property name="log_pattern">[%X{trace_id} %X{span_id}] %d{yyyy-MM-dd HH:mm:ss.SSS} -%5p ${PID:-} [%30.30t] %-30.30C{1.}:%L %m%n</property>
<property name="every_file_date">1</property>
<property name="every_file_size">1G</property>
<property name="output_log_level">INFO</property>
<property name="rolling_max">15</property>
<property name="debug_fileName">${basePath}/debug.log</property>
<property name="debug_filePattern">${basePath}/debug-%d{yyyy-MM-dd}-%i.log.gz</property>
<property name="debug_max">10</property>
<property name="info_fileName">${basePath}/info.log</property>
<property name="info_filePattern">${basePath}/info-%d{yyyy-MM-dd}-%i.log.gz</property>
<property name="info_max">10</property>
<property name="warn_fileName">${basePath}/warn.log</property>
<property name="warn_filePattern">${basePath}/warn-%d{yyyy-MM-dd}-%i.log.gz</property>
<property name="warn_max">10</property>
<property name="error_fileName">${basePath}/error.log</property>
<property name="error_filePattern">${basePath}/error-%d{yyyy-MM-dd}-%i.log.gz</property>
<property name="error_max">10</property>
<property name="console_print_level">INFO</property>
<property name="index_max">10</property>
<property name="index_fileName">${basePath}/index.log</property>
<property name="index_filePattern">${basePath}/index-%d{yyyy-MM-dd}-%i.log.gz</property>
<property name="monitors_max">10</property>
<property name="monitors_fileName">${basePath}/monitors.log</property>
<property name="monitors_filePattern">${basePath}/monitors-%d{yyyy-MM-dd}-%i.log.gz</property>
<property name="last_modify_time">15d</property>
</Properties>

<appenders>
<Console name="Console" target="SYSTEM_OUT">
<ThresholdFilter level="${console_print_level}" onMatch="ACCEPT" onMismatch="DENY"/>
<PatternLayout pattern="${log_pattern}"/>
</Console>

<RollingFile name="DebugFile" fileName="${debug_fileName}" filePattern="${debug_filePattern}">
<PatternLayout pattern="${log_pattern}"/>
<Policies>
<TimeBasedTriggeringPolicy interval="${every_file_date}"/>
<SizeBasedTriggeringPolicy size="${every_file_size}"/>]
</Policies>
<DefaultRolloverStrategy max="${debug_max}">
<Delete basePath="${basePath}" maxDepth="1">
<IfFileName glob="debug*.log.gz"/>
<IfLastModified age="${last_modify_time}"/>
</Delete>
</DefaultRolloverStrategy>
<Filters>
<ThresholdFilter level="WARN" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="INFO" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</RollingFile>

<RollingFile name="InfoFile" fileName="${info_fileName}" filePattern="${info_filePattern}">
<PatternLayout pattern="${log_pattern}"/>
<Policies>
<TimeBasedTriggeringPolicy interval="${every_file_date}"/>
<SizeBasedTriggeringPolicy size="${every_file_size}"/>
</Policies>
<DefaultRolloverStrategy max="${info_max}">
<Delete basePath="${basePath}" maxDepth="1">
<IfFileName glob="info*.log.gz"/>
<IfLastModified age="${last_modify_time}"/>
</Delete>
</DefaultRolloverStrategy>
<Filters>
<ThresholdFilter level="WARN" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</RollingFile>

<RollingFile name="IndexFile" fileName="${index_fileName}" filePattern="${index_filePattern}">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy interval="${every_file_date}"/>
<SizeBasedTriggeringPolicy size="${every_file_size}"/>
</Policies>
<DefaultRolloverStrategy max="${index_max}">
<Delete basePath="${basePath}" maxDepth="1">
<IfFileName glob="index*.log.gz"/>
<IfLastModified age="${last_modify_time}"/>
</Delete>
</DefaultRolloverStrategy>
<Filters>
<ThresholdFilter level="WARN" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</RollingFile>

<RollingFile name="MonitorFile" fileName="${monitors_fileName}" filePattern="${monitors_filePattern}">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss} %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy interval="${every_file_date}"/>
<SizeBasedTriggeringPolicy size="${every_file_size}"/>
</Policies>
<DefaultRolloverStrategy max="${monitors_max}">
<Delete basePath="${basePath}" maxDepth="1">
<IfFileName glob="monitors*.log.gz"/>
<IfLastModified age="${last_modify_time}"/>
</Delete>
</DefaultRolloverStrategy>
<Filters>
<ThresholdFilter level="WARN" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</RollingFile>

<RollingFile name="WarnFile" fileName="${warn_fileName}" filePattern="${warn_filePattern}">
<PatternLayout pattern="${log_pattern}"/>
<Policies>
<TimeBasedTriggeringPolicy interval="${every_file_date}"/>
<SizeBasedTriggeringPolicy size="${every_file_size}"/>
</Policies>
<DefaultRolloverStrategy max="${warn_max}">
<Delete basePath="${basePath}" maxDepth="1">
<IfFileName glob="warn*.log.gz"/>
<IfLastModified age="${last_modify_time}"/>
</Delete>
</DefaultRolloverStrategy>
<Filters>
<ThresholdFilter level="ERROR" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="WARN" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</RollingFile>

<RollingFile name="ErrorFile" fileName="${error_fileName}" filePattern="${error_filePattern}">
<PatternLayout pattern="${log_pattern}"/>
<Policies>
<TimeBasedTriggeringPolicy interval="${every_file_date}"/>
<SizeBasedTriggeringPolicy size="${every_file_size}"/>
</Policies>
<DefaultRolloverStrategy max="${error_max}">
<Delete basePath="${basePath}" maxDepth="1">
<IfFileName glob="error*.log.gz"/>
<IfLastModified age="${last_modify_time}"/>
</Delete>
</DefaultRolloverStrategy>
<Filters>
<ThresholdFilter level="FATAL" onMatch="DENY" onMismatch="NEUTRAL"/>
<ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</RollingFile>
</appenders>

<loggers>
<root level="${output_log_level}">
<appender-ref ref="Console"/>
<appender-ref ref="DebugFile"/>
<appender-ref ref="InfoFile"/>
<appender-ref ref="WarnFile"/>
<appender-ref ref="ErrorFile"/>
</root>
</loggers>
</configuration>
38 changes: 38 additions & 0 deletions inlong-agent/agent-installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,50 @@
<artifactId>agent-common</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.rocksdb</groupId>
<artifactId>rocksdbjni</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.inlong</groupId>
<artifactId>agent-core</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.rocksdb</groupId>
<artifactId>rocksdbjni</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${plugin.assembly.version}</version>
<executions>
<execution>
<id>make-assembly</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<finalName>apache-inlong-agent-installer-${project.version}</finalName>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<tarLongFileMode>posix</tarLongFileMode>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit b08d161

Please sign in to comment.