当前位置: 首页 > news >正文

oceanbase的日志量太大,撑爆磁盘,修改下日志级别

oceanbase的日志量太大,撑爆磁盘,修改下日志级别:

[admin@lnpg ~]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
Welcome to the OceanBase.  Commands end with ; or \g.
Your OceanBase connection id is 3221561020
Server version: OceanBase 3.2.4.1 (r101000052023010822-346aa35c32e99d1b82d713f75f0072c45bdf7aab) (Built Jan  8 2023 22:52:43)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

obclient [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| oceanbase          |
| information_schema |
| mysql              |
| SYS                |
| LBACSYS            |
| ORAAUDITOR         |
| test               |
+--------------------+
7 rows in set (0.081 sec)

obclient [(none)]> use oceanbase;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
obclient [oceanbase]> ALTER SYSTEM SET syslog_level=OFF;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'OFF' at line 1
obclient [oceanbase]> SHOW PARAMETERS LIKE '%syslog_level%';
+-------+----------+-----------------+----------+---------------------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone  | svr_type | svr_ip          | svr_port | name                | data_type | value | info                                                                                                                                   | section  | scope   | source  | edit_level        |
+-------+----------+-----------------+----------+---------------------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone1 | observer | 192.168.207.143 |     2882 | ob_esi_syslog_level | NULL      | WDIAG | specifies the current level of logging for obesi. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels. | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | 192.168.207.143 |     2882 | syslog_level        | NULL      | WDIAG | specifies the current level of logging. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels.           | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+-----------------+----------+---------------------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
2 rows in set (0.013 sec)

obclient [oceanbase]> ALTER SYSTEM SET syslog_level='sql.*:error, common.*:error';
Query OK, 0 rows affected (0.027 sec)

obclient [oceanbase]> ALTER SYSTEM SET ob_esi_syslog_level='sql.*:error, common.*:error';
Query OK, 0 rows affected (0.028 sec)

obclient [oceanbase]> SHOW PARAMETERS LIKE '%syslog_level%';
+-------+----------+-----------------+----------+---------------------+-----------+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone  | svr_type | svr_ip          | svr_port | name                | data_type | value                       | info                                                                                                                                   | section  | scope   | source  | edit_level        |
+-------+----------+-----------------+----------+---------------------+-----------+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone1 | observer | 192.168.207.143 |     2882 | ob_esi_syslog_level | NULL      | sql.*:error, common.*:error | specifies the current level of logging for obesi. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels. | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | 192.168.207.143 |     2882 | syslog_level        | NULL      | sql.*:error, common.*:error | specifies the current level of logging. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels.           | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+-----------------+----------+---------------------+-----------+-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
2 rows in set (0.002 sec)

[admin@lnpg log]$ pwd
/home/admin/oceanbase/log
[admin@lnpg log]$ ls -lt
total 362364
-rw-r--r-- 1 admin admin  41844056 Oct 14 14:46 observer.log
-rw-r--r-- 1 admin admin  33424227 Oct 14 14:46 rootservice.log
-rw-r--r-- 1 admin admin   1506607 Oct 14 14:46 obesi-daemon.log
-rw-r--r-- 1 admin admin     21754 Oct 14 14:46 election.log
-rw-r--r-- 1 admin admin       295 Oct 14 14:42 observer.log.wf
-rw-r--r-- 1 admin admin 268462084 Oct 14 14:42 observer.log.20241014144215329

上述修改还是打印出了很多INFO信息 

需要这样改才有效:

obclient [(none)]> ALTER SYSTEM SET syslog_level='ERROR';
Query OK, 0 rows affected (0.026 sec)

obclient [(none)]> ALTER SYSTEM SET ob_esi_syslog_level='ERROR';
Query OK, 0 rows affected (0.025 sec)

obclient [(none)]> SHOW PARAMETERS LIKE '%syslog_level%';
+-------+----------+-----------------+----------+---------------------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone  | svr_type | svr_ip          | svr_port | name                | data_type | value | info                                                                                                                                   | section  | scope   | source  | edit_level        |
+-------+----------+-----------------+----------+---------------------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone1 | observer | 192.168.207.143 |     2882 | ob_esi_syslog_level | NULL      | ERROR | specifies the current level of logging for obesi. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels. | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | 192.168.207.143 |     2882 | syslog_level        | NULL      | ERROR | specifies the current level of logging. There are DEBUG, TRACE, WDIAG, EDIAG, INFO, WARN, ERROR, seven different log levels.           | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+-----------------+----------+---------------------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
2 rows in set (0.002 sec)

停止observer服务:

[admin@lnpg log]$ pgrep observer
32239
[admin@lnpg log]$ kill -9 `pgrep observer`


[admin@lnpg log]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)
[admin@lnpg log]$ /home/admin/oceanbase/bin/observer
/home/admin/oceanbase/bin/observer
[admin@lnpg log]$ 
[admin@lnpg log]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)
[admin@lnpg log]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)
[admin@lnpg log]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)
[admin@lnpg log]$ pgrep observer
[admin@lnpg log]$ pgrep observer
[admin@lnpg log]$ pgrep observer
[admin@lnpg log]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
ERROR 2002 (HY000): Can't connect to MySQL server on '127.0.0.1' (115)
[admin@lnpg log]$ ps -ef|grep observer
admin    15555 10446  0 14:48 pts/2    00:00:00 grep --color=auto observer

