Docker-compose

docker-composeコマンド一覧


■カレントディレクトリに存在する「docker-compose.yaml」を参照して、docker-composeの起動
 $ docker-compose up -d

■カレントディレクトリに存在する「docker-compose.yaml」に紐づいているコンテナとNetworkを削除
 $ docker-compose down
Imageも削除
 $ docker-compose down --rmi all

■ボリュームを削除
 $ docker-compose rm

Dockerチートシート

dockerコマンド一覧

コンテナ操作


■起動中のコンテナ一覧
 $ docker ps 



■全てのコンテナ一覧(停止中のコンテナ含む)
 $ docker ps -a



■コンテナを作成(起動状態で)
 $ docker run <イメージ名>[:タグ名]
例)docker run TestApp
例)docker run -d --name testweb -p 80:80 nginx
-d: デタッチモード。コンテナをバックグラウンドで実行し、新しいコンテナIDを出力します。
--name:コンテナに名前を割り当てます。
-p:コンテナのポートまたはポートの範囲をホストに公開します。


■コンテナを作成(停止状態で)
 $ docker create <イメージ名>[:タグ名]
例)docker create TestApp


■コンテナの起動
 $ docker start <コンテナID>
例)docker start 08311c3ab75d


■コンテナへの接続
 $ docker exec -it <コンテナ名>
例)docker exec -it ubuntu_bash bash


■コンテナへコマンドを実行
 $ docker exec <コンテナ名> <コマンド>
例)docker exec ubuntu_bash ls -l /usr


■コンテナへローカルのファイルをコピーします
 $ docker cp <ローカル・パス> <コンテナ名>:<コンテナ内のディレクトリパス>
例)docker cp /tmp/app.py webapp:/tmp/app.py


■コンテナからローカルへファイルをコピーします
 $ docker cp <コンテナ名>:<コンテナ内のディレクトリパス> <ローカル・パス>
例)docker cp webapp:/tmp/app.py /tmp/app.py


■コンテナの停止
 $ docker stop <コンテナID>
例)docker stop 08311c3ab75d


■コンテナの強制停止(Force)
 $ docker kill <コンテナID>
例)docker kill 08311c3ab75d


■コンテナの削除
 $ docker rm <コンテナID>
例)docker rm 08311c3ab75d
強制削除。
docker rm -f 08311c3ab75d


■コンテナの詳細確認
 $ docker container inspect <コンテナID>
例)docker container inspect 940fb334d049


■コンテナのlog
 $ docker log <コンテナID>
例)docker log 940fb334d049


■コンテナのプロセス表示
 $ docker top <コンテナID>
例)docker top 940fb334d049


コンテナイメージの操作


■コンテナイメージの確認
 $ docker images



■コンテナイメージの削除
 $ docker rmi <イメージID>

例)docker rmi 940fb334d049


■コンテナイメージの履歴
 $ docker history <イメージID>

例)docker history 940fb334d049


■コンテナイメージのビルド
 $ docker build -t <リポジトリ[:TAG]> .

例)docker build -t testApps:latest .
※カレントディレクトリにDockerfileがある場合


Dockerhub操作


■Dockerログイン
 $ docker login



■Dockerイメージ検索
 $ docker search <イメージ名>
例)docker search postgres


■Dockerイメージダウンロード
 $ docker pull <イメージ名>
例)docker pull postgres:latest


■Dockerイメージアップロード
 $ docker push <レジストリの場所/リポジトリ名>[:バージョン]
例)docker push test.com/MyApp:01



コンテナネットワーク


■ネットワーク作成
 $ docker network create --subnet <サブネットマスク> <ネットワークの名前>
例)docker network create --subnet 192.168.10.0/24 testnetwork


■ネットワーク一覧表示
 $ docker network ls



■ネットワークの削除
 $ docker network rm <ネットワークの名前>
例)docker network rm testnetwork


■ネットワークにコンテナを接続
 $ docker network connect <ネットワークの名前> <コンテナID>
 $ ddocker network connect --ip <IPアドレス> <ネットワークの名前> <コンテナID>
例)docker network connect --ip 192.168.10.1 testnetwork 940fb334d049
※--ip コンテナに任意のIPアドレスを割り当てる


■ネットワークからコンテナを切断する
 $ docker network disconnect <ネットワークの名前> <コンテナID>
