{"id":850,"date":"2014-08-26T10:00:20","date_gmt":"2014-08-26T01:00:20","guid":{"rendered":"http:\/\/www.skyarch.net\/blog\/?p=850"},"modified":"2025-12-22T16:08:59","modified_gmt":"2025-12-22T07:08:59","slug":"aws-ec2%e3%82%a4%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%b3%e3%82%b9%e3%81%aerhel7%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/www.skyarch.net\/blog\/aws-ec2%e3%82%a4%e3%83%b3%e3%82%b9%e3%82%bf%e3%83%b3%e3%82%b9%e3%81%aerhel7%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6\/","title":{"rendered":"AWS EC2\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306eRHEL7\u306b\u3064\u3044\u3066"},"content":{"rendered":"<p>\u3053\u3093\u3061\u306b\u306f\u3002irihara\u3067\u3059\u3002<br \/>\n2014\u5e746\u670810\u65e5\u306bRed Hat Enterprise Linux 7\uff08\u4ee5\u4e0bRHEL 7\uff09\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u305d\u308c\u306b\u4f34\u3044\u3001AWS\u3067\u306f\u65e9\u304f\u3082\u3001RHEL 7\u306eAMI\u304c\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u9078\u629e\u53ef\u80fd\u306a\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u30bf\u30a4\u30d7\u3068\u3057\u3066\u306f\u3001t2.micro\u304b\u3089hs1.8xlarge\u304c\u3042\u308a\u307e\u3059\u304c\u3001<br \/>\n\u3072\u3068\u307e\u305a\u3001t2.micro\uff081vcpu\u30011GB\u30e1\u30e2\u30ea\u30fc\uff09\u3067Launch\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h2>RHEL7\u306e\u4e3b\u306a\u7279\u5fb4<\/h2>\n<p>\u30fbFedora19\u3068\u3001Linux Kernel 3.10\u3092\u30d9\u30fc\u30b9\u3068\u3057\u3066\u3044\u308b\u3002<br \/>\n\u30fb\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u304c\u3001ext4\u304b\u3089xfs\u306b\u5909\u66f4\u3055\u308c\u3066\u3044\u308b\u3002<br \/>\n\u30fb\u52d5\u4f5c\u74b0\u5883\u3068\u3057\u3066\u306f\u3001X86_64\u3001IBM Power\u3001IBM System z<br \/>\n\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306f64bit\u7248\u306e\u307f<br \/>\n\uff0832bit\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u7528\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u540c\u68b1\uff09<br \/>\n\u203b\u3053\u306e\u305f\u3081\u300164bit\u7248\u306eAMI\u306e\u307f\u9078\u629e\u53ef\u80fd\u3067\u3059\u3002<br \/>\nRHEL 7\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u4e3b\u306a\u30bd\u30d5\u30c8\u30a6\u30a8\u30a2\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30d1\u30c3\u30b1\u30fc\u30b8\u60c5\u5831<\/h2>\n<pre>\nkernel 3.10.0\nhttpd 2.4.6\nphp 5.4.16\ntomcat 7.0.42\nMySQL\uff08MariaDB\uff095.5.37\nPostgreSQL 9.2.7\nOpenLDAP 2.4.39\nsamba 4.1.1\npostfix 2.10.1\nmailman 2.1.15\nDovecot 2.2.10\nBIND 9.9.4\nSquid 3.3.8\nperl 5.16.3\nruby 2.0.0.353\n<\/pre>\n<p>\u307e\u305f\u3001\u5f93\u6765\u306e6\u7cfb\u3068\u306e\u9055\u3044\u3068\u3057\u3066\u5e7e\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001\u4eca\u56de\u306fRHEL 7\u3092\u4f7f\u7528\u3057\u3066\u3001LAMP\u74b0\u5883\u3092<br \/>\n\u69cb\u7bc9\u30fb\u904b\u7528\u3059\u308b\u969b\u306b\u7ba1\u7406\u7cfb\u30b3\u30de\u30f3\u30c9\u306a\u3069\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u6c17\u4ed8\u3044\u305f\u70b9\u3092\u4e2d\u5fc3\u306b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30b5\u30fc\u30d3\u30b9\u7cfb\u306e\u30b3\u30de\u30f3\u30c9<\/h2>\n<p>6\u7cfb\u3068\u306e\u6700\u3082\u7570\u306a\u308b\u70b9\u3068\u3057\u3066\u306f\u3001\u30b5\u30fc\u30d3\u30b9\u306e\u7ba1\u7406\u65b9\u6cd5\u304c\u5927\u304d\u304f\u7570\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4eca\u307e\u3067\u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5\u30fb\u505c\u6b62\u3092\u5b9f\u884c\u3059\u308b\u969b\u306b\u4f7f\u7528\u3057\u3066\u3044\u305f\u3001\/etc\/init.d\/\u914d\u4e0b\u306e\u30b5\u30fc\u30d3\u30b9\u304c<br \/>\n\u307b\u3068\u3093\u3069\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\nRHEL 7\u7cfb\u3067\u306f\u3001chkconfig \/ service \u30b3\u30de\u30f3\u30c9\u304c\u5ec3\u6b62\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u307e\u305f\u3001runlevel\u306e\u6982\u5ff5\u304c\u7121\u304f\u306a\u308a\u3001<br \/>\ntarget\u3068\u8a00\u3046\u6982\u5ff5\u306b\u5207\u308a\u66ff\u308f\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001initd\u306e\u66ff\u308f\u308a\u3068\u3057\u3066\u30b5\u30fc\u30d3\u30b9\u306e\u7ba1\u7406\u3092systemd\u3067\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u30b3\u30de\u30f3\u30c9\u4f53\u7cfb\u306a\u3069\u3082\u5927\u304d\u304f\u5909\u308f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30fbsystemctl<br \/>\n\u2026\u30b5\u30fc\u30d3\u30b9\u306e\u8d77\u52d5\u3084\u505c\u6b62\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\n\u4eca\u307e\u3067\u4f7f\u7528\u3057\u3066\u3044\u305f\u3001\/etc\/init.d\/ &lt;\u30b5\u30fc\u30d3\u30b9\u540d&gt; { start | stop | status }\u306e\u66ff\u308f\u308a\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<br \/>\n\u4f7f\u3044\u65b9\u3068\u3057\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\uff1asystemctl { start | stop | status } &lt;\u30b5\u30fc\u30d3\u30b9\u540d&gt;<br \/>\n\u2026\/etc\/init.d\/\u3067\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5\u30fb\u505c\u6b62\u3059\u308b\u969b\u306e\u4ee3\u66ff\u65b9\u6cd5\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>systemctl { enable | disable } &lt;\u30b5\u30fc\u30d3\u30b9\u540d&gt;<br \/>\n\u2026\u30b5\u30fc\u30d3\u30b9\u306e\u81ea\u52d5\u8d77\u52d5\u306e\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002chkconfig\u306e\u66ff\u308f\u308a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>systemctl is-enabled &lt;\u30b5\u30fc\u30d3\u30b9\u540d&gt;<br \/>\n\u2026\u30b5\u30fc\u30d3\u30b9\u306e\u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\u306e\u78ba\u8a8d\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p>systemctl --type service<br \/>\n\u2026\u30b5\u30fc\u30d3\u30b9\u306e\u4e00\u89a7\u8868\u793a\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\n\u203b\u3061\u306a\u307f\u306b\u3001chkconfig --list\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u4eca\u307e\u3067\u3068\u306f\u3001\u968f\u5206\u7570\u306a\u308a\u307e\u3059\u3002\u3002<\/p>\n<pre>\n[root@test1 ~]# chkconfig --list\n\nNote: This output shows SysV services only and does not include native\nsystemd services. SysV configuration data might be overridden by native\nsystemd configuration.\n\nIf you want to list systemd services use 'systemctl list-unit-files'.\nTo see services enabled on particular target use\n'systemctl list-dependencies [target]'.\n\nchoose_repo 0:off 1:off 2:on 3:on 4:on 5:on 6:off\nnetconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off\nnetwork 0:off 1:off 2:on 3:on 4:on 5:on 6:off\nrh-cloud-firstboot 0:off 1:off 2:off 3:off 4:off 5:off 6:off\nrhnsd 0:off 1:off 2:on 3:on 4:on 5:on 6:off\n<\/pre>\n<p>\u25c6\u305d\u306e\u4ed6\u306e\u7ba1\u7406\u30b3\u30de\u30f3\u30c9<\/p>\n<p>RHEL 7\u3067\u306f\u3001\u6700\u5c0f\u69cb\u6210\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3046\u3068\u3001net-tools\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u305b\u3093\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001ifconfig\u3001netstat\u3001route\u3001arp\u30b3\u30de\u30f3\u30c9\u306a\u3069\u304c\u4f7f\u7528\u3067\u304d\u306a\u3044\u3088\u3046\u3067\u3059\u304c\u3001AWS\u306eRHEL 7\u3067Launch\u3057\u305f\u3068\u3053\u308d\u3001<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067net-tools\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d\u30016\u7cfb\u3068\u540c\u69d8\u4eca\u307e\u3067\u901a\u308a\u306b\u3001ifconfig\u3001netstat\u3001route\u3001arp\u306a\u3069\u306e\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u7528\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\n\u307e\u305f\u3001ps\u30b3\u30de\u30f3\u30c9\u3082\u4f7f\u7528\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\u3057\u304b\u3057\u3001\u4eca\u5f8c\u306e\u65b9\u5411\u6027\u3068\u3057\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u306b\u5207\u308a\u66ff\u308f\u3063\u3066\u3044\u304f\u3088\u3046\u3067\u3059\u3002<br \/>\nifconfig<br \/>\n\u21d2 ip address<br \/>\n\u2026\u8a2d\u5b9a\u3092\u78ba\u8a8d\u3059\u308b\u969b\u306f\u3001ip address show\u306a\u3069\u3067\u78ba\u8a8d\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\u30d1\u30b1\u30c3\u30c8\u306e\u9001\u53d7\u4fe1\u306e\u30a8\u30e9\u30fc\u6570\u306e\u78ba\u8a8d\u306a\u3069\u306f\u3001\u300cip -s l\u300d\u306b\u78ba\u8a8d\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>route<br \/>\n\u21d2 ip route<br \/>\n\u2026\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306e\u78ba\u8a8d\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>arp<br \/>\n\u21d2 ip n<br \/>\n\u2026\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305fIP\u30a2\u30c9\u30ec\u30b9\u3068MAC\u30a2\u30c9\u30ec\u30b9\u306e\u78ba\u8a8d\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>netstat<br \/>\n\u21d2 ss<br \/>\n\u2026\u300css -nat\uff08TCP\u30bd\u30b1\u30c3\u30c8\u306e\u78ba\u8a8d\uff09\u300d\u3001\u300css -nau\uff08UDP\u30bd\u30b1\u30c3\u30c8\u306e\u78ba\u8a8d\uff09\u300d\u304c\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\u25c6\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u3064\u3044\u3066<\/p>\n<p>RHEL 7\u3067\u306f\u3001MySQL\u306e\u66ff\u308f\u308a\u306bMariaDB\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3057\u3066\u63a1\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\nMariaDB\u306f\u3001MySQL\u304b\u3089\u6d3e\u751f\u3057\u305fRDBMS\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nyum\u30b3\u30de\u30f3\u30c9\u3067\u3001MySQL\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u8a66\u307f\u308b\u3068\u3001MariaDB\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre>\n[root@Hoge1 ~]# yum install mysql\nLoaded plugins: amazon-id, rhui-lb\nResolving Dependencies\n--> Running transaction check\n--> Package mariadb.x86_64 1:5.5.37-1.el7_0 will be installed\n--> Processing Dependency: mariadb-libs(x86-64) = 1:5.5.37-1.el7_0 for package: 1:mariadb-5.5.37-1.el7_0.x86_64\n\n...\n\n--> Finished Dependency Resolution\n\nDependencies Resolved\n\n=======================================================================================================================================\nPackage Arch Version Repository Size\n=======================================================================================================================================\nInstalling:\nmariadb x86_64 1:5.5.37-1.el7_0 rhui-REGION-rhel-server-releases 9.0 M\nInstalling for dependencies:\n[root@Hoge1 ~]# rpm -qa | grep mariadb\nmariadb-libs-5.5.37-1.el7_0.x86_64\nmariadb-5.5.37-1.el7_0.x86_64\n\u3057\u304b\u3057\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u30b3\u30de\u30f3\u30c9\u306f\u3001MySQL\u3067\u3059\u3002\n\n[root@Hoge1 ~]# which mariadb\n\/usr\/bin\/which: no mariadb in (\/usr\/local\/sbin:\/usr\/local\/bin:\/sbin:\/bin:\/usr\/sbin:\/usr\/bin:\/root\/bin)\n\n[root@Hoge1 ~]# which mysql\n\/bin\/mysql\n<\/pre>\n<p>\u3067\u306f\u3001MariaDB\u3068MySQL\u304c\u5168\u304f\u540c\u3058\u3082\u306e\u304b\u3068\u8a00\u3046\u3068\u3001\u305d\u3046\u3067\u306f\u306a\u304f\u3001\u4ed5\u69d8\u306a\u3069\u306f\u7570\u306a\u308a\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u306f\u5272\u611b\u3055\u305b\u3066\u9802\u304d\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/mariadb.org\/\u306a\u3069\u3067\u3054\u78ba\u8a8d\u9858\u3044\u307e\u3059\">https:\/\/mariadb.org\/\u306a\u3069\u3067\u3054\u78ba\u8a8d\u9858\u3044\u307e\u3059<\/a>\u3002<br \/>\n\u4ed6\u306b\u3082\u7570\u306a\u308b\u70b9\u3084firewalld\u306a\u3069\u306e\u65b0\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u307e\u305f\u306e\u6a5f\u4f1a\u306b\u53d6\u308a\u4e0a\u3052\u3055\u305b\u3066\u9802\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u25c6\u53c2\u8003<\/p>\n<p><a href=\"http:\/\/blog.yuryu.jp\/2014\/07\/systemd-quick-guide.html\">http:\/\/blog.yuryu.jp\/2014\/07\/systemd-quick-guide.html<\/a><br \/>\n<a href=\"http:\/\/devnull.synergy-marketing.co.jp\/2013\/07\/rhel7-systemctl\/\">http:\/\/devnull.synergy-marketing.co.jp\/2013\/07\/rhel7-systemctl\/<\/a><br \/>\n<a href=\"http:\/\/d.hatena.ne.jp\/enakai00\/20140712\/1405139841\">http:\/\/d.hatena.ne.jp\/enakai00\/20140712\/1405139841<\/a><br \/>\n<a href=\"http:\/\/d.hatena.ne.jp\/enakai00\/20140712\/1405139841\">http:\/\/d.hatena.ne.jp\/enakai00\/20140712\/1405139841<\/a><br \/>\n<a href=\"http:\/\/keyamb.hatenablog.com\/entry\/2013\/04\/21\/184217\">http:\/\/keyamb.hatenablog.com\/entry\/2013\/04\/21\/184217<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u3061\u306b\u306f\u3002irihara\u3067\u3059\u3002 2014\u5e746\u670810\u65e5\u306bRed Hat Enterprise Linux 7\uff08\u4ee5\u4e0bRHEL 7\uff09\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\u3002 \u305d\u308c\u306b\u4f34\u3044\u3001AWS\u3067\u306f\u65e9\u304f\u3082\u3001RHEL 7\u306eAMI\u304c\u914d\u5e03\u3055\u308c\u3066\u3044\u307e\u3059&#8230;<\/p>\n","protected":false},"author":1,"featured_media":223,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"http:\/\/www.skyarch.net\/blog\/?p=850","footnotes":""},"categories":[20,18,19],"tags":[102,43,42],"class_list":{"0":"post-850","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-aws","8":"category-os","9":"category-19","10":"tag-aws","11":"tag-redhat","12":"tag-rhel7","13":"ja"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/850","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/comments?post=850"}],"version-history":[{"count":7,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/850\/revisions"}],"predecessor-version":[{"id":30321,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/posts\/850\/revisions\/30321"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media\/223"}],"wp:attachment":[{"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/media?parent=850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/categories?post=850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyarch.net\/blog\/wp-json\/wp\/v2\/tags?post=850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}