[root@master ~]# vi /etc/security/limits.conf # End of file * soft nofile 65536 * hard nofile 65536 * soft nproc 131072 * hard nproc 131072
关闭当前的shell窗口,重新打开ulimit -a查看是否设置成功
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[root@master ~]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 31116 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 65536 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 131072 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited
禁用SELinux和PackageKit将检查umask值
禁用selinux(所有机器)
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@master ~]# vi /etc/selinux/config # 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 values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
[root@master mysql]# cd /usr/local/mysql/ [root@master mysql]# cp ./support-files/my-default.cnf /etc/my.cnf [root@master mysql]# vi /etc/my.cnf
[mysqld] # Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%. # innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging # changes to the binary log between backups. # log_bin # These are commonly set, remove the # and set as required. basedir = /usr/local/mysql datadir = /usr/local/mysql/data port = 3306 # server_id = ..... socket = /tmp/mysql.sock character-set-server = utf8 log_error = error.log # socket = ..... # Remove leading # to set options mainly useful for reporting servers. # The server defaults are faster for transactions and fast SELECTs. # Adjust sizes as needed, experiment to find the optimal values. # join_buffer_size = 128M # sort_buffer_size = 2M # read_rnd_buffer_size = 2M #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIO skip_ssl
[root@master tools]# vi /var/kerberos/krb5kdc/kadm5.acl */admin@BIGDATA.COM *
初始化数据库
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
[root@master ~]# kdb5_util create -s -r BIGDATA.COM Loading random data Initializing database '/var/kerberos/krb5kdc/principal' for realm 'BIGDATA.COM', master key name 'K/M@BIGDATA.COM' You will be prompted for the database Master Password. It is important that you NOT FORGET this password. Enter KDC database master key: # 数据库密码,可以回车 Re-enter KDC database master key to verify: # 数据库密码,可以回车
[root@master ~]# kadmin.local Authenticating as principal root/admin@BIGDATA.COM with password. kadmin.local: addprinc admin/admin # 新增admin/admin用户 WARNING: no policy specified for admin/admin@BIGDATA.COM; defaulting to no policy Enter password for principal "admin/admin@BIGDATA.COM": # 输入超级管理员密码 Re-enter password for principal "admin/admin@BIGDATA.COM": # 输入超级管理员密码 Principal "admin/admin@BIGDATA.COM" created.
[root@master mysql]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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. ## 设置登录密码 mysql>set password for'root'@'localhost'=password('000000'); Query OK, 0 rows affected (0.00 sec) ## 添加远程登录用户 mysql> grant all privileges on *.* to 'root'@'%' identified by '000000'; Query OK, 0 rows affected (0.00 sec)
root远程连接赋所有权限,grant all privileges on . to ‘root‘@’%’ with grant option;
[root@master ~]# ambari-server setup Using python /usr/bin/python Setup ambari-server Checking SELinux... SELinux status is 'enabled' SELinux mode is 'permissive' WARNING: SELinux is set to 'permissive' mode and temporarily disabled. # 检查防火墙是否关闭 OK to continue [y/n] (y)? y Customize user account for ambari-server daemon [y/n] (n)? y # 提示是否自定义设置 Enter user account for ambari-server daemon (root): # 如果直接回车就是默认选择root用户 Adjusting ambari-server permissions and ownership... Checking firewall status... Checking JDK... [1] Oracle JDK 1.8 + Java Cryptography Extension (JCE) Policy Files 8 [2] Custom JDK ============================================================================== Enter choice (1): 2 # 设置JDK WARNING: JDK must be installed on all hosts and JAVA_HOME must be valid on all hosts. WARNING: JCE Policy files are required for configuring Kerberos security. If you plan to use Kerberos,please make sure JCE Unlimited Strength Jurisdiction Policy Files are valid on all hosts. Path to JAVA_HOME: /home/tools/jdk1.8.0_291 # JAVA_HOME地址 Validating JDK on Ambari Server...done. Check JDK version for Ambari Server... JDK version found: 8 Minimum JDK version is 8 for Ambari. Skipping to setup different JDK for Ambari Server. Checking GPL software agreement... GPL License for LZO: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html Enable Ambari Server to download and install GPL Licensed LZO packages [y/n] (n)? Completing setup... Configuring database... Enter advanced database configuration [y/n] (n)? y # 是否自定义配置数据库 Configuring database... ============================================================================== Choose one of the following options: [1] - PostgreSQL (Embedded) [2] - Oracle [3] - MySQL / MariaDB [4] - PostgreSQL [5] - Microsoft SQL Server (Tech Preview) [6] - SQL Anywhere [7] - BDB ============================================================================== Enter choice (1): 3 # Mysql Hostname (localhost): # Mysql地址 Port (3306): # Mysql端口 Database name (ambari): # 数据库名 Username (ambari): # 用户名 Enter Database Password (bigdata): # 密码 Re-enter password: # 再次输入密码 Configuring ambari database... Should ambari use existing default jdbc /usr/share/java/mysql-connector-java.jar [y/n] (y)? Configuring remote database connection properties... WARNING: Before starting Ambari Server, you must run the following DDL directly from the database shell to create the schema: /var/lib/ambari-server/resources/Ambari-DDL-MySQL-CREATE.sql Proceed with configuring remote database connection properties [y/n] (y)? Extracting system views... ambari-admin-2.7.3.0.139.jar .... Ambari repo file contains latest json url http://public-repo-1.hortonworks.com/HDP/hdp_urlinfo.json, updating stacks repoinfos with it... Adjusting ambari-server permissions and ownership... Ambari Server 'setup' completed successfully.
启动日志查看
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
[root@master ~]# ambari-server start Using python /usr/bin/python Starting ambari-server Ambari Server running with administrator privileges. Organizing resource files at /var/lib/ambari-server/resources... Ambari database consistency check started... Server PID at: /var/run/ambari-server/ambari-server.pid Server out at: /var/log/ambari-server/ambari-server.out Server log at: /var/log/ambari-server/ambari-server.log Waiting for server start................. Server started listening on 8080
DB configs consistency check: no errors and warnings were found. Ambari Server 'start' completed successfully. # 可通过192.168.1.121:8080查看ambari界面 # 通过tail查看日志 [root@master ~]# tail -f /var/log/ambari-server/ambari-server.log
resource_management.core.exceptions.Fail: Check db_connection_check was unsuccessful. Exit code: 1. Message: The MySQL JDBC driver has not been set. Please ensure that you have executed ‘ambari-server setup –jdbc-db=mysql –jdbc-driver=/usr/share/jdbc_driver’.
Specified key was too long; max key length is 767 bytes
解决:Mysql 5.6数据库需要设置set global innodb_file_format=BARRACUDA;和set global innodb_large_prefix=1;
If Ranger Hive Plugin is disabled. hive.security.authorization.manager needs to be set to org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory
Warning Ambari Metrics hbase_master_heapsize 896 Value is less than the recommended default of 1024. HBase Master Heap Size. In embedded mode, total heap size is sum of master and regionserver heap sizes.
解决:在Ambari Metrics中将HBase Master Maximum Memory调整为1024
Knox
dfs.permissions.enabled needs to be set to true if Ranger HDFS Plugin is enabled.
解决:在HDFS中将dfs.permissions.enabled设置为true
Atlas
Atlas is configured to use the HBase installed in this cluster. If you would like Atlas to use another HBase instance, please configure this property and HBASE_CONF_DIR variable in atlas-env appropriately.