例)docker network disconnect testnetwork 940fb334d049


■ネットワークの詳細表示
 $ docker network inspect <ネットワークの名前>
例)docker network inspect testnetwork


■未使用ネットワークを全て削除
 $ docker network prune



コンテナのボリューム


■ボリューム作成
 $ docker volume create <ボリュームの名前>
例)docker volume create myvol


■ボリューム削除
 $ docker volume rm <ボリュームの名前>
例)docker volume rm myvol


■ボリューム一覧表示
 $ docker volume ls



■未使用ボリュームを全て削除
 $ docker volume prune



■ボリューム詳細表示
 $ docker volume inspect <ボリュームの名前>
例)docker volume inspect myvol


CentOS 7 Postgre SQL 10 Install

急遽PostgreSQL10が必要になったので、インストールメモ。

■PostgreSQLのリポジトリの追加
 [root@localhost ~]# yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
■PostgreSQL10の情報確認
[root@localhost ~]# yum info postgresql10-server
Postgre10インストール
[root@localhost ~]#  yum -y install postgresql10-server
■PostgreSQLのバージョンの確認
[root@localhost ~]# /usr/pgsql-10/bin/postgres --version
postgres (PostgreSQL) 10.13
■PostgreSQLのDBの初期化
[root@localhost ~]# /usr/pgsql-10/bin/postgresql-10-setup initdb
Initializing database ... OK
■サービスの有効化
[root@localhost ~]# systemctl enable postgresql-10
■サービスの開始
[root@localhost ~]# systemctl start postgresql-10
■サービスの確認
[root@localhost ~]# systemctl status postgresql-10
● postgresql-10.service - PostgreSQL 10 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-10.service; enabled; vendor preset: disabled)
   Active: active (running) since 木 2020-05-21 13:58:01 JST; 1h 58min ago
     Docs: https://www.postgresql.org/docs/10/static/
  Process: 30639 ExecStartPre=/usr/pgsql-10/bin/postgresql-10-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 30645 (postmaster)
   CGroup: /system.slice/postgresql-10.service
           tq30645 /usr/pgsql-10/bin/postmaster -D /var/lib/pgsql/10/data/
           tq30647 postgres: logger process
           tq30649 postgres: checkpointer process
           tq30650 postgres: writer process
           tq30651 postgres: wal writer process
           tq30652 postgres: autovacuum launcher process
           tq30653 postgres: stats collector process
           mq30654 postgres: bgworker: logical replication launcher

 5月 21 13:58:01 localhost.localdomain systemd[1]: Starting PostgreSQL 10 database server...
 5月 21 13:58:01 localhost.localdomain postmaster[30645]: 2020-05-21 13:58:01.232 JST [30645] LOG:  IPv6アドレス"::1"、ポート5432で待ち受けています
 5月 21 13:58:01 localhost.localdomain postmaster[30645]: 2020-05-21 13:58:01.232 JST [30645] LOG:  IPv4アドレス"127.0.0.1"、ポート5432で待ち受けています
 5月 21 13:58:01 localhost.localdomain postmaster[30645]: 2020-05-21 13:58:01.234 JST [30645] LOG:  Unixソケット"/var/run/postgresql/.s.PGSQL.5432"で待ち受けています
 5月 21 13:58:01 localhost.localdomain postmaster[30645]: 2020-05-21 13:58:01.237 JST [30645] LOG:  Unixソケット"/tmp/.s.PGSQL.5432"で待ち受けています
 5月 21 13:58:01 localhost.localdomain postmaster[30645]: 2020-05-21 13:58:01.254 JST [30645] LOG:  ログ出力をログ収集プロセスにリダイレクトしています
 5月 21 13:58:01 localhost.localdomain postmaster[30645]: 2020-05-21 13:58:01.254 JST [30645] ヒント:  ここからのログ出力はディレクトリ"log"に現れます。
 5月 21 13:58:01 localhost.localdomain systemd[1]: Started PostgreSQL 10 database server.

vSphere 7 リリース

vSphere-7 リリースノート

kubernetes対応
Dynamic DirectPathI/O
vGPUの強化
vMotion、HA、DRSの機能改善
Life Cycle Management
vCenter とADFSの認証連携
vCenter Update

Nutanix NCP5.5取得しました。

NutanixNCP試験について

Nutanixの試験を初めて受けたので、その内容についてまとめました。

