명령어

'tasklist /V /FO TABLE' 명령어 실행

명령어 참고

https://estenpark.tistory.com/227

 

정보

Windosws에서 서비스는 사용자 관리자(service.msc)에 의해 실행

리눅스의 경우 명령어 뒤에 &를 붙여서 백그라운드 실행가능

Windows의 경우 sc.exe를 실행하여 생성 가능

 

등록 방법

telegraf.exe을 등록하는 예
(관리자권한으로 cmd 실행)

sc create telegraf_agnet binpath= "C:\Program Files\Telegraf\telegraf.exe" displayname= "telegraf_Agent" start= auto

(참고) 서비스 삭제
sc delete telegraf_agent

 

참고

https://docs.microsoft.com/ko-KR/windows-server/administration/windows-commands/sc-create

https://gentian.tistory.com/1

현상

powershell의 invoke-sqlcmd를 사용하여 DB 쿼리를 실행하는 도중 강제 종료

에러 내용

invoke-sqlcmd : Execution Timeout Expired.  The timeout period elapsed prior to completion of the operation or the
server is not responding.

원인

쿼리 실행 timeout 설정을 하지 않아, 쿼리 실행 시간이 Default 30초를 초과하여 종료되는 현상

해소

-Querytimeout 옵션으로 쿼리 실행 가능 시간을 설정

-- Query Timeout 제한 없음 : 0
Invoke-Sqlcmd -ServerInstance "$serverInstance" -Querytimeout 0 -Query "Select * from ...."

참고

https://stackoverflow.com/questions/52545013/getting-execution-timeout-expired-running-sql-server-backup-through-invoke-sql/56991850

 

현상

특정 서비스가 실행중이지 않으면 Windows의 psexec를 사용할때 아래 에러가 발생

 

에러 내용

The network name cannot be found

필요 서비스

Server (LanmanServer) must be running
TCP/IP NetBIOS Helper (lmhosts) must be running
UpnP Device Host -> 수동
SSDP Discovery -> 수동 -> 러닝

참고 : https://superuser.com/questions/1158722/psexec-requirements-on-local-computer

CPU Core를 효율적으로 사용하기 위해, hyperthread 기법을 사용하여 물리 코어의 2배로 논리 코어를 할당하여 사용 하는 경우가 있음.

 

wmic 명령어로 물리 및 논리 코어 카운트 확인

  numberofcores : 물리코어

  numberoflogicalprocessors : 논리코어

-- 아래는 소켓이 2개이며 하이퍼 스레딩을 사용하여 물리 CPU는 16개, 논리 CPU는 32개
C:W>wmic cpu get numberofcores,numberoflogicalprocessors
numberofcores	numberoflogicalprocessors
8		16
8		16

MSINFO32

시작 - 실행 - MSINFO32 실행

 

요약

[cmd 관리자 모드로 접속] 

 

--명령어 실행
diskpart

-- disk 리스트 확인
list disk

-- disk 선택
select disk 1

-- disk 활성화
online disk
-- readonly 설정 복구
attributes disk clear readonly

 

예제

DISKPART> list disk

  디스크 ###  상태           크기     사용 가능     Dyn  Gpt
  ----------  -------------  -------  ------------  ---  ---
  디스크 0    온라인        279 GB           0 B
  디스크 1    예약됨        558 GB           0 B
  디스크 2    예약됨        279 GB           0 B

DISKPART> select disk 1

1 디스크가 선택한 디스크입니다.

DISKPART> online disk

가상 디스크 서비스 오류:
지정한 디스크 또는 볼륨은 Microsoft 장애 조치(failover) 클러스터링 구성 요소에서
 관리합니다. 이 작업을 수행하려면 디스크가 클러스터 유지 관리 모드이고 클러스터
리소스 상태가 온라인이어야 합니다.

<<< 클러스터에 추가한 노드 제거...(클러스터에 노드 추가시 저장소 포함으로 설정하여 문제가 발생함...)

DISKPART> online disk

DiskPart에서 선택한 디스크를 온라인으로 설정했습니다.

DISKPART> attributes disk clear readonly

디스크 특성을 지웠습니다.

DISKPART> select disk 2

2 디스크가 선택한 디스크입니다.

DISKPART> online disk

DiskPart에서 선택한 디스크를 온라인으로 설정했습니다.

DISKPART> attributes disk clear readonly

디스크 특성을 지웠습니다.

DISKPART> list disk

  디스크 ###  상태           크기     사용 가능     Dyn  Gpt
  ----------  -------------  -------  ------------  ---  ---
  디스크 0    온라인        279 GB           0 B
  디스크 1    온라인        558 GB           0 B
* 디스크 2    온라인        279 GB           0 B

DISKPART>

to Top