IT 한길

-오류

Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; 
these UUIDs must be different for replication to work -

 

- auto.cnf 삭제 후 재기동

 

 

 

- plugin 조회

 SELECT Host,User,plugin,authentication_string FROM mysql.user where User ='root'\G


- User 변경

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'test';

- 소켓위치 찾기

  /mysql/bin/mysql_config --socket


- 심볼릭링크

  ln -s /mysql/mysql.sock /tmp/mysql.sock

openssl s_client -connect url:port | openssl x509 -noout -dates

TO_BASE64() :  Return the argument converted to a base-64 string

 

FROM_BASE64() : Decode base64 encoded string and return result

 

-----------------------------------------------------

1. SELECT TO_BASE64('abc') encodeStr, convert(FROM_BASE64(TO_BASE64('abc'))) decodeStr;

 

 

2. 로그인 mysql -uroot -p --skip-binary-as-hex

  SELECT TO_BASE64('abc') encodeStr, FROM_BASE64(TO_BASE64('abc')) decodeStr;

 

# audit list 조회 ========================
select
hex(a.goid) goid,
g.name node,
date_format(from_unixtime(a.time / 1000), '%Y-%m-%d %H:%i:%s.%f') time,
a.audit_level serverity,
a.name service,
a.message,
a.ip_address client_ip,
uncompress(b.request_zipxml) request, -- 옵션 사용중인 경우만
uncompress(b.response_zipxml) response -- 옵션 사용중인 경우만
from
  audit_main a
  left outer join audit_message b on a.goid = b.goid
  join cluster_info g on a.nodeid = g.nodeid
where
b.service_goid is not null -- 시스템,admin 로그 제외
and a.time > unix_timestamp('2022-02-17 11:38:57.274')*1000 -- 시작일시
and a.time < unix_timestamp('2022-02-17 11:48:57.274')*1000 -- 종료일시
-- and a.audit_level = 'WARNING'
-- and a.name like '%/openbanking/%' --api명
order by a.time desc;

 

# audit detail 조회 ========================
select
date_format(from_unixtime(a.time/1000),'%Y-%m-%d %H:%i:%s.%f') time,
a.message_id code,
case when b.position=1 then 'WARNING' else 'INFO' end Serverity,
b.value
from
  audit_detail a
  join audit_detail_params b on a.goid=b.audit_detail_goid
where hex(a.audit_goid)='85562EE4D72AA5EE2516C0D43F86EEFE' -- audit_main goid
order by a.time desc;

'IT > CA Gateway' 카테고리의 다른 글

[CA Gateway] Revision History 조회  (0) 2022.03.15

select a.name, b.version, date_format(from_unixtime(b.time/1000),'%Y-%m-%d %H:%i:%s.%f') time 
from policy a left outer join policy_version b
on a.goid = b.policy_goid
where a.name like '%API명'
order by b.version desc

'IT > CA Gateway' 카테고리의 다른 글

[CA Gateway] Audit 로그 조회  (0) 2022.03.15

항목 기본 값 비고
user mysql 기동 유저
basedir /usr 기본 경로
datadir /var/lib/mysql 데이터 경로
log-error /var/log/mysqld.log 에러 로그 경로
pid-file /var/run/mysqld/mysqld.pid PID 파일 경로
socket /var/lib/mysql/mysql.sock 소켓 파일 경로
server-id #server-id=1 Cluster 설정 시 주석 제거 node 1
server-id #server-id=2 Cluster 설정 시 주석 제거 node 2
log-bin #log-bin=/var/lib/mysql/ssgbin-log Cluster 설정 시 주석 제거
log-bin #log_bin_trust_function_creators=1 Cluster 설정 시 주석 제거
log-slave-updates #log-slave-updates Cluster 설정 시 주석 제거
relay-log /var/lib/mysql/ssgrelay-bin relay-log
relay-log-index /var/lib/mysql/ssgrelay-bin.index relay-log
innodb_data_file_path ibdata:100M:autoextend:max:15776M MySQL 5.5 이하 버전에서 튜닝 항목
ibdata:100M:autoextend:max:15776M innodb 
부족한 경우 늘려줄 것
slow_query_log 1  
slow-query-log-file /var/lib/mysql/slowquery.log 설정 없음 추가해줘야 함
long_query_time 10 설정 없음 추가해줘야 함
max_connections 2625 set larger connection limit