事前にやっておくべきこととして、2点あります。
まず、1点目は試験で利用するPCを準備すること。です!
PCの環境チェックを事前に行っておく必要があります。
カメラや音声、OSやブラウザなど様々な物を事前にチェックして、万全の体制で臨みましょう。
また、セキュアブラウザのインストールが必要になりますので、アプリインストール可能なPCを準備する必要があります。

2点目は、会場を抑えるという点です。
私は自社の会議室を抑えましたが、結構ヒヤヒヤしてました。。。
というのも、途中で誰かが扉を開けただけで、その試験が無効となります。
そのため、抑えられるのであれば、鍵付きの部屋を確保することをお勧めします。

ここからは所感となりますが、私にとっての一番試験を受ける上でネックだったのが、外国人とのチャットのやり取りでした。
対面のやり取りより、リモートのやり取りの方が遥かにハードルが高いと感じました。
特にNutanixの人ではなく、外注の会社になりますので、ここは注意です。
リモートの外国人試験官から、監視され受験します。
問題に取り掛かるまでに必ずやり取りが発生します。
難しい文章ではないのですが、始めは焦ってしまうと思うので、冷静に対処が必要です。


最後に当日の流れです。
試験官とコンタクトを取る前に、身分証明書の登録、自分の顔写真、再度に部屋の周辺を動画で写す必要があります。
その後登録データをアップロードすると、試験官と繋がりチャットのやり取りが発生します。
試験受験上の注意点や、部屋の確認など諸処諸々終わると、無事に試験が開始されます。
試験の内容よりも試験を受けるまでのやり取りで疲弊しており、試験の内容をほぼ覚えていないのですが、3000点以上取ると合格です。
AHVの問題を問われることとなりますので、AHVを普段利用されている方であれば、大丈夫かと思います。

Amazon 神対応

Amazonの神対応

Amazonの対応が神すぎたって話をまとめました。
Kindleを使って、フリーのコンテンツやPrimeReadingのコンテンツをダウンロードしていると、ゴミが残りますよね。
綺麗にするためには、アカウントから、コンテンツの削除が必要になります。
一括で作業をしていると、間違えて必要なコンテンツを削除してしまうことがあります。
実は先日、有償コンテンツを削除してしまいました。
サイトで確認すると、再度購入してください、の文字が。。。
3000円くらいしたので、また買うのは嫌だなぁと思うのが、人間の心理。
カスタマーサービスのチャットを使って、ダメもとで復旧の依頼をしてみたところ、、、
コンテンツを確認された後、すぐに復旧手続きをしてくれた。
自身のアカウントで確認すると確かに、戻ってる。この間物の2、3分
ネ申か
ということで、コンテンツが戻ってめでたしめでたし。
皆様もダメもとで聞いてみるといいかもしれません!

Unified Access Gateway(UAG)3.4を展開してみた。その2UAG、Horizon編。

UAGの設定について前回は展開方法について記載しましたが、今回は設定についてまとめました。

UAGのWebUIで確認

ブラウザにて、https://uag:9443でアクセス。
Horizonの設定がALLGreenになっているか確認

システムの構成にて、UAG名とロケールを変更。

Horizon Administratorで確認

ブラウザにて、https://connectionserver/adminでアクセス。
ゲートウェイが緑になっていることを確認


「Server」のConnection Serverを選択し、「Edit」をクリック
「HTTPS Secure Tunnel」と「PCoIP Secure Gateway」のチェックを外す。


後は、Horizon Clientから接続チェックを行い、接続できていれば利用可能です。
UAGは、自動でデプロイまで何度かテストが必要です。
重要なポイントとしては、上位のFWの設定で折り返しの通信をNATをさせないようにしたり、必要なポート番号を開ける必要があります。
2NIC構成にする場合はStatic Routingを書く必要も出てきますので、環境に応じた設定を入れる必要があるのでご注意あれ!!

Unified Access Gateway(UAG)3.4を展開してみた。その1デプロイ編。

インフラ基盤構築の際にUAGを展開したので備忘録でまとめます。
UAGは、Horizon環境のリモートアクセス用のGatewayや、リバースプロキシ、多要素認証など色々セキュリティを強化する際に使います。

