Commit Graph

129 Commits

Author SHA1 Message Date
980f28f9e2 [feat](docker)Modify the init_be and start_be scripts to meet the requirements for rapid Docker startup(Merge 2.1). (#45858)
### What problem does this PR solve?

Issue Number: close #xxx

Related PR: #45267

Master PR: #45269

Problem Summary:

To meet the needs of rapid Docker startup, I have made adjustments to
two related scripts in the Docker startup process. First, I added a env
`SKIP_CHECK_ULIMIT` to the `start_be.sh` script, which will skip the
size checks for `swap`, `ulimit`, and `max_map_count`. At the same time,
I used `--console` to start the process and print logs. The reason why I
did not use the `--daemon` daemon command to execute is that starting
with a foreground log printing method in a Docker container is the
correct and reliable approach.

At the same time, I added a check logic for a `be.conf` configuration
item in the `init_be.sh` script: if it is the first time starting,
append the export `SKIP_CHECK_ULIMIT=true` to skip the `ulimit` value
check in the BE process. In summary, these adjustments can meet the
basic requirements for rapid Docker startup usage.
2024-12-25 12:11:14 +08:00
02fdf5307c [pick](branch-2.1) pick #42059 (#44938) 2024-12-04 17:49:08 +08:00
d32688e091 [Enhancement](multi-catalog) Set hdfs native client logger to glog and redirect jvm stdout/stderr logger to jni.log. (#41633)
Backport #39540.

Co-authored-by: Mingyu Chen <morningman@163.com>
2024-10-10 17:47:21 +08:00
f16615a1fc [branch-2.1](memory) Allocator support address sanitizers (#40836)
pick
#33396
#33862
#33853
#33732
#33841
#33933
#34901
#35014

---------

Co-authored-by: yiguolei <676222867@qq.com>
Co-authored-by: yiguolei <yiguolei@gmail.com>
2024-09-14 12:12:44 +08:00
44b87cb5ba [chore](script message) More convenient error msg for nofile open. #39642 (#40195)
cherry pick from #39642
2024-08-31 00:18:20 +08:00
baf5b71b39 [branch-2.1](memory) Modify thedefault JEMALLOC_CONF and support flush Jemalloc tcache (#39829)
pick #38185
2024-08-23 17:21:42 +08:00
4030164270 [feature](tools) embed async profiler to help user generate flame graph for frontend (#36018)
cherry pick from #35010
2024-06-07 15:38:01 +08:00
c794ea18c8 [fix](multi-catalog)put java udf to custom lib (#35984)
bp #34990
2024-06-06 22:54:24 +08:00
fbc82e0253 [opt](log) refine the BE logger (#35942) (#35988)
bp #35942
2024-06-06 22:25:22 +08:00
5c8f87e01e [opt](log) refine the FE logger (#35679)
Previously, FE logs were written to files. The main FE logs include
fe.log, fe.warn.log, fe.audit.log, fe.out, and fe.gc.log.
In a K8s deployment environment, logs usually need to be output to
standard output, and then other components process the log stream.

This PR made the following changes:

1. Modified the log4j configuration template

- When started with `--daemon`, logs are still written to various files,
and the format remains unchanged.
- When started with `--console`, all logs are output to standard output
and marked with different prefixes:

		- `StdoutLogger`: logs for standard output
		- `StderrLogger`: logs for standard error output
		- `RuntimeLogger`: logs for fe.log or fe.warn.log
		- `AuditLogger:` logs for fe.audit.log
		- No prefix: logs for fe.gc.log

		Examples are as follows:

		```
RuntimeLogger 2024-06-03 14:54:51,229 INFO (binlog-gcer|62)
[BinlogManager.gc():359] begin gc binlog
		```

2. Added a new FE config: `enable_file_logger`

Defaults to true. Indicates that logs will be recorded to files
regardless of the startup method. For example, if it is started with
`--console`, the log will be output to both the file and the standard
output. If it is `false`, the log will not be recorded in the file
regardless of the startup method.

3. Optimized the log format of standard output

The byte streams of stdout and stderr are captured. The logs previously
outputted using `System.out` will be captured in fe.log for unified
management.
2024-06-04 18:20:30 +08:00
38c5030f97 [opt](log) refactor the log dir config (#32933)
Refactor the config for log dir of FE and BE

TLDR:
- Use env variable `LOG_DIR` to set root log dir
- Remove `sys_log_dir` for FE and BE

Details:

1. FE

    1. The root log dir is set by env variable `LOG_DIR` in `fe.conf`
    2. The default value of `audit_log_dir` is same as `${LOG_DIR}/`
    3. The default value of `spark_launcher_log_dir` is `${LOG_DIR}/spark_launcher_log`
    4. The default value of `nereids_trace_log_dir` is `${LOG_DIR}/nereids_trace_log`
    5. The origin `sys_log_dir` is deprecated, and default value is `""`.
        But for compatibility, if user already set `sys_log_dir` before, Doris will still use it as root log dir.

2. BE

     1. The root log dir is set by env variable `LOG_DIR` in `be.conf`
     2. Remove `pipeline_tracing_log_dir`, use `${LOG_DIR}` directly.
     3. The origin `sys_log_dir` is deprecated, and default value is `""`.
         But for compatibility, if user already set `sys_log_dir` before, Doris will still use it as root log dir.
2024-04-17 23:41:59 +08:00
c0d7a5660e [fix](paimon) support paimon with hive2 (#32455)
In order to support paimon with hive2, we need to modify the origin HiveMetastoreClient.java
to let it compatible with both hive2 and hive3.
And this modified HiveMetastoreClient should be at the front of the CLASSPATH, so that
it can overwrite the HiveMetastoreClient in hadoop jar.

This PR mainly changes:

1. Copy HiveMetastoreClient.java in FE to BE's preload jar.

2. Split the origin `preload-extensions-jar-with-dependencies.jar` into 2 jars
    1. `preload-extensions-project.jar`, which contains the modified HiveMetastoreClient.
    2. `preload-extensions-jar-with-dependencies.jar`, which contains other dependency jars.

3. Modify the `start_be.sh`, to let `preload-extensions-project.jar` be loaded first.

4. Change the way the assemble the jni scanner jar
    Only need to assemble the project jar, without other dependencies.
    Because actually we only use classed under `org.apache.doris` package.
    So remove other unused dependency jars can also reduce the output size of BE.

5. fix bug that the prefix of paimon properties should be `paimon.`, not `paimon`

6. Support paimon with hive2
    User can set `hive.version` in paimon catalog properties to specify the hive version.
2024-03-26 15:31:07 +08:00
c33277a957 [fix](script) Fix the JAVA_OPTS set on macOS (#32170) 2024-03-15 18:01:56 +08:00
6ea5218ee8 Revert "[Enhencement](env) Checking Master branch must use JDK17 (#31587)"
This reverts commit fa499cc200344eaaf837fd52211820dc7b7b9296.
2024-03-06 13:13:49 +08:00
fa499cc200 [Enhencement](env) Checking Master branch must use JDK17 (#31587)
Add to check the JDK version in `env.sh`,  and force master to use java 17 version
2024-03-06 13:05:58 +08:00
9508546cc8 [fix](script) Fix start_fe.sh missing METADATA_FAILURE_RECOVERY with foreground (#31258) 2024-02-23 19:03:28 +08:00
f9e16e08eb [fix](script) Fix start_fe.sh --image path check image not work (#30695) 2024-02-18 11:50:17 +08:00
ea427e8c51 [fix](JDK17) It will report an exception whenwe start BE with JDK17 and query AVRO table : InaccessibleObjectException (#30541)
* [fix](JDK17) It will report an exception whenwe start BE with JDK17 and query AVRO  table : InaccessibleObjectException (#30003)
2024-01-30 15:33:40 +08:00
b1a9370004 [fix](glue)support access glue iceberg with credential list (#30473)
merge from #30292
2024-01-28 18:23:07 +08:00
9773fef4a1 [fix](class-loader) fix class loader conflict on BE side (#29942)
1. make `hadoop-common` in be java extension as `provided`.
2. must load be java extension jars before hadoop jars
2024-01-16 18:37:06 +08:00
25428bd7fb [fix](kerberos) fix BE kerberos ccache renew, optimize kerbero options (#29291)
1. we need  remove BE kinit, and use jni login with keytab, because kinit cannot renew TGT for doris in many complex cases.
> This pull requet will support new instance from keytab: https://github.com/apache/doris-thirdparty/pull/173, so now we  won't need kinit cmd, just login with keytab and principal

2. add `kerberos_ccache_path` to set kerberos credentials cache path manually.

3. add `max_hdfs_file_handle_cache_time_ms` to set hdfs fs handle cache time.
2024-01-16 18:35:29 +08:00
12af86176a [fix](class-loader) fix class loader conflict on BE side (#29942)
1. make `hadoop-common` in be java extension as `provided`.
2. must load be java extension jars before hadoop jars
2024-01-14 15:53:33 +08:00
8fc9c18c85 [improvement](jdbc catalog) Put the jdbc connection pool parameters into catalog properties (#29195) 2024-01-12 11:40:28 +08:00
b31028196c Revert "[feature](script) Add check_jvm_xmx for start_fe.sh (#28989)" (#29630)
This reverts commit 8c9908c7b4f575b41e01ae2a81b4423da6a12c3c.
2024-01-07 14:02:02 +08:00
8c9908c7b4 [feature](script) Add check_jvm_xmx for start_fe.sh (#28989)
* When -Xmx is configured more than 90% of total physical memory, start_fe.sh
  will not allowed to start, because fe maybe been killed by operating system
  with a high probability.
2024-01-06 20:11:54 +08:00
10368a71a4 [fix][security]security optimize for executable binary file doris_be access should be restricted (#29303) 2023-12-30 23:39:16 +08:00
f87c807979 [enhancement](jdk) support doris fe running in jvm with jdk16+ (#26889) 2023-11-15 10:27:30 +08:00
d2eea9b3ae [chore](macOS) Reduce the size of executables on macOS arm64 (#26894)
Like #15641, we should reduce the size of executables on macOS arm64. Otherwise, we can not run doris_be and doris_be_test with ASAN build type on macOS arm64 now.
2023-11-14 12:21:08 +08:00
3faf3b4118 [chore] Print FE version even if it has been started (#26427)
In the previous implementation, `bin/start_fe.sh --version` will
complain that "Frontend running as process xxx. Stop it first."

To show version
1. `bin/start_fe.sh --version` will print version info to fe.out
2. `bin/start_fe.sh --console --version` will print version info to stdout
2023-11-07 22:33:02 +08:00
2feed57f47 [Fix](fs_benchmark_tools) Fix run_fs_benchmark.sh classpath issue. (#26183)
Fix run_fs_benchmark.sh classpath issue.
2023-11-07 18:43:30 +08:00
9ea8efe5fa [coverage](fe)add jacoco coverage option on start_fe.sh (#25598) 2023-10-20 10:13:03 +08:00
f41b6a5fc3 [minor](doc) update the doc for docker env and custom_lib dir (#25088)
1. Update the doc for `apache/doris:build-env-for-2.0`
2. Update the doc for `custom_dir`
2023-10-09 09:50:31 +08:00
07f9f27fa9 [improvement](start script) start script can not set http proxy (#25086)
be clone snapshot using http, if set http proxy, then be clone snapshot will failed. so the start script forbit set env http proxy.
2023-10-08 10:06:06 +08:00
9d0f4c0094 [minor](be) set fd number check to 60000 for BE start script (#25078)
Modify the BE fd number check to 60000,
because the default fd number value of some system is 65535, which is smaller than previous threshold 65536,
so reduce to 60000 to let Doris start normally in most of system.
2023-10-07 19:02:39 +08:00
8a226bbd63 [fix](start_be) ignore output from command -v (#24739) 2023-09-21 19:57:43 +08:00
4c79a76491 [improve](script) echo infos if java cmd is not valid when starting be (#24714)
Co-authored-by: stephen <hello-stephen@qq.com>
2023-09-21 12:43:24 +08:00
xyf
9ccce61836 [chore](thirdparty)We need to issue an error when starting FE without setting the Java home environment (#23943)
---------

Co-authored-by: yiguolei <676222867@qq.com>
2023-09-21 08:10:36 +08:00
1a553f7e14 [Improve](start-shell)Optimize fe&be startup (#24556)
- sh start_fe/start_be --console is used to instruct the program to run in console mode.
- sh start_fe/start_be --daemon is used to instruct the program to run in daemon mode.
- sh start_fe/start_be used starts as a background execution, records output and error logs to the specified file
2023-09-19 23:00:59 +08:00
64337a8698 [Improve](metadata)Start the script to set metadata_failure_recovery (#24308) 2023-09-14 10:02:35 +08:00
e090b83e33 [improvemnt](script) support custom lib dir to save custom libs (#23887)
Sometimes, user need to add some custom libs to the cluster, such lzo.jar, orai18n.jar, etc.
In previous, these lib files are places in fe/lib or be/lib.
But when upgrading cluster, the lib dir will be replaced by new lib dir, so that all custom libs are lost.

In this PR, I add new dir custom_lib for FE and BE, and user can place custom lib files in it.
2023-09-05 11:54:19 +08:00
774a771e0c [Improve](be)check swap (#18891)
Co-authored-by: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com>
2023-09-05 09:39:55 +08:00
2885de1d63 [chore](macOS) Fix invalid option errors in start_be.sh (#23861) 2023-09-05 09:07:53 +08:00
57ca7d66d3 [Fix](multi-catalog) Fix zlib init error by using doris's zlib shared library and jni.log does not output. (#23260) 2023-09-02 21:44:14 +08:00
ffadf09eec [fix](catalog)add custom jar (#23406)
- allow put custom jar in `${DORIS_HOME}/lib/java_extensions/custom_extension` such as `paimon-s3-0.4.0-incubating.jar`
- add some note for paimon and fqdn
2023-08-25 11:10:53 +08:00
5ba505ebf4 [fix](multi-catalog)fix avro and jdbc scanner dependency (#23015)
add preload-extensions module, put all conflict dependencies to pom.xml in preload-extensions
2023-08-20 19:28:17 +08:00
919bfd73f1 [improvement](multi-catalog)add scanner isolation class loader (#22247)
Add scanner isolation class loader to make each plugin non-conflicting.
The BE will get scanner classes by JNI call and use JniClassLoader load them.
In the last version,we always get canner classes from the system class path by default,
so it cannot isolate the classes for each scanner
2023-08-10 10:02:46 +08:00
96a46302e8 [fix](stacktrace) Fix Jemalloc enable profile fail to run BE after rewrites dl_iterate_phdr (#22549)
Jemalloc heap profile follows libgcc's way of backtracing by default.
rewrites dl_iterate_phdr will cause Jemalloc to fail to run after enable profile.

TODO, two solutions:

- Jemalloc specifies GNU libunwind as the prof backtracing way, but my test failed,
--enable-prof-libunwind not work: --enable-prof-libunwind not work jemalloc/jemalloc#2504

- ClickHouse/libunwind solves Jemalloc profile backtracing, but the branch of ClickHouse/libunwind
has been out of touch with GNU libunwind and LLVM libunwind, which will leave the fate to others.
2023-08-03 19:32:36 +08:00
bc87002028 [opt](conf) remote scanner thread num is changed to core num * 10 (#22427) 2023-08-01 23:09:49 +08:00
e8f4323e0f [Fix](jdbcCatalog) fix typo of some variable #22214 2023-07-26 08:34:45 +08:00
1afe090486 [improvement](memory) modify jemalloc conf in be.conf (#21943)
modify jemalloc conf in be.conf
    disable je_purge_all_arena_dirty_pages
2023-07-20 10:34:31 +08:00