[Elastic] APM Agent 설치

[설치] [APM Agent 다운로드] https://search.maven.org/search?q=g:co.elastic.apm%20AND%20a:elastic-apm-agent [Tomcat 설정] export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/path/to/elastic-apm-agent-<version>.jar" (다운로드받은 Agent 경로 및 파일명) export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.service_name=my-cool-service” (서비스 이름 아무거나 지정해 주세요.) export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.application_packages=org.example,org.another.example” (도메인명 아무거나 지정해 주세요.) export CATALINA_OPTS="$CATALINA_OPTS -Delastic.apm.server_urls= http://1.234.25.136:40002 ” (APM 서버 ip 및 포트 이럴로 해주세요.) [Java 프로그램 설정] java  -javaagent:/path/to/elastic-apm-agent-<version>.jar (다운로드받은 Agent 경로 및 파일명) -Delastic.apm.service_name=my-cool-service -Delastic.apm.application_packages=org.example,org.another.example -Delastic.apm.server_urls=http://1.234.25.136:40002  -jar my-application.jar ( 실행할 프로그램 )

[Elastic] Filebeat 설치

[설치] curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.6.2-linux-x86_64.tar.gz tar xzvf filebeat-7.6.2-linux-x86_64.tar.gz [설정] filebeat.inputs: - type: log   enabled: true   paths:     - /var/log/*.log output.elasticsearch:   hosts: ["myEShost:9200"]   username: "filebeat_internal"   password: "YOUR_PASSWORD"  setup.kibana:   host: "mykibanahost:5601"   username: "my_kibana_user"     password: "YOUR_PASSWORD"

[Elastic] Install elasticsearch cluster

[elasticsearch install - linux Version] wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz.sha512 shasum -a 512 -c elasticsearch-7.6.2-linux-x86_64.tar.gz.sha512  tar -xzf elasticsearch-7.6.2-linux-x86_64.tar.gz cd elasticsearch-7.6.2/ node별로 설치한다. [elasticsearch configuration for a cluster] Node별로 $ES_HOME/config/elasticsearch.yml을 아래와 같이 설정한다. [node1] cluster.name: elastic-poc node.name: elastic-node1 path.data: /home/pocuser/elastic-node1/elasticsearch/data path.logs: /home/pocuser/elastic-node1/elasticsearch/logs network.host: 1.234.25.136 http.port: 49100 transport.port: 49110 discovery.seed_hosts: ["1.234.25.136: 49110 ", "1.234.25.136: 49210 ", "1.234.25.136: 49310 "] cluster.initial_master_nodes: ["elastic-node1", "elastic-node2", "elastic-node3...

[Ubuntu] 환경변수 설정, 확인, 삭제, 버전확인

환경변수 설정 export AAA=bbb 환경변수 확인 env | grep AAA 환경변수 삭제 unset AAA 버전확인 cat /etc/issue

[Elastic] kibana reporting error

[에러메시지] log   [08:12:47.276] [error][reporting] The Reporting plugin encountered issues launching Chromium in a self-test. You may have trouble generating reports.  error  [08:12:47.276] [error][reporting] Error: Failed to launch chrome! /home/ubuntu/elastic/kibana-7.6.2-linux-x86_64/data/headless_shell-linux/headless_shell: error while loading shared libraries: libnss3.so : cannot open shared object file: No such file or directory TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md     at onClose (/home/ubuntu/elastic/kibana-7.6.2-linux-x86_64/node_modules/puppeteer-core/lib/Launcher.js:349:14)     at Interface.helper.addEventListener (/home/ubuntu/elastic/kibana-7.6.2-linux-x86_64/node_modules/puppeteer-core/lib/Launcher.js:338:50)     at Interface.emit (events.js:203:15)     at Interface.close (readline.js:397:8)     at Socket.onend (readline.js:173:1...

[Ubuntu] shell .profile

우분투에서는 홈 디렉토리에 .bash_profile 대신 .profile을 사용한다. export LS_HOME=/home/ubuntu/elastic export PATH=$PATH:. (현재 디렉토리 포함)

[Elastic] elasticsearch start and stop

[Start] 일반실행 elasticsearch 데몬실행 elasticsearch -d -p $ES_HOME/pid 데몬중지 pkill -F $ES_HOME/pid