UAGはデプロイ方法が2種類あります。
一つは、vCenterから、OVFテンプレートをデプロイし、パラメータを設定するやり方です。この手法がスタンダードです。
しかしながら、UAGのパラメーターはかなり多いので、デプロイを複数重ねてテストをすることを踏まえると何度も手動で展開する方法は正直大変です。
そこで、2つ目のiniファイルにパラメーターを入れて、Powershellから展開するという方法があります。
こちらの展開であれば、何度も値を入れ直さなくて済むので便利です。
さらに、UAGの冗長構成で2台用意する際も、一部のパラメータを変更するだけで利用できます
では、早速具体的な手順について説明します。

【MyVMware】よりダウンロード

OVFファイルと、PowershellScriptsをダウンロードをします。
Zipを展開して、必要な設定に近いiniファイルを修正します。
今回はuag2-advanced.iniをベースに設定を入れます。

【iniファイルの編集】

iniファイルを修正します。
[General]

#
# UAG virtual appliance unique name (between 1 and 32 characters).
# If name is not specified, the script will prompt for it.
#

#UAGの名前を入れる
name=uag01

#
# Full path filename of the UAG .ova virtual machine image
# The file can be obtained from VMware
#

#OVAファイルパスを指定
source=Z:\Horizon 7.6\euc-unified-access-gateway-3.4.0.0-11037344_OVF10.ova

#
# target refers to the vCenter username and address/hostname and the ESXi host for deployment
# Refer to the ovftool documentation for information about the target syntax.
# See https://www.vmware.com/support/developer/ovf/
# PASSWORD in upper case results in a password prompt during deployment so that passwords do not need
# to specified in this .INI file.
# In this example, the vCenter username is administrator@vsphere.local
#                  the vCenter server is 192.168.0.21 (this can be a hostname or IP address)
#                  the ESXi hostname is esx1.myco.int (this can be a hostname or IP address)
#

#target=vi://administrator@vsphere.local:PASSWORD@192.168.0.21/Datacenter1/host/esx1.myco.int

#target=vi://ユーザー名:パスワード@vCenterのIPもしくはホスト名/Datacenter名/host/Cluster名
target=vi://administrator@vsphere.local:PASSWORD@172.22.130.20/DC/host/cluster




#
# vSphere datastore name
#   

#Datastore名を指定
ds=ds01

#
# Disk provisioning mode. Refer to OVF Tool documentation for options.
#

#diskMode=thin

#
# vSphere Network names. For pre 3.3 UAG versions, a vSphere Network Protocol Profile (NPP) must be associated with every referenced network name. This specifies
# network settings such as IPv4 subnet mask, gateway etc. UAG 3.3 and newer no longer uses NPPs and so for static IPv4 addresses a netmask0, netmask1 and netmask2
# value must be specified for each NIC. Normally a defaultGateway setting is also required.
#

#netInternet=VM Network
#netManagementNetwork=VM Network
#netBackendNetwork=VM Network

#defaultGateway=192.168.0.1

#deploymentOption=onenic
#ip0=192.168.0.90
#netmask0=255.255.255.0
#routes0=192.168.1.0/24 192.168.0.1,192.168.2.0/24 192.168.0.2

#PortGroupを指定
netInternet=DMZ(100)
netManagementNetwork=DMZ(100)
netBackendNetwork=DMZ(100)

#DefaultGateway
defaultGateway=192.168.100.254

#NICおよびIPの指定。StaticRoute。
deploymentOption=onenic
ip0=192.168.100.1
netmask0=255.255.255.0
#routes0=192.168.100.0/24 192.168.100.254

#deploymentOption=twonic
#ip0=192.168.0.90
#netmask0=255.255.255.0
#ip1=192.168.0.91
#netmask1=255.255.255.0
#routes0=192.168.1.0/24 192.168.0.1,192.168.2.0/24 192.168.0.2
#routes1=192.168.3.0/24 192.168.0.1,192.168.4.0/24 192.168.0.2

#deploymentOption=threenic
#ip0=192.168.0.90
#netmask0=255.255.255.0
#ip1=192.168.0.91
#netmask1=255.255.255.0
#ip2=192.168.0.92
#netmask2=255.255.255.0
#routes0=192.168.1.0/24 192.168.0.1,192.168.2.0/24 192.168.0.2
#routes1=192.168.3.0/24 192.168.0.1,192.168.4.0/24 192.168.0.2
#routes2=192.168.5.0/24 192.168.0.1,192.168.6.0/24 192.168.0.2