必须这种方式启动,不能用绝对路径:
[admin@lnpg log]$ cd /home/admin/oceanbase/
[admin@lnpg oceanbase]$ ./bin/observer

./bin/observer
[admin@lnpg oceanbase]$ ps -ef|grep observer
admin    15609     1 99 14:48 ?        00:00:04 ./bin/observer
admin    16597 10446  0 14:48 pts/2    00:00:00 grep --color=auto observer
[admin@lnpg oceanbase]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
ERROR 1045 (42000): Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)
[admin@lnpg oceanbase]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
ERROR 1045 (42000): Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)
[admin@lnpg oceanbase]$ ps -ef|grep observer
admin    15609     1 99 14:48 ?        00:00:36 ./bin/observer
admin    16695 10446  0 14:48 pts/2    00:00:00 grep --color=auto observer
[admin@lnpg oceanbase]$ ps -ef|grep observer
admin    15609     1 99 14:48 ?        00:01:10 ./bin/observer
admin    16896 10446  0 14:48 pts/2    00:00:00 grep --color=auto observer
[admin@lnpg oceanbase]$ pgrep observer
15609
[admin@lnpg oceanbase]$ ps -ef|grep 15609
admin    15609     1 99 14:48 ?        00:01:58 ./bin/observer
admin    15672 15609  1 14:48 ?        00:00:00 /home/admin/oceanbase/bin/obesi -d -p 2882 -c 10001
admin    16909 10446  0 14:49 pts/2    00:00:00 grep --color=auto 15609
[admin@lnpg oceanbase]$ netstat -tunlp|grep 288
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:2881            0.0.0.0:*               LISTEN      15609/./bin/observe 
tcp        0      0 0.0.0.0:2882            0.0.0.0:*               LISTEN      15609/./bin/observe 
[admin@lnpg oceanbase]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
ERROR 1045 (42000): Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)
[admin@lnpg oceanbase]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
ERROR 1045 (42000): Access denied for user 'root'@'xxx.xxx.xxx.xxx' (using password: YES)
[admin@lnpg oceanbase]$ pwd
/home/admin/oceanbase
[admin@lnpg oceanbase]$ cd log/
[admin@lnpg log]$ ls -lt|head
total 1140008
-rw-r--r-- 1 admin admin 198392336 Oct 14 14:49 observer.log
-rw-r--r-- 1 admin admin  58051631 Oct 14 14:49 rootservice.log
-rw-r--r-- 1 admin admin   1066049 Oct 14 14:49 election.log
-rw-r--r-- 1 admin admin   1632648 Oct 14 14:49 obesi-daemon.log
-rw-r--r-- 1 admin admin       295 Oct 14 14:48 observer.log.wf
-rw-r--r-- 1 admin admin 268465971 Oct 14 14:48 observer.log.20241014144855728
-rw-r--r-- 1 admin admin       586 Oct 14 14:48 observer.log.wf.20241014144855728
drwxrwxr-x 2 admin admin         6 Oct 14 14:47 run
drwxrwxr-x 2 admin admin        50 Oct 14 14:47 audit
[admin@lnpg log]$ date
Mon Oct 14 14:50:02 CST 2024
[admin@lnpg log]$ tail -f observer.log

