标签:des Lucene style blog http color os io 使用
1
2
3
4
5
6
7
8
9
10
11
12
13
|
##修改host root@m1:~ # cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.1.10 m1.idoall.org m1 192.168.1.11 m2.idoall.org m2 192.168.1.12 s1.idoall.org s1 192.168.1.13 s2.idoall.org s2 # The following lines are desirable for IPv6 capable hosts ff02::1 ip6-allnodes ff02::2 ip6-allrouters |
1
2
3
4
5
6
7
8
|
##修改成静态IP地址 root@m1:~ # vi /etc/network/interfaces iface wlan0 inet static address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 192.168.1.1 dns-nameservers 8.8.8.8 |
1
2
3
|
##修改主机名称 root@m1:~ # cat /etc/hostname m1.idoall.org |
1
|
root@m1:~ # ufw disable |
1
2
3
4
5
6
7
8
9
10
11
12
13
|
##添加 PPA repository 到系统 root@m1:~ # add-apt-repository ppa:webupd8team/java root@m1:~ # apt-get update root@m1:~ # sudo apt-get upgrade ##过程中会弹出个框,选择YES,因为要下载二进制包,所以可能会慢一些 root@m1:~ # apt-get install oracle-java7-installer ##将Oracle 7 设置成默认版本 root@m1:~ # apt-get install oracle-java7-set-default ##查看当前Java版本 root@m1:~ # java -version java version "1.7.0_67" Java(TM) SE Runtime Environment (build 1.7.0_67-b01) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode) |
1
|
root@m1:~ # apt-get install mysql-server |
1
2
3
4
|
root@m1:~ # cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak root@m1:~ # vi /etc/mysql/my.cnf #bind-address = 127.0.0.1 bind-address = 0.0.0.0 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
[client] default - character - set =utf8 [mysqld] transaction - isolation = READ - COMMITTED # Disabling symbolic-links is recommended to prevent assorted security risks; # to do so, uncomment this line: # symbolic-links=0 character - set -server=utf8 key_buffer = 16M key_buffer_size = 32M max_allowed_packet = 32M thread_stack = 256K thread_cache_size = 64 query_cache_limit = 8M query_cache_size = 64M query_cache_type = 1 max_connections = 550 # log-bin should be on a disk with enough free space # NOTE: replace ‘/x/home/mysql/logs/binary‘ below with # an appropriate path for your system. log-bin=/x/home/mysql/logs/ binary /mysql_binary_log # For MySQL version 5.1.8 or later. Comment out binlog_format for older versions. binlog_format = mixed read_buffer_size = 2M read_rnd_buffer_size = 16M sort_buffer_size = 8M join_buffer_size = 8M # InnoDB settings innodb_file_per_table = 1 innodb_flush_log_at_trx_commit = 2 innodb_log_buffer_size = 64M innodb_buffer_pool_size = 4G innodb_thread_concurrency = 8 innodb_flush_method = O_DIRECT innodb_log_file_size = 512M [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
root@m1:~# mysql -u root -p Enter password : Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 42 Server version: 5.5.38-0ubuntu0.14.04.1 (Ubuntu) Copyright (c) 2000, 2014, Oracle and / or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and / or its affiliates. Other names may be trademarks of their respective owners. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement. ## Cloudera manager db user , database and grant mysql> create user ‘cmf‘ @ ‘%‘ identified by ‘xyz‘ ; Query OK, 0 rows affected (0.00 sec) mysql> create database cmf DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on cmf.* to ‘cmf‘ @ ‘%‘ identified by ‘xyz‘ ; Query OK, 0 rows affected (0.00 sec) ## For activity monitor mysql> create user ‘amon‘ @ ‘%‘ identified by ‘xyz‘ ; Query OK, 0 rows affected (0.00 sec) mysql> create database amon DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on amon.* to ‘amon‘ @ ‘%‘ identified by ‘xyz‘ ; Query OK, 0 rows affected (0.00 sec) ## Hive Meta store mysql> create user ‘hive‘ @ ‘%‘ identified by ‘xyz‘ ; Query OK, 0 rows affected (0.00 sec) mysql> create database metastore DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; Query OK, 1 row affected (0.00 sec) mysql> grant all privileges on metastore.* to ‘hive‘ @ ‘%‘ identified by ‘xyz‘ ; Query OK, 0 rows affected (0.00 sec) ## Flush all changes mysql> FLUSH PRIVILEGES ; Query OK, 0 rows affected (0.00 sec) |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
root@m1:~ # service mysql restart root@m1:~ # netstat -tulpn | grep :3306 tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2207 /mysqld root@m1:~ # apt-get install libmysql-java Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: liblog4j1.2-java libcommons-logging-java The following NEW packages will be installed: libmysql-java 0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded. Need to get 894 kB of archives. After this operation, 1,060 kB of additional disk space will be used. Get:1 http: //mirrors .sohu.com /ubuntu/ trusty /universe libmysql-java all 5.1.28-1 [894 kB] Fetched 894 kB in 1s (718 kB /s ) Selecting previously unselected package libmysql-java. (Reading database ... 96338 files and directories currently installed.) Preparing to unpack ... /libmysql-java_5 .1.28-1_all.deb ... Unpacking libmysql-java (5.1.28-1) ... Setting up libmysql-java (5.1.28-1) ... root@m1:~ # |
1
2
3
4
5
6
7
8
|
##备份文件 root@m1:~ # cp /etc/lsb-release /etc/lsb-release.bak ##使用VI编译文件,暂时修改成Ubuntu12.04 LTS的信息 root@m1:~ # vi /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION= "Ubuntu 12.04.3 LTS" |
1
2
|
root@m1:~ # wget http://ftp.cn.debian.org/debian/pool/main/f/fuse/fuse-utils_2.9.0-2+deb7u1_all.deb root@m1:~ # dpkg -i fuse-utils_2.9.0-2+deb7u1_all.deb |
1
2
3
|
root@m1:~ # curl "http://archive.cloudera.com/cm5/ubuntu/precise/amd64/cm/cloudera.list" -o /etc/apt/sources.list.d/cloudera_precise.list root@m1:~ # curl -s http://archive.cloudera.com/cdh5/ubuntu/precise/amd64/cdh/archive.key | sudo apt-key add - root@m1:~ # apt-get update |
1
|
root@m1:~ # apt-get install cloudera-manager-daemons cloudera-manager-server |
1
2
3
4
5
6
|
root@m1:~ # vi /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db. type =mysql com.cloudera.cmf.db.host=localhost com.cloudera.cmf.db.name=cmf com.cloudera.cmf.db.user=cmf com.cloudera.cmf.db.password=xyz |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
##安装ntp ,CM agents需要用到"ntpdc"(4台机器都要执行) root@m1:~ # apt-get install ntp Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libopts25 Suggested packages: ntp-doc The following NEW packages will be installed: libopts25 ntp 0 upgraded, 2 newly installed, 0 to remove and 4 not upgraded. Need to get 666 kB of archives. After this operation, 1,668 kB of additional disk space will be used. Do you want to continue ? [Y /n ] y Get:1 http: //mirrors .sohu.com /ubuntu/ trusty /main libopts25 amd64 1:5.18-2ubuntu2 [55.3 kB] Get:2 http: //mirrors .sohu.com /ubuntu/ trusty /main ntp amd64 1:4.2.6.p5+dfsg-3ubuntu2 [611 kB] Fetched 666 kB in 1s (537 kB /s ) Selecting previously unselected package libopts25:amd64. (Reading database ... 95843 files and directories currently installed.) Preparing to unpack ... /libopts25_1 %3a5.18-2ubuntu2_amd64.deb ... Unpacking libopts25:amd64 (1:5.18-2ubuntu2) ... Selecting previously unselected package ntp. Preparing to unpack ... /ntp_1 %3a4.2.6.p5+dfsg-3ubuntu2_amd64.deb ... Unpacking ntp (1:4.2.6.p5+dfsg-3ubuntu2) ... Processing triggers for man -db (2.6.7.1-1) ... Processing triggers for ureadahead (0.100.0-16) ... Setting up libopts25:amd64 (1:5.18-2ubuntu2) ... Setting up ntp (1:4.2.6.p5+dfsg-3ubuntu2) ... * Starting NTP server ntpd [ OK ] Processing triggers for libc-bin (2.19-0ubuntu6.1) ... Processing triggers for ureadahead (0.100.0-16) ... root@m1:~ # |
1
2
3
|
root@m1:~ # service cloudera-scm-server start Starting cloudera-scm-server: * cloudera-scm-server started root@m1:~ # |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
2014-08-26 23:07:52,643 INFO [JvmPauseMonitor:debug.JvmPauseMonitor@236] Detected pause in JVM or host machine (e.g. a stop the world GC, or JVM not scheduled): paused approximately 1182ms: GC pool ‘Copy‘ had collection(s): count=1 time =1641ms 2014-08-26 23:07:52,644 INFO [JvmPauseMonitor:debug.JvmPauseMonitor@236] Detected pause in JVM or host machine (e.g. a stop the world GC, or JVM not scheduled): paused approximately 1634ms: GC pool ‘Copy‘ had collection(s): count=1 time =1641ms 2014-08-26 23:07:52,696 INFO [WebServerImpl:servlet.DispatcherServlet@339] FrameworkServlet ‘Spring MVC Dispatcher Servlet‘ : initialization completed in 18068 ms 2014-08-26 23:07:52,793 INFO [WebServerImpl:cmon.JobDetailGatekeeper@127] ActivityMonitor configured to allow job details for all jobs. 2014-08-26 23:07:53,407 INFO [SearchRepositoryManager-0:components.SearchRepositoryManager@399] Initializing SearchTemplateManager:2014-08-27T06:07:53.407Z 2014-08-26 23:07:53,730 INFO [SearchRepositoryManager-0:components.SearchRepositoryManager@403] Generating entities:2014-08-27T06:07:53.730Z 2014-08-26 23:07:53,821 INFO [SearchRepositoryManager-0:components.SearchRepositoryManager@407] Num entities:112 2014-08-26 23:07:53,822 INFO [SearchRepositoryManager-0:components.SearchRepositoryManager@409] Generating documents:2014-08-27T06:07:53.822Z 2014-08-26 23:07:53,891 INFO [SearchRepositoryManager-0:components.SearchRepositoryManager@411] Num docs:124 2014-08-26 23:07:53,892 INFO [SearchRepositoryManager-0:components.SearchRepositoryManager@352] Constructing repo:2014-08-27T06:07:53.892Z 2014-08-26 23:07:53,979 INFO [WebServerImpl:mortbay.log@67] jetty-6.1.26.cloudera.2 2014-08-26 23:07:54,008 INFO [WebServerImpl:mortbay.log@67] Started SelectChannelConnector@0.0.0.0:7180 2014-08-26 23:07:54,009 INFO [WebServerImpl:cmf.WebServerImpl@292] Started Jetty server. 2014-08-26 23:07:55,276 INFO [SearchRepositoryManager-0:components.SearchRepositoryManager@354] Finished constructing repo:2014-08-27T06:07:55.276Z |
1
|
root@m1:~ # sudo ln -s /usr/bin/update-alternatives /usr/sbin/update-alternatives |
#提供SSH登录凭据,这里建议使用root帐号,避免一些新同学,对其他帐号的权限设置不完整,导致后面安装出现错误。如何设置4台机器之前SSH免密码登录,就不在这里介绍了,如果不会,可以去搜索下。在这之前4台机器请配置好SSH免密码登录。
#如果在安装过程中出现了以下错误“ImportError: No module named _io”,或者如下图中的提示,不用担心,这是一个已知问题。这是因为CDH5使用的Python版本问题。执行完下面的脚本后,点击重试就可以顺利的完成安装了。如果出现打不开CM Agent的log日志提示,那很可能是你的Host配置有问题,请参考本文最初写的Host配置。
1
2
|
root@m1:~ # mv /usr/lib/cmf/agent/build/env/bin/python /usr/lib/cmf/agent/build/env/bin/python.bak root@m1:~ # cp /usr/bin/python2.7 /usr/lib/cmf/agent/build/env/bin/python |
#继续安装选定 Parcel
#如果你想要提高速度,可以按以下方法离线安装
1、使用迅雷到http://archive.cloudera.com/cdh5/parcels/5.1.2/目录,下载CDH-5.1.2-1.cdh5.1.2.p0.3-precise.parcel和mainfest.json文件
2、上传到/opt/cloudera/parcel-repo目录中,同时创建一个CDH-5.1.2-1.cdh5.1.2.p0.3-precise.parcel.sha文件,内容为"a492e4b6dece2850f0a37f2bf613ecb2980dfd37",这个值可以在下载目录中的manifest.json文件中找到。然后看相对应的json->parcelName同一级的hash值。
3、下载http://archive.cloudera.com/accumulo-c5/parcels/1.6.0.51/ACCUMULO-1.6.0-1.cdh5.1.0.p0.51-precise.parcel、http://archive.cloudera.com/sqoop-connectors/parcels/1.2/SQOOP_NETEZZA_CONNECTOR-1.2c5-precise.parcel、http://archive.cloudera.com/sqoop-connectors/parcels/1.2/SQOOP_TERADATA_CONNECTOR-1.2c5-precise.parcel
4、参考步骤2,创建相应的.sha文件,.sha文件中的内容如下:
1
2
3
4
|
root@m1: /opt/cloudera/parcel-repo # echo "a719f373833a63108c616afb034d97c4e11405d5" >> ACCUMULO-1.6.0-1.cdh5.1.0.p0.51-precise.parcel.sha root@m1: /opt/cloudera/parcel-repo # echo "a492e4b6dece2850f0a37f2bf613ecb2980dfd37" >> CDH-5.1.2-1.cdh5.1.2.p0.3-precise.parcel.sha root@m1: /opt/cloudera/parcel-repo # echo "48bedfff38f742d32541854e24b3310992616027" >> SQOOP_NETEZZA_CONNECTOR-1.2c5-precise.parcel.sha root@m1: /opt/cloudera/parcel-repo # echo "76566b4797bd061d01cf25b36b21b26927ada9a4" >> SQOOP_TERADATA_CONNECTOR-1.2c5-precise.parcel.sha |
5、设置文件的使用权限
1
2
|
root@m1: /opt/cloudera/parcel-repo # chmod 777 -R . root@m1: /opt/cloudera/parcel-repo # chown cloudera-scm:cloudera-scm ./* |
6、查看下载后的文件列表
1
2
3
4
5
6
7
8
9
10
11
12
|
root@m1: /opt/cloudera/parcel-repo # ll total 1709280 drwxrwxrwx 2 cloudera-scm cloudera-scm 4096 Sep 1 01:16 ./ drwxr-xr-x 6 root root 4096 Sep 1 01:51 ../ -rwxrwxrwx 1 cloudera-scm cloudera-scm 13204338 Aug 31 21:37 ACCUMULO-1.6.0-1.cdh5.1.0.p0.51-precise.parcel* -rwxrwxrwx 1 cloudera-scm cloudera-scm 41 Sep 1 01:15 ACCUMULO-1.6.0-1.cdh5.1.0.p0.51-precise.parcel.sha* -rwxrwxrwx 1 cloudera-scm cloudera-scm 1727519860 Sep 1 00:27 CDH-5.1.2-1.cdh5.1.2.p0.3-precise.parcel* -rwxrwxrwx 1 cloudera-scm cloudera-scm 41 Sep 1 01:15 CDH-5.1.2-1.cdh5.1.2.p0.3-precise.parcel.sha* -rwxrwxrwx 1 cloudera-scm cloudera-scm 41602 Sep 1 01:13 SQOOP_NETEZZA_CONNECTOR-1.2c5-precise.parcel* -rwxrwxrwx 1 cloudera-scm cloudera-scm 41 Sep 1 01:16 SQOOP_NETEZZA_CONNECTOR-1.2c5-precise.parcel.sha* -rwxrwxrwx 1 cloudera-scm cloudera-scm 9499051 Sep 1 01:13 SQOOP_TERADATA_CONNECTOR-1.2c5-precise.parcel* -rwxrwxrwx 1 cloudera-scm cloudera-scm 41 Sep 1 01:16 SQOOP_TERADATA_CONNECTOR-1.2c5-precise.parcel.sha* |
#主机正确性检查,和当前m1.idoall.org的CDH5.12组件版本汇总。
#选择要安装的集群服务,我们来安装ZooKeeper。如下图选择
#自定义角色分配
#最后我们恢复ubuntu 14.04版本信息
1
2
3
|
##恢复Ubuntu14.04备份文件 root@cm1:~ # rm /etc/lsb-release /etc/lsb-release.bak root@cm1:~ # mv /etc/lsb-release.bak /etc/lsb-release |
到此为主,在Ubuntu14.04下使用apt-get方式,安装CDH5.12已经成功。并且支持中文,后面有什么服务或者机器要添加的,可以自己来做了。如果你还不会,可以学习王自如一样找老罗现场直播飙口才去了。。。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
alter table CLIENT_CONFIGS convert to character set utf8; alter table CLUSTERS convert to character set utf8; alter table CLUSTERS_AUD convert to character set utf8; alter table CLUSTER_ACTIVATED_RELEASES convert to character set utf8; alter table CLUSTER_ACTIVATED_RELEASES_AUD convert to character set utf8; alter table CLUSTER_MANAGED_RELEASES convert to character set utf8; alter table CLUSTER_UNDISTRIBUTED_RELEASES convert to character set utf8; alter table CM_PEERS convert to character set utf8; alter table CM_VERSION convert to character set utf8; alter table COMMANDS convert to character set utf8; alter table COMMAND_SCHEDULES convert to character set utf8; alter table CONFIGS convert to character set utf8; alter table CONFIGS_AUD convert to character set utf8; alter table CONFIG_CONTAINERS convert to character set utf8; alter table CREDENTIALS convert to character set utf8; alter table GLOBAL_SETTINGS convert to character set utf8; alter table HOSTS convert to character set utf8; alter table HOSTS_AUD convert to character set utf8; alter table HOST_TEMPLATES convert to character set utf8; alter table HOST_TEMPLATE_TO_ROLE_CONF_GRP convert to character set utf8; alter table METRICS convert to character set utf8; alter table PARCELS convert to character set utf8; alter table PARCEL_COMPONENTS convert to character set utf8; alter table PROCESSES convert to character set utf8; alter table PROCESS_ACTIVE_RELEASES convert to character set utf8; alter table RELEASES convert to character set utf8; alter table RELEASES_AUD convert to character set utf8; alter table REVISIONS convert to character set utf8; alter table ROLES convert to character set utf8; alter table ROLES_AUD convert to character set utf8; alter table ROLE_CONFIG_GROUPS convert to character set utf8; alter table ROLE_CONFIG_GROUPS_AUD convert to character set utf8; alter table ROLE_STALENESS_STATUS convert to character set utf8; alter table SCHEMA_VERSION convert to character set utf8; alter table SERVICES convert to character set utf8; alter table SERVICES_AUD convert to character set utf8; alter table SNAPSHOT_POLICIES convert to character set utf8; alter table USERS convert to character set utf8; alter table USER_ROLES convert to character set utf8; alter table USER_SETTINGS convert to character set utf8; |
Ubuntu14.04用apt安装CDH5.1.2[Apache Hadoop 2.3.0]
标签:des Lucene style blog http color os io 使用
原文地址:http://www.cnblogs.com/lion.net/p/3950619.html