#DNSを記入
dns=192.168.100.10
#syslogUrl=syslog://server.example.com:514

#
# Setting honorCipherOrder to true forces the TLS cipher order to be the order specified by the server. This can be set on
# UAG 2.7.2 and newer to force the Forward Secrecy ciphers to be presented first to improve security.
#

honorCipherOrder=true

#
# sessionTimeout value in milliseconds. Default is 36000000 (10 hours). When the session timeout expires,
# the user needs to login again. 
#

# 11 hours
sessionTimeout=39600000

# For UAG 3.4 onwards include licenseEdition property to be deployed.
# Options include- Standard, Advanced or Enterprise.
# Please uncomment the UAG license edition based on the Horizon/Workspace ONE licensing.
# licenseEdition=Standard
# licenseEdition=Advanced
# licenseEdition=Enterprise


[SSLCert]

#
# From UAG 3.0 and newer, you can specify the name of a .pfx or .12 format certificate file containing the required certificate and private key and
# any required intermediate certificates. In this case there is no need to use openssl commands to convert the .pfx/.p12 file into the
# associated PEM certificates file and PEM private key file.
#

#pfxCerts=sslcerts.pfx
#pfxCerts=C:\temp\UAG\sslcerts.pfx
#
# If there are multiple SSL certificates with private key in the .pfx file you also need to specify an alias name in order to select the required certificate.
# This is not necessary if there is only one SSL certificate with private key in the file
#

#pfxCertAlias=alias1

#
# The following pemCerts and pemPrivKey settings are only needed if you don't have a .pfx/.p12 file and want to directly use the two PEM format files.

#
# pemCerts refers to a PEM format file containing the SSL server certificate to be deployed. The file should also contain any
# required intermediate CA and root CA certificates.
#

###pemCerts=sslcerts.pem

#
# pemPrivKey refers to a file containing the RSA PRIVATE KEY for the SSL server certificate in the above certificate file.
#

#pemPrivKey=sslcertrsakey.pem

#
# From UAG 3.2 and newer, you can specify a certificate for the admin interface on port 9443. It is in the same format as [SSLCert] above.
#

[SSLCertAdmin]

#pfxCerts=sslcerts.pfx
#pemCerts=sslcerts.pem
#pemPrivKey=sslcertrsakey.pem
###pfxCerts=C:\temp\UAG\sslcerts.pfx
###pemCerts=C:\temp\UAG\sslcerts.pem
####pemPrivKey=C:\temp\UAG\sslcertrsakey.pem


[Horizon]

#
# proxyDestinationUrl refers to the backend Connection Server to which this UAG appliance will connect.
# It can either specify the name or IP address of an individual Connection Server or of a load balanced alias to connect
# via a load balancer in front of multiple Connection Servers.
#

#connection Serverのホスト名
proxyDestinationUrl=https://con01.lab.local

#
# proxyDestinationUrlThumbprints only needs to be specified if the backend Connection Servers do not have
# a trusted CA signed SSL server certificate installed (e.g. if it has the default self-signed certificate only).
# This is a comma separated list of thumbprints in the format shown here.
#

#proxyDestinationUrlThumbprints=sha1:3e ef ed c6 86 75 a6 15 ff c8 96 27 5a 4c ee 8e 16 fd 6e d3,sha1:3e ef ed c6 86 75 a6 15 ff c8 96 27 5a 4c ee 8e 16 fd 6e d3

#
# The following external URLs are used by Horizon Clients to establish tunnel, HTML Access and PCoIP connections
# to this UAG appliance. If they reference a load balancer name or address then the load balancer must be
# configured for source IP hash affinity otherwise the connections may route to the wrong UAG appliance. 
#

#UAGのOutbandアクセスする際のURL
tunnelExternalUrl=https://gw.external.jp:443
blastExternalUrl=https://gw.external.jp:443

#
# pcoipExternalUrl must contain an IPv4 address (not a DNS name)
#

#PCoIP用のグローバルIPアドレス
pcoipExternalUrl=xxx.xxx.xxx.xxx:4172

Powershellの実行

iniファイルと、OVFファイルと、psファイルを同じフォルダに配置して、下記コマンドをPSで実行すれば完了です。
実行するPCには、OVF Toolsのインストールが必要です。
ovftool is here
 PS C:\temp\UAG> .\uagdeploy.ps1 -iniFIle .\uag2-onenic.ini

