docker run -it -d --name prometheus -p 9090:9090  -v /home/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml -v /home/prometheus:/prometheus dockertest2.io:12000/prometheus:latest --config.file=/etc/prometheus/prometheus.yml --web.listen-address="0.0.0.0:9090" --web.enable-lifecycle




docker run -it -d --name prometheus -p 9090:9090  -v /home/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml -v /home/prometheus:/prometheus --link cadvisor:cadvisor dockertest2.io:12000/prometheus:latest --config.file=/etc/prometheus/prometheus.yml --web.listen-address="0.0.0.0:9090" --web.enable-lifecycle




---------- prometheus reload ----------------

t@workstation:/home/edu3/prometheus-2.3.2.linux-amd64# curl -X POST http://localhost:9090/-/reload

level=info ts=2018-07-13T05:25:49.600841981Z caller=main.go:603 msg="Loading configuration file" filename=prometheus.yml

level=info ts=2018-07-13T05:25:49.601703886Z caller=main.go:629 msg="Completed loading of configuration file" filename=prometheus.yml

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

prometheus.yml

# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
      monitor: 'codelab-monitor'

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first.rules"
  # - "second.rules"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
      - targets: ['localhost:9090']

  - job_name: 'docker'
         # metrics_path defaults to '/metrics'
         # scheme defaults to 'http'.

    static_configs:
      - targets: ['localhost:9323']


[참고용]

docker run -d -p 42047:9090 --name=prometheus -v /home/test/prometheus.yml:/etc/prometheus/prometheus.yml --link cadvisor:cadvisor prom/prometheus -config.file=/etc/prometheus/prometheus.yml -log.level=debug -storage.local.path=/prometheus -storage.local.memory-chunks=10000

[1]+  Stopped                 ./prometheus --web.listen-address="0.0.0.0:9090" --web.enable-lifecycle

root@workstation:/home/edu3/prometheus-2.3.2.linux-amd64# bg

[1]+ ./prometheus --web.listen-address="0.0.0.0:9093" --web.enable-lifecycle &

root@workstation:/home/edu3/prometheus-2.3.2.linux-amd64# curl -X POST http://localhost:9093/-/reload

level=info ts=2018-07-13T05:25:49.600841981Z caller=main.go:603 msg="Loading configuration file" filename=prometheus.yml

level=info ts=2018-07-13T05:25:49.601703886Z caller=main.go:629 msg="Completed loading of configuration file" filename=prometheus.yml



'나는 노동자 > ECO SW' 카테고리의 다른 글

docker-prometheus install  (0) 2018.08.10
Grafana - anonymous login (without pw)  (0) 2018.04.13
NEXUS 3.7.X SSL 설정  (0) 2018.03.29
NEXUS 3.X 암호 초기화 하기  (0) 2018.03.28

Grafana 컨테이너 RUN시  /etc/grafana/grafana.ini  파일을 host쪽에 미리 mount  시킨다




해당 경로 파일의 내용중 


############# Anonymous Auth############## 이 부분을 아래와 같이 변경하면ㄷ 된다



#################################### Anonymous Auth ##########################

[auth.anonymous]

enabled = true

org_name = anonymousorg

# enable anonymous access

enabled = false


# specify organization name that should be used for unauthenticated users

org_name = Main Org.


# specify role for unauthenticated users

org_role = Viewer





'나는 노동자 > ECO SW' 카테고리의 다른 글

docker-prometheus install  (0) 2018.08.10
프로메테우스 데몬 api로 재시작없이 reload하기  (0) 2018.07.13
NEXUS 3.7.X SSL 설정  (0) 2018.03.29
NEXUS 3.X 암호 초기화 하기  (0) 2018.03.28

yum install openssl




 openssl req -nodes -sha256 -newkey rsa:2048 -keyout server.key -out server.csr -subj "/C=US/ST=Unspecified/L=Unspecified/O=Sonatype/OU=Example/CN=*.${NEXUS_DOMAIN}" 

openssl x509 -req -days 7000 -in server.csr -signkey server.key -out server.crt -sha256

openssl pkcs12 -export -in server.crt -inkey server.key -out serverStore.p12 -name "jetty"


 keytool -importkeystore -srckeystore serverStore.p12 -srcstoretype pkcs12 -destkeystore keystore.jks -deststoretype pkcs12   -alias "jetty"  -ext "SAN=DNS:dockertest.example.com" -ext "BC=ca:true"



생성된 keystore.jks 파일을 
/opt/sonatype/nexus/etc/ssl 에 복사한다

나머지는 3.6 참조 


(1) 도커 인스턴스로 접속 (NEXUS가 실행되고 있는 호스트에서 실행)


docker exec -it -u 0 containerID bash


접속되면.. java 파일의 위치를 찾는다

find / -name java


그리고 명령어로 Orient DB콘솔로 접속


java -jar /opt/sonatype/nexus/lib/support/nexus-orient-console.jar




update user SET password="$shiro1$SHA-512$1024$NE+wqQq/TmjZMvfI7ENh/g==$V4yPw8T64UQ6GfJfxYq2hLsVrBY8D1v+bktfOxGdt4b/9BthpWPNUy/CBk6V9iA0nHpzYzJFWO8v/tZFtES8CA==" UPSERT WHERE id="admin"


그리고 컨테이너 restart
하면 된다..

일번적으로 이렇게 하면 Default 암호로 변경된다.





혹시 이래도 안되면

To reset the default security realms, enter this command at the karaf prompt:
delete from realm
그리고 컨테이너 restart
하면 된다..

혹시 이래도 안되면


  1. Optional, if the admin user is missing the "nx-admin" role:

    Check to see what roles the "admin" user has assigned to them:

    select * from user_role_mapping where userID = "admin"

    If they are missing "nx-admin" use this command at the karaf prompt to fix:

    update user_role_mapping set roles = ["nx-admin"] where userID = "admin"  
    
  2. Optional, check to see if the admin user is active:

    Check to see if the "admin" user is active:

    select status from user where id = "admin"

    If they are not active, use this to make them active:

    update user set status="active" upsert where id="admin"
  3. To end the console session gracefully type "exit".

  4. Start Nexus again using ./bin/nexus start or your regular service control command.


+ Recent posts