[admin@lnpg log]$ obclient -h127.0.0.1 -uroot -P2881 -plinux123
Welcome to the OceanBase.  Commands end with ; or \g.
Your OceanBase connection id is 3221487644
Server version: OceanBase 3.2.4.1 (r101000052023010822-346aa35c32e99d1b82d713f75f0072c45bdf7aab) (Built Jan  8 2023 22:52:43)

Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

obclient [(none)]> exit
Bye
[admin@lnpg log]$ 

[admin@lnpg oceanbase]$ find ./ -name *config*
./etc/observer.config.bin.history
./etc/observer.config.bin
[admin@lnpg oceanbase]$ more ./etc/observer.config.bin
_enable_oracle_priv_check=True
major_compact_trigger=100
all_server_list=192.168.207.143:2882
__min_full_resource_pool_memory=268435456
min_observer_version=3.2.4.1
syslog_level=sql.*:error, common.*:error
cluster_id=10001
cluster=obdemo
rootservice_list=192.168.207.143:2882:2881
_partition_balance_strategy=standard
enable_one_phase_commit=False
system_memory=1G
memory_limit=20G
zone=zone1
devname=ens192
mysql_port=2881
rpc_port=2882
config_additional_dir=/db/ob/admin/1/obdemo/etc3;/db/ob/admin/log1/obdemo/etc2
datafile_size=10G
data_dir=/home/admin/oceanbase/store/obdemo

 
 
   [admin@lnpg oceanbase]$ pwd
/home/admin/oceanbase

http://www.lryc.cn/news/460120.html

相关文章:

  • 【C++11】lambda表达式
  • 前端学习-css的背景(十六)
  • 使用Postman搞定各种接口token实战
  • ssh连接慢的问题或远程连接服务超时
  • 基于卷积神经网络的蔬菜识别系统,resnet50,mobilenet模型【pytorch框架+python源码】
  • 数据结构与算法:栈与队列的高级应用
  • macos php开发环境之macport安装的php扩展安装,php常用扩展安装,port中可用的所有php扩展列表
  • 使用Pytorch+Numpy+Matplotlib实现手写字体分类和图像显示
  • kimi帮我解决ubuntu下软链接文件夹权限不够的问题
  • 如何去除背景音乐保留人声?保留人声,消除杂音
  • 2.4.ReactOS系统提升IRQL级别KfRaiseIrql 函数
  • 【新书】使用 OpenAI API 构建 AI 应用:利用 ChatGPT等构建 10 个 AI 项目(第二版),404页pdf
  • 修改PostgreSQL表中的字段排列顺序
  • canvas实现手写功能
  • Python知识点:基于Python技术,如何使用TensorFlow进行目标检测
  • 初始爬虫13(js逆向)
  • 前端发送了请求头的参数,经debug发现后端请求对象请求头中没有该参数
  • 雷池社区版如何使用静态资源的方式建立站点
  • 车载电源OBC+DC/DC
  • 【朝花夕拾】免费个人网页搭建:免费托管、CDN加速、个人域名、现代化网页模板一网打尽
  • Spring Boot知识管理系统:用户体验设计
  • 《数字信号处理》学习08-围线积分法(留数法)计算z 逆变换
  • vue3中的computed属性
  • C++学习笔记之vector容器
  • LeNet-5(论文复现)
  • 基于SpringBoot+Vue+Uniapp汽车保养系统小程序的设计与实现
  • 【问题实战】Jmeter中jtl格式转换图片后如何分开展示各个性能指标?
  • 解决 MySQL 连接数过多导致的 SQLNonTransientConnectionException 问题
  • 猫头虎分享:什么是 ChatGPT 4o Canvas?
  • qiankun 主项目和子项目都是 vue2,部署在同一台服务器上,nginx 配置