root のパスワードとadmin password for the Admin UI and REST API managementのパスワードを入れて、後は待つだけでデプロイが完了します。
次回は、UAGのWebUIからの設定と、HorizonAdministratorの設定をまとめます。

BloggerにGoogle code-prettifyを入れてみた

Google code-prettifyとは、ソースコードを読みやすく表示してくれるものです。

htmlにコードを組み込み

</head>の後に下記コードをコピペします。
ラインナンバーも表示させたい場合は、下の文も追記しておきます。

 
<script src='https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js'/>
<style>li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:decimal}</style>

コードを入力

オプション
prettyprint → C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, JavaScript, Makefile, and Rust.
lang-xxxx → オプション言語
ex.)Apollo; Basic; Clojure; CSS; Dart; Erlang; Go; Haskell; Lasso; Lisp, Scheme; LLVM; Logtalk; Lua; MATLAB; MLs: F#, Ocaml,SML; Mumps; Nemerle; Pascal; Protocol buffers; R, S; RD; Rust; Scala; SQL; Swift; TCL; LaTeX; Visual Basic; VHDL; Wiki; XQ; YAML
linenums → 行数を入れる
 
<pre class="prettyprint lang-html linenums">
Codeを書く。
</pre>

CentOS 初期設定

■IPAddressの割り当て
 #nmcli c m ens192 ipv4.method manual ipv4.address 172.22.xxx.xx/24 connection.autoconnect yes
■Default Gateway の割り当て
#nmcli c modify ens192 ipv4.gateway 172.22.130.254
■DNS の割り当て
#nmcli connection modify ens192 ipv4.dns 172.22.130.1
■NetworkManagerの再起動
#systemctl restart network
#nmcli d show
■OS Update
# yum update
■Firewalld設定
#firewall-cmd --zone=public --add-service=https --permanent
#firewall-cmd --list-all
■NTP設定
#date
#yum install ntp
#vi /etc/ntp.conf
#systemctl restart ntpd
#ntpq -p
■SELinuxの無効化
# vi /etc/sysconfig/selinux
=========================================================
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted
=========================================================

HCIについて

最近HCIの案件が爆発的に増えてきております。
メーカーからも色々な製品が出ていますし、エンドユーザーからも相談されることが多いでしょう。

私もインフラエンジニアをやってますので、仕事では、複数のベンダーのHCIの設定やらテストやら案件をこなすしております。
進めていくうちに、いくつか注意点が見えてきました。

<提案フェーズ>
①ストレージVMにメモリかなり使う
②サイジングがちょっと大変
③見積もりが複雑
④作業範囲を理解するのが難しい


<構築フェーズ>
①仮想化基盤の展開がめちゃ楽
②構築の肝はネットワーク
③外部ストレージと接続のパターンも考えておいた方が良い
④必要なパラメーターを正確に理解し、入力する
⑤ベンダーごと癖がある
⑥初期化を制する者は構築を制す

共通することは、3Tierをきっちり理解できることが重要ということ!

CentOSコマンド履歴とログ取得

Linuxのサーバーを設定していると、何の設定をしたのかまとめたいですよね。
そんな時にすぐ使えるコマンドをご紹介します。

【script】CUIに表示されたものを保存

root@ubuntu:~# systemctl status |grep docker
           │ │   └─26867 grep --color=auto docker
             ├─docker.service
             │ └─1232 /usr/bin/dockerd -H unix://
             │ ├─647 avahi-daemon: running [modocker.local]
root@ubuntu:~# exit
exit
スクリプトを終了しました。ファイルは log.txt です

【history】コマンドの履歴

 root@ubuntu:~#history
88  docker ps
 113  history |grep docker
root@ubuntu:~# 

設定内容のログを管理する為に便利な為これからも使っていきたいと思います。

はじめまして

プリセールスのエンジニアをしている、moです。
これから日々勉強した内容やホットな情報をまとめて綴っていけたらと思ってます。2日に1件上げることを目標にまずは1ヶ月やってみようと思います。

VMwareを中心とした仮想化テクノロジーやHCIとクラウドをテーマに頑張ります。
body .syntaxhighlighter { margin: 5px 0; border: 1px dashed rgb(47, 111, 171); padding: 1em; width: calc(100% - 2em) !important; }