Php connection hive Problems

Source: Internet
Author: User
I. hive has three modes: cli, hwi, and hiveserver; cli: shell command line hwi: Access hiveserver through a browser: that is, the JDBCODBC interface, where hwi is not used to learn hive: sishuok.comforumblogPostlist6220.html (hive is a beginner, and this series is very good)

I. hive has three modes: cli, hwi, and hiveserver; cli: shell command line hwi: Access hiveserver through a browser: that is JDBC/ODBC interface which hwi did not use deep learning hive: http://sishuok.com/forum/blogPost/list/6220.html (beginner hive, this series of introduction is very good)

I. hive

Hive has three modes: cli, hwi, and hiveserver;

Cli: shell Command Line

Hwi: access through a browser

Hiveserver: JDBC/ODBC interface

Hwi is not used

Deep Learning hive: http://sishuok.com/forum/blogPost/list/6220.html (beginner hive, this series of introduction is very good)

Start hiveserver:

1.org. apache. thrift. transport. TTransportException: cocould not create ServerSocket on address 0.0.0.0/0.0.0.0: 10000.

Possible cause: the default port 10000 is in use

Check whether the port is occupied: netstat-ntulp | grep ': 10000'

Detected to be occupied by a java Process

Solution: Enable hiveserver: hive -- service hiveserver-p 10001 on another port.

2. hiveserver startup is stuck.

Some blogs on the Internet explain that it is already running, don't worry about http://www.cnblogs.com/sh91/archive/2012/08/03/2621911.html

Start hive (cli)

1. An error occurred while executing the statement (for example, show tables)

FAILED: Error in metadata: java. lang. RuntimeException: Unable to instantiate org. apache. hadoop. hive. metastore. HiveMetaStoreClient
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exe c. DDLTask

Possible cause: metadata is related, that is, it is related to connecting to mysql (using mysql as the hive metabase)

Start hive cli in debug mode: hive-hiveconf hive. root. logger = DEBUG, console

Caused by: com. mysql. jdbc. exceptions. jdbc4.CommunicationsException: Communications link failure

Caused by: java.net. ConnectException: zookeeper failed (this is Caused by ssh software in windows)

Caused by: java. lang. RuntimeException: Unable to instantiate org. apache. hadoop. hive. metastore. HiveMetaStoreClient

Caused by: java. lang. reflect. InvocationTargetException

Caused by: javax. jdo. JDOFatalDataStoreException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not supported Ed any packets from the server.
NestedThrowables:
Com. mysql. jdbc. exceptions. jdbc4.CommunicationsException: Communications link failure


Ii. mysql

An error occurred while logging on to mysql: mysql-uhive-p

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql. sock' (111)

View the mysql running status:/etc/rc. d/init. d/mysqld status

Mysql stopped

Start mysql with root permission: service mysqld start (failed);, etc/init. d/mysqld start (also failed)

Tip: Another MySQL daemon already running with the same unix socket.

Close all mysqld processes: killall-9 mysqld

ConsiderationsUninstall original mysql: Http://www.jb51.net/ OS /RedHat/1146.html http://www.2cto.com/ OS /201108/100257.html http://blog.csdn.net/monkey_d_meng/article/details/5573610

Find mysql-related packages: rpm-qa | grep mysql
Mysql-server-5.1.71-1.el6.i686 becomes not installed (why ???)
Mysql-connector-java-5.1.17-6.el6.noarch OK!
Mysql-5.1.71-1.el6.i686 OK!
Libdbi-dbd-mysql-0.8.3-5.1.el6.i686 OK!
Mysql-libs-5.1.71-1.el6.i686 becomes not installed (why ???)
Mod_auth_mysql-3.0.0-11.el6_0.1.i686 OK!
Mysql-connector-odbc-5.1.5r1144-7.el6.i686 OK!
Php-mysql-5.3.3-26.el6.i686 OK!
Mysql-devel-5.1.71-1.el6.i686 OK!
Qt-mysql-4.6.2-26.el6_4.i686 OK!
Command for deleting related packages: rpm-e -- nodeps (package name)
Next, delete mysql: rm-fr/usr/lib/mysql rm-fr/usr/include/mysql (mysql is not found in the/usr/include directory)
Rm-f/etc/my. cnf rm-rf/var/lib/mysql
Verify: sudo yum-y remove mysql-5.1.71-1.el6.i686
Tip: Loaded plugins: refresh-packagekit, security
Setting up Remove Process
No Match for argument: mysql-5.1.71-1.el6.i686
Package (s) mysql-5.1.71-1.el6.i686 available, but not installed.
No Packages marked for removal
It indicates that the deletion is successful!

According to the official instructions (http://dev.mysql.com/doc/refman/5.6/en/linux-installation-rpm.html) to find the relevant directory, there is no mysql

Next,Manually install mysql:
Mysql official recommendation:

The recommended way to install MySQL on RPM-based Linux distributions that useglibcIs by using the RPM packages provided by MySQL. there are two methods for doing so: for EL6-based platforms and Fedora 18 and 19, this can be done using the MySQL Yum repository (seep 2.5.1, "Installing MySQL on Linux Using the MySQL Yum Repository" for details)

Therefore, use rpm for installation and follow the tutorials on the official website.

After successful installation, mysql can be started properly!

Create a user and database for hive again (note that it corresponds to the configuration file hive-site.xml)

3. php connection problems

Premise: Turn On hadoop (2.2.0 changed to start-dfs.sh and start-yarn.sh)

Enable hiveserver (mysql also needs to be enabled)

Put the PHP file under/wamp/www/

Enter/localhost/hiveconnect. php in the browser.

Problem:

Enter the url and wait for localhost. The hive log contains only session-related information.:

Solution:

TException TSocket tiomeout:

This problem was not solved at last, but it was found that most of hive is used for intranet applications, so it went directly to the Intranet and the connection was normal.

4. hadoop

Start hadoop: start-dfs.sh start-yarn.sh

Each process is started normally, but a problem occurs later. nodemanager shutdown:

Org. apache. hadoop. yarn. exceptions. yarnRuntimeException: org.apache.hadoop.net. connectTimeoutException: Call From sipedi-idc-gysj/220.250.64.225 to 0.0.0.0: 8031 failed on socket timeout exception: org.apache.hadoop.net. connectTimeoutException: 20000 millis timeout while waiting for channel to be ready for connect. ch: java. nio. channels. socketChannel [connection-pending remote = 0.0.0.0/0.0.0.0: 8031];

This problem also occurs on the internet server. It is the same as the connection problem with PHP. If it is changed to an intranet application, it will not happen again, however, it is estimated that this problem is related to the linux version of the server and the specific configuration of hadoop. The operating mechanism of the specific YARN will be studied after the winter vacation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.