连接成功
Last login: Wed Feb 22 19:31:24 2023 from 192.168.88.1
[root@node1 ~]# cat /export/server/hadoop-3.3.0/etc/hadoop/core-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. See accompanying LICENSE file.
--><!-- Put site-specific property overrides in this file. --><configuration>
<!-- 设置默认使用的文件系统 Hadoop支持file、HDFS、GFS、ali|Amazon云等文件系统 -->
<property><name>fs.defaultFS</name><value>hdfs://node1:8020</value>
</property><!-- 设置Hadoop本地保存数据路径 -->
<property><name>hadoop.tmp.dir</name><value>/export/data/hadoop-3.3.0</value>
</property><!-- 设置HDFS web UI用户身份 -->
<property><name>hadoop.http.staticuser.user</name><value>root</value>
</property><!-- 整合hive 用户代理设置 -->
<property><name>hadoop.proxyuser.root.hosts</name><value>*</value>
</property><property><name>hadoop.proxyuser.root.groups</name><value>*</value>
</property>
<!-- 文件系统垃圾桶保存时间 单位:分 -->
<property><name>fs.trash.interval</name><value>1440</value>
</property>
</configuration>
[root@node1 ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.64-1.el7.x86_64
您在 /var/spool/mail/root 中有新邮件
[root@node1 ~]# rpm -e mariadb-libs-5.5.64-1.el7.x86_64 --nodeps
[root@node1 ~]# rpm -qa|grep mariadb
[root@node1 ~]# mkdir /export/software/mysql
[root@node1 ~]# cd /export/software/mysql
[root@node1 mysql]# ll
总用量 533040
-rw-r--r-- 1 root root 545832960 2月 23 11:20 mysql-5.7.29-1.el7.x86_64.rpm-bundle.tar
[root@node1 mysql]# tar xvf mysql-5.7.29-1.el7.x86_64.rpm-bundle.tar
mysql-community-embedded-devel-5.7.29-1.el7.x86_64.rpm
mysql-community-test-5.7.29-1.el7.x86_64.rpm
mysql-community-embedded-5.7.29-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.29-1.el7.x86_64.rpm
mysql-community-libs-5.7.29-1.el7.x86_64.rpm
mysql-community-client-5.7.29-1.el7.x86_64.rpm
mysql-community-server-5.7.29-1.el7.x86_64.rpm
mysql-community-devel-5.7.29-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.29-1.el7.x86_64.rpm
mysql-community-common-5.7.29-1.el7.x86_64.rpm
[root@node1 mysql]# yum -y install libaio
已加载插件:fastestmirror, langpacks
Determining fastest mirrors* base: mirrors.tuna.tsinghua.edu.cn* extras: mirrors.tuna.tsinghua.edu.cn* updates: mirrors.tuna.tsinghua.edu.cn
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/3): extras/7/x86_64/primary_db | 249 kB 00:00:00
(2/3): base/7/x86_64/primary_db | 6.1 MB 00:00:02
(3/3): updates/7/x86_64/primary_db | 19 MB 00:00:12
软件包 libaio-0.3.109-13.el7.x86_64 已安装并且是最新版本
无须任何处理
[root@node1 mysql]# rpm -ivh mysql-community-common-5.7.29-1.el7.x86_64.rpm mysql-community-libs-5.7.29-1.el7.x86_64.rpm mysql-community-client-5.7.29-1.el7.x86_64.rpm mysql-community-server-5.7.29-1.el7.x86_64.rpm
警告:mysql-community-common-5.7.29-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...1:mysql-community-common-5.7.29-1.e################################# [ 25%]2:mysql-community-libs-5.7.29-1.el7################################# [ 50%]3:mysql-community-client-5.7.29-1.e################################# [ 75%]4:mysql-community-server-5.7.29-1.e################################# [100%]
[root@node1 mysql]# mysqld --initialize
[root@node1 mysql]# chown mysql:mysql /var/lib/mysql -R
[root@node1 mysql]# systemctl start mysqld.service
[root@node1 mysql]# cat /var/log/mysqld.log
2023-02-23T03:43:16.580339Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-02-23T03:43:18.234540Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-02-23T03:43:18.421383Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-02-23T03:43:18.500035Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 360b5b52-b32c-11ed-888d-000c29340b53.
2023-02-23T03:43:18.501254Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-02-23T03:43:19.887964Z 0 [Warning] CA certificate ca.pem is self signed.
2023-02-23T03:43:20.162146Z 1 [Note] A temporary password is generated for root@localhost: z(39#&?&pF?O
2023-02-23T03:43:57.841346Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-02-23T03:43:57.872210Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.29) starting as process 37730 ...
2023-02-23T03:43:57.896542Z 0 [Note] InnoDB: PUNCH HOLE support available
2023-02-23T03:43:57.896662Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2023-02-23T03:43:57.896669Z 0 [Note] InnoDB: Uses event mutexes
2023-02-23T03:43:57.896721Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2023-02-23T03:43:57.896731Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2023-02-23T03:43:57.896736Z 0 [Note] InnoDB: Using Linux native AIO
2023-02-23T03:43:57.917078Z 0 [Note] InnoDB: Number of pools: 1
2023-02-23T03:43:57.919925Z 0 [Note] InnoDB: Using CPU crc32 instructions
2023-02-23T03:43:57.955368Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2023-02-23T03:43:58.036981Z 0 [Note] InnoDB: Completed initialization of buffer pool
2023-02-23T03:43:58.079394Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2023-02-23T03:43:58.107082Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2023-02-23T03:43:58.137269Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2023-02-23T03:43:58.137408Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2023-02-23T03:43:58.269290Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2023-02-23T03:43:58.271662Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2023-02-23T03:43:58.271702Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2023-02-23T03:43:58.292372Z 0 [Note] InnoDB: 5.7.29 started; log sequence number 2630592
2023-02-23T03:43:58.309770Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2023-02-23T03:43:58.327667Z 0 [Note] Plugin 'FEDERATED' is disabled.
2023-02-23T03:43:58.354784Z 0 [Note] InnoDB: Buffer pool(s) load completed at 230223 11:43:58
2023-02-23T03:43:58.416170Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
2023-02-23T03:43:58.416216Z 0 [Note] Skipping generation of SSL certificates as certificate files are present in data directory.
2023-02-23T03:43:58.417327Z 0 [Warning] CA certificate ca.pem is self signed.
2023-02-23T03:43:58.417392Z 0 [Note] Skipping generation of RSA key pair as key files are present in data directory.
2023-02-23T03:43:58.418168Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2023-02-23T03:43:58.418225Z 0 [Note] IPv6 is available.
2023-02-23T03:43:58.418237Z 0 [Note] - '::' resolves to '::';
2023-02-23T03:43:58.418255Z 0 [Note] Server socket created on IP: '::'.
2023-02-23T03:43:58.430589Z 0 [Note] Event Scheduler: Loaded 0 events
2023-02-23T03:43:58.430915Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.29' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
[root@node1 mysql]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@node1 mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.29Copyright (c) 2000, 2020, 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> alter user user() identified by "hadoop";
Query OK, 0 rows affected (0.00 sec)mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'hadoop' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)mysql> ^DBye
[root@node1 mysql]# systemctl status mysqld
● mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: active (running) since 四 2023-02-23 11:43:58 CST; 4min 1s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlProcess: 37728 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)Process: 37708 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)Main PID: 37730 (mysqld)CGroup: /system.slice/mysqld.service└─37730 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid2月 23 11:43:56 node1.itcast.cn systemd[1]: Starting MySQL Server...
2月 23 11:43:58 node1.itcast.cn systemd[1]: Started MySQL Server.
[root@node1 mysql]# systemctl enable mysqld
[root@node1 mysql]# systemctl list-unit-files | grep mysqld
mysqld.service enabled
mysqld@.service disabled
[root@node1 mysql]#
P060【10-Apache hive安装部署--配置文件修改编辑】
在Windows中远程连接Linux中的MySQL数据库
192.168.88.151、node1.itcast.cn
连接成功
Last login: Thu Feb 23 12:10:56 2023
[root@node1 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.29 MySQL Community Server (GPL)Copyright (c) 2000, 2020, 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> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| engine_cost |
| event |
| func |
| general_log |
| gtid_executed |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| innodb_index_stats |
| innodb_table_stats |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| server_cost |
| servers |
| slave_master_info |
| slave_relay_log_info |
| slave_worker_info |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
31 rows in set (0.00 sec)mysql> select user,password,host from user;
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> select host,user from user;
+-----------+---------------+
| host | user |
+-----------+---------------+
| % | root |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+---------------+
4 rows in set (0.00 sec)mysql> update user set host='%' where user = 'root';
ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'
mysql> systemctl stop firewalld.service-> ^DBye
[root@node1 ~]# systemctl stop firewalld.service
[root@node1 ~]# systemctl disable firewalld.service
[root@node1 ~]# //查看开放的端口号
-bash: //查看开放的端口号: 没有那个文件或目录
[root@node1 ~]# firewall-cmd --list-all
FirewallD is not running
[root@node1 ~]#
[root@node1 ~]# //设置开放的端口号
-bash: //设置开放的端口号: 没有那个文件或目录
[root@node1 ~]# firewall-cmd --add-service=http --permanent
FirewallD is not running
[root@node1 ~]# firewall-cmd --add-port=3306/tcp --permanent
FirewallD is not running
[root@node1 ~]#
[root@node1 ~]# //重启防火墙
-bash: //重启防火墙: 没有那个文件或目录
[root@node1 ~]# firewall-cmd --reload
FirewallD is not running
[root@node1 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.29 MySQL Community Server (GPL)Copyright (c) 2000, 2020, 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> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -ADatabase changed
mysql>
mysql> select Host,User from user;
+-----------+---------------+
| Host | User |
+-----------+---------------+
| % | root |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+---------------+
4 rows in set (0.00 sec)mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)mysql> ^DBye
[root@node1 ~]#
P061【11-Apache hive安装部署--metastore服务启动方式】
[root@node1 ~]# start-all.sh
Starting namenodes on [node1]
上一次登录:四 2月 23 14:02:35 CST 2023从 192.168.88.1pts/1 上
Starting datanodes
上一次登录:四 2月 23 14:23:50 CST 2023pts/0 上
Starting secondary namenodes [node2]
上一次登录:四 2月 23 14:23:53 CST 2023pts/0 上
Starting resourcemanager
上一次登录:四 2月 23 14:24:00 CST 2023pts/0 上
Starting nodemanagers
上一次登录:四 2月 23 14:24:13 CST 2023pts/0 上
[root@node1 ~]# /export/server/apache-hive-3.1.2-bin/bin/hive --service metastore
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
2023-02-23 14:27:37: Starting Hive Metastore Server
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
^C[root@node1 ~]# nohup /export/server/apache-hive-3.1.2-bin/bin/hive --service metastore &
[1] 35181
[root@node1 ~]# nohup: 忽略输入并把输出追加到"nohup.out"[root@node1 ~]# jps
28691 ResourceManager
35683 Jps
28916 NodeManager
27689 NameNode
27885 DataNode
35181 RunJar
[root@node1 ~]# ll
总用量 20
-rw-r--r-- 1 root root 2 2月 21 21:14 1.txt
-rw-r--r-- 1 root root 4 2月 22 11:03 666.txt
-rw-------. 1 root root 1340 9月 11 2020 anaconda-ks.cfg
-rw-r--r-- 1 root root 34 2月 21 21:36 hello.txt
-rw------- 1 root root 1072 2月 23 14:28 nohup.out
[root@node1 ~]# kill-9 35181
-bash: kill-9: 未找到命令
[root@node1 ~]# kill 35181
[root@node1 ~]# jps
28691 ResourceManager
28916 NodeManager
37508 Jps
27689 NameNode
27885 DataNode
[1]+ 退出 143 nohup /export/server/apache-hive-3.1.2-bin/bin/hive --service metastore
[root@node1 ~]#
P062【12-Apache hive--新老客户端使用与hiveserver2服务】
第一代客户端
node3
第一代客户端
node1
/export/server/apache-hive-3.1.2-bin/bin/hive
连接成功
Last login: Thu Feb 23 11:14:41 2023 from 192.168.88.1
[root@node3 ~]# /export/server/apache-hive-3.1.2-bin/bin/hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
which: no hbase in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/export/server/jdk1.8.0_241/bin:/export/server/hadoop-3.3.0/bin:/export/server/hadoop-3.3.0/sbin:/root/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Hive Session ID = bd951b9d-11c9-43d5-ae6d-3b82a7a96823Logging initialized using configuration in jar:file:/export/server/apache-hive-3.1.2-bin/lib/hive-common-3.1.2.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
Hive Session ID = cd48f8fb-6073-4ddf-a5cb-2b619eba70cf
hive> show da
data date date( date_add( date_format( date_sub( datediff( datetime day( dayofmonth( dayofweek(
hive> show databases;
OK
default
Time taken: 0.923 seconds, Fetched: 1 row(s)
hive> show tables;
OK
Time taken: 0.09 seconds
hive> 您在 /var/spool/mail/root 中有新邮件
[root@node3 ~]#
第二代客户端
node3
/export/server/apache-hive-3.1.2-bin/bin/beeline
! connect jdbc:hive2://node1:10000
root
(然后直接回车)
[root@node3 ~]# /export/server/apache-hive-3.1.2-bin/bin/beeline
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 3.1.2 by Apache Hive
beeline> ! connect jdbc:hive2://node1:10000
Connecting to jdbc:hive2://node1:10000
Enter username for jdbc:hive2://node1:10000: root
Enter password for jdbc:hive2://node1:10000:
Connected to: Apache Hive (version 3.1.2)
Driver: Hive JDBC (version 3.1.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://node1:10000> show databases;
INFO : Compiling command(queryId=root_20230223144903_ef22457c-2764-4ead-9755-f84aaa2505f2): show databases
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Semantic Analysis Completed (retrial = false)
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=root_20230223144903_ef22457c-2764-4ead-9755-f84aaa2505f2); Time taken: 1.407 seconds
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Executing command(queryId=root_20230223144903_ef22457c-2764-4ead-9755-f84aaa2505f2): show databases
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=root_20230223144903_ef22457c-2764-4ead-9755-f84aaa2505f2); Time taken: 0.07 seconds
INFO : OK
INFO : Concurrency mode is disabled, not creating a lock manager
+----------------+
| database_name |
+----------------+
| default |
+----------------+
1 row selected (2.172 seconds)
0: jdbc:hive2://node1:10000> show tables;
INFO : Compiling command(queryId=root_20230223144915_bf4a1a40-2124-46b6-acfd-b036b91149b9): show tables
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Semantic Analysis Completed (retrial = false)
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=root_20230223144915_bf4a1a40-2124-46b6-acfd-b036b91149b9); Time taken: 0.039 seconds
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Executing command(queryId=root_20230223144915_bf4a1a40-2124-46b6-acfd-b036b91149b9): show tables
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=root_20230223144915_bf4a1a40-2124-46b6-acfd-b036b91149b9); Time taken: 0.025 seconds
INFO : OK
INFO : Concurrency mode is disabled, not creating a lock manager
+-----------+
| tab_name |
+-----------+
+-----------+
No rows selected (0.119 seconds)
0: jdbc:hive2://node1:10000> Closing: 0: jdbc:hive2://node1:10000
您在 /var/spool/mail/root 中有新邮件
[root@node3 ~]#
P063【13-Apache hive--DataGrip连接Hiveserver2】
DataGrip 2020.2.2 x64
04【Hive SQL语言:DDL建库、建表】
P064【14-Apache hive--数据库与建库、切换库操作】
Hive数据模型总览
选择正确的方向比盲目努力更重要。
P065【15-Apache hive--表与建表sql语句--数据类型、分隔符指定语法】
--创建数据库并切换使用
create database if not exists itheima;
use itheima;--1、创建一张表,将射手结构化数据文件在Hive中映射成功
-- 表名
-- 字段 名称 类型 顺序
-- 字段之间的分隔符需要指定--ddl create table
create table itheima.t_archer(id int comment "ID编号",name string comment "英雄名称",hp_max int comment "最大生命",mp_max int comment "最大法力",attack_max int comment "最高物攻",defense_max int comment "最大物防",attack_range string comment "攻击范围",role_main string comment "主要定位",role_assist string comment "次要定位"
) comment "王者荣耀射手信息"
row format delimited
fields terminated by "\t"; -- 字段之间的分隔符是tab键 制表符select * from t_archer;
连接成功
Last login: Thu Feb 23 21:01:31 2023 from 192.168.88.1
[root@node3 ~]# /export/server/apache-hive-3.1.2-bin/bin/beeline
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 3.1.2 by Apache Hive
beeline> ! connect jdbc:hive2://node1:10000
Connecting to jdbc:hive2://node1:10000
Enter username for jdbc:hive2://node1:10000: root
Enter password for jdbc:hive2://node1:10000:
23/02/23 21:15:26 [main]: WARN jdbc.HiveConnection: Failed to connect to node1:10000
Could not open connection to the HS2 server. Please check the server URI and if the URI is correct, then ask the administrator to check the server status.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://node1:10000: java.net.ConnectException: 拒绝连接 (Connection refused) (state=08S01,code=0)
beeline> 您在 /var/spool/mail/root 中有新邮件
[root@node3 ~]# /export/server/apache-hive-3.1.2-bin/bin/beeline
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 3.1.2 by Apache Hive
beeline> ! connect jdbc:hive2://node1:10000
Connecting to jdbc:hive2://node1:10000
Enter username for jdbc:hive2://node1:10000: root
Enter password for jdbc:hive2://node1:10000:
Connected to: Apache Hive (version 3.1.2)
Driver: Hive JDBC (version 3.1.2)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://node1:10000> show databases;
INFO : Compiling command(queryId=root_20230223211656_6489cb28-8689-4b0f-8ee6-6503535f4cbd): show databases
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Semantic Analysis Completed (retrial = false)
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=root_20230223211656_6489cb28-8689-4b0f-8ee6-6503535f4cbd); Time taken: 1.802 seconds
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Executing command(queryId=root_20230223211656_6489cb28-8689-4b0f-8ee6-6503535f4cbd): show databases
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=root_20230223211656_6489cb28-8689-4b0f-8ee6-6503535f4cbd); Time taken: 0.085 seconds
INFO : OK
INFO : Concurrency mode is disabled, not creating a lock manager
+----------------+
| database_name |
+----------------+
| default |
| itheima |
+----------------+
2 rows selected (2.589 seconds)
0: jdbc:hive2://node1:10000> use itheima;
INFO : Compiling command(queryId=root_20230223211710_5f6217f0-2d03-431b-8dee-23cb6965e677): use itheima
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Semantic Analysis Completed (retrial = false)
INFO : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO : Completed compiling command(queryId=root_20230223211710_5f6217f0-2d03-431b-8dee-23cb6965e677); Time taken: 0.045 seconds
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Executing command(queryId=root_20230223211710_5f6217f0-2d03-431b-8dee-23cb6965e677): use itheima
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=root_20230223211710_5f6217f0-2d03-431b-8dee-23cb6965e677); Time taken: 0.015 seconds
INFO : OK
INFO : Concurrency mode is disabled, not creating a lock manager
No rows affected (0.157 seconds)
0: jdbc:hive2://node1:10000> show tables;
INFO : Compiling command(queryId=root_20230223211726_dd7ca710-179b-47e7-9cf8-a8396d2edf1b): show tables
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Semantic Analysis Completed (retrial = false)
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:tab_name, type:string, comment:from deserializer)], properties:null)
INFO : Completed compiling command(queryId=root_20230223211726_dd7ca710-179b-47e7-9cf8-a8396d2edf1b); Time taken: 0.036 seconds
INFO : Concurrency mode is disabled, not creating a lock manager
INFO : Executing command(queryId=root_20230223211726_dd7ca710-179b-47e7-9cf8-a8396d2edf1b): show tables
INFO : Starting task [Stage-0:DDL] in serial mode
INFO : Completed executing command(queryId=root_20230223211726_dd7ca710-179b-47e7-9cf8-a8396d2edf1b); Time taken: 0.035 seconds
INFO : OK
INFO : Concurrency mode is disabled, not creating a lock manager
+-----------+
| tab_name |
+-----------+
| t_archer |
+-----------+
1 row selected (0.122 seconds)
0: jdbc:hive2://node1:10000>
--注意:下面sql语句是需要在MySQL中执行,修改Hive存储的元数据信息(metadata)。
use hive3;
show tables;alter table hive3.COLUMNS_V2 modify column COMMENT varchar(256) character set utf8;
alter table hive3.TABLE_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8;
alter table hive3.PARTITION_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8 ;
alter table hive3.PARTITION_KEYS modify column PKEY_COMMENT varchar(4000) character set utf8;
alter table hive3.INDEX_PARAMS modify column PARAM_VALUE varchar(4000) character set utf8;
--创建数据库并切换使用
create database if not exists itheima;
use itheima;--1、创建一张表,将射手结构化数据文件在Hive中映射成功
-- 表名
-- 字段 名称 类型 顺序
-- 字段之间的分隔符需要指定--ddl create table
create table itheima.t_archer(id int comment "ID编号",name string comment "英雄名称",hp_max int comment "最大生命",mp_max int comment "最大法力",attack_max int comment "最高物攻",defense_max int comment "最大物防",attack_range string comment "攻击范围",role_main string comment "主要定位",role_assist string comment "次要定位"
) comment "王者荣耀射手信息"
row format delimited
fields terminated by "\t"; -- 字段之间的分隔符是tab键 制表符select * from t_archer;--查看表结构
desc formatted t_archer;--删除表sql
drop table t_archer;create table itheima.t_archer1(id int comment "ID编号",name string comment "英雄名称",hp_max int comment "最大生命",mp_max int comment "最大法力",attack_max int comment "最高物攻",defense_max int comment "最大物防",attack_range string comment "攻击范围",role_main string comment "主要定位",role_assist string comment "次要定位"
);--使用默认分隔符建表 \001 非打印字符
create table t_team_ace_player(id int,team_name string,ace_player_name string
);
-- row format delimited
-- fields terminated by "\001";select * from t_team_ace_player;--使用默认分隔符建表 \001 非打印字符
create table t_team_ace_player2(id int,team_name string,ace_player_name string
)
row format delimited
fields terminated by "\t";select * from t_team_ace_player2;
如果觉得我的分享有一定帮助,欢迎关注我的微信公众号 “码农的科研笔记”,了解更多我的算法和代码学习总结记录。或者点击链接扫码关注【2023/图对比/增强】MA-GCL: Model Augmentation Tricks for Graph Contrastive Learning
【2023/图对比/增强】MA-…...
文章目录1.mqtt协议1: 简介和报文格式1.1.MQTT概念1.2.数据2.控制报文格式2.1.MQTT数据包结构2.2.固定头2.2.1.控制报文类型2.2.2.标志FLag2.2.3.剩余长度2.3.可变头2.4.有效载荷Payload消息体安全QoS(Quality of Service levels)ref:1.mqtt协议1: 简介和报文格式
Message Que…...