进入spark配置目录,找到hive-site.xml, 按实际情况加入下面配置

    1. <property>
    2. <name>javax.jdo.option.ConnectionDriverName</name>
    3. <value>com.mysql.jdbc.Driver</value>
    4. </property>
    5. <property>
    6. <name>hive.server2.authentication</name>
    7. <value>NONE</value>
    8. </property>
    9. <property>
    10. <name>hive.server2.thrift.client.user</name>
    11. <value>root</value>
    12. </property>
    13. <property>
    14. <name>hive.server2.thrift.client.password</name>
    15. <value>123456</value>
    16. </property>
    17. <property>
    18. <name>hive.server2.thrift.port</name>
    19. <value>10001</value>
    20. </property>
    21. <property>
    22. <name>hive.security.authorization.enabled</name>
    23. <value>true</value>
    24. <description>enableor disable the hive clientauthorization</description>
    25. </property>
    26. <property>
    27. <name>javax.jdo.option.ConnectionUserName</name>
    28. <value>hive</value>
    29. </property>
    30. <property>
    31. <name>javax.jdo.option.ConnectionPassword</name>
    32. <value>123456</value>
    33. </property>
    ./sbin/start-thriftserver.sh  --executor-memory 2g