安装hana

来源:互联网 发布:java游戏开发主程 编辑:程序博客网 时间:2024/06/05 10:11

一.hana下载

hana的免费版本只有express版本,下载地址为http://help.sap.com/disclaimer?site=http://sap.com/sap-hana-express
我下载的是最新的2.0版本,首先下载express edition download manager,然后通过manager下载binary installer

二.hana安装需求

1.升级gcc版本

一般的操作系统自带的gcc的版本都是不够的.需要升级gcc版本,否则安装的时候会遇到报错:
  1. Output line 2: /usr/sap/HXE/HDB90/exe/hdbnsutil: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/sap/HXE/HDB90/exe/libhdbrskernel.so)
  2. Output line 3: /usr/sap/HXE/HDB90/exe/hdbnsutil: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /usr/sap/HXE/HDB90/exe/libhdbrskernel.so)
  3. Output line 4: /usr/sap/HXE/HDB90/exe/hdbnsutil: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by /usr/sap/HXE/HDB90/exe/libhdbrskernel.so)
  4. Output line 5: /usr/sap/HXE/HDB90/exe/hdbnsutil: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/sap/HXE/HDB90/exe/libhdbbasement.so)
  5. Output line 6: /usr/sap/HXE/HDB90/exe/hdbnsutil: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /usr/sap/HXE/HDB90/exe/libhdbbasement.so)
  6. Output line 7: /usr/sap/HXE/HDB90/exe/hdbnsutil: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/sap/HXE/HDB90/exe/libhdbun
报错的意思是/usr/lib64/libstdc++.so.6这个库文件版本过低,没有相应的GLIBCXX_3.4.XX模块.
升级gcc步骤如下:
源码下载gcc地址:
http://gcc.skazkaforyou.com/releases
需要联网才能执行download_prerequisites,这一步解决依赖性的问题
  1. tar zxvf gcc-6.3.0.tar.gz
  2. cd gcc-6.3.0
  3. ./contrib/download_prerequisites
  4. mkdir gcc-build-4.8.2
  5. cd gcc-build-4.8.2/
  6. ../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
  7. make
  8. make install
升级gcc的时间可能很长.
升级完成之后还需要修改libstdc++的文件位置:
  1. [root@hana1 lib64]# cd /usr/lib64
  2. [root@hana1 lib64]# ls -l libstdc++.so.6
  3. lrwxrwxrwx. 1 root root 19 Apr 18 21:48 libstdc++.so.6 -> libstdc++.so.6.0.13
  4. [root@hana1 lib64]# rm -rf libstdc++.so.6
  5. [root@hana1 lib64]# ln -sv /usr/local/lib64/libstdc++.so.6 libstdc++.so.6
  6. `libstdc++.so.6' -> `/usr/local/lib64/libstdc++.so.6'
  7. [root@hana1 lib64]# ls -l libstdc++.so.6
  8. lrwxrwxrwx. 1 root root 31 Apr 19 01:01 libstdc++.so.6 -> /usr/local/lib64/libstdc++.so.6
可以使用如下命令查看libstdc++中的模块:
  1. strings libstdc++.so.6|grep CXX

2.空间需求

hana默认安装在/hana下,保证/hana空间大于15G
保证swap空间不小于8G

三.安装hana

上传下载的binary包,然后进行解压缩.hxe.tgz只包含hdb组建.hxexsa.tgz包含hdb和其它的例如xs组件
执行安装如下
  1. [root@hana1 data]# ./setup_hxe.sh
  2. Enter HANA, express edition installer root directory:
  3. Hint: <extracted_path>/HANA_EXPRESS_20
  4. HANA, express edition installer root directory [/data/HANA_EXPRESS_20]:
  5. Enter local host name [hana1]:
  6. Enter SAP HANA system ID [HXE]: #这里输入sid
  7. Enter HANA instance number [90]: #instance number
  8. Enter HDB master password: #这个密码是操作系统用户[sid]adm的密码,也是HDB中SYSTEM的密码
  9. Confirm "HDB master" password:
  10. ##############################################################################
  11. # Summary before execution #
  12. ##############################################################################
  13. HANA, express edition installer : /data/HANA_EXPRESS_20
  14. Component(s) to install : HANA server + Application Function Library
  15. Host name : hana1
  16. HANA system ID : HXE
  17. HANA instance number : 90
  18. Master password : ********
  19. Proceed with installation? (Y/N) : y
  20. Installing HDB server...
  21. SAP HANA Lifecycle Management - SAP HANA Express Edition 2.00.001.00.1486472000
  22. *******************************************************************************
  23. Start reading from input channel...
  24. ... Done.
  25. Summary before execution:
  26. =========================
  27. SAP HANA Express Edition System Installation
  28. Installation Parameters
  29. Remote Execution: ssh
  30. Installation Path: /hana/shared
  31. Local Host Name: hana1
  32. SAP HANA System ID: HXE
  33. Instance Number: 90
  34. Local Host Worker Group: default
  35. Database Mode: multiple_containers
  36. Database Isolation: low
  37. System Usage: development
  38. Location of Data Volumes: /hana/shared/data/HXE #这里是hana的数据目录
  39. Location of Log Volumes: /hana/shared/log/HXE #这里是hana的日志目录
  40. Directory containing custom configurations: /data/HANA_EXPRESS_20/DATA_UNITS/HDB_SERVER_LINUX_X86_64/configurations/custom
  41. Certificate Host Names: hana1 -> hana1
  42. System Administrator Home Directory: /usr/sap/HXE/home #这个是hxeadm的家目录
  43. System Administrator Login Shell: /bin/bash
  44. System Administrator User ID: 1000
  45. ID of User Group (sapsys): 79
  46. Software Components
  47. SAP HANA Database
  48. Install version 2.00.001.00.1486472000
  49. Location: /data/HANA_EXPRESS_20/DATA_UNITS/HDB_SERVER_LINUX_X86_64/server
  50. SAP HANA AFL (incl.PAL,BFL,OFL,HIE)
  51. Install version 2.00.001.0000.1486494027
  52. Location: /data/HANA_EXPRESS_20/DATA_UNITS/HDB_AFL_LINUX_X86_64/packages
  53. Installing components...
  54. Installing SAP HANA Database...
  55. Resuming broken installation at step 'Creating System'.
  56. Preparing package 'Saphostagent Setup'...
  57. Preparing package 'Python Support'...
  58. Preparing package 'Python Runtime'...
  59. Preparing package 'Product Manifest'...
  60. Preparing package 'Binaries'...
  61. Preparing package 'Krb5 Runtime'...
  62. Preparing package 'Installer'...
  63. Preparing package 'Ini Files'...
  64. Preparing package 'Documentation'...
  65. Preparing package 'Delivery Units'...
  66. Preparing package 'Offline Cockpit'...
  67. Preparing package 'DAT Languages (EN, DE)'...
  68. Preparing package 'DAT Configfiles (EN, DE)'...
  69. Creating System...
  70. Creating instance...
  71. Starting SAP HANA Database system...
  72. Starting 5 processes on host 'hana1' (worker):
  73. Starting on 'hana1': hdbcompileserver, hdbdaemon, hdbnameserver, hdbpreprocessor, hdbwebdispatcher
  74. Starting 6 processes on host 'hana1' (worker):
  75. Starting on 'hana1': hdbcompileserver, hdbdaemon, hdbindexserver, hdbnameserver, hdbpreprocessor, hdbwebdispatcher
  76. Starting on 'hana1': hdbcompileserver, hdbdaemon, hdbindexserver, hdbpreprocessor, hdbwebdispatcher
  77. Starting on 'hana1': hdbdaemon, hdbindexserver, hdbwebdispatcher
  78. Starting on 'hana1': hdbdaemon, hdbwebdispatcher
  79. All server processes started on host 'hana1' (worker).
  80. Installing Resident hdblcm...
  81. Installing SAP HANA AFL (incl.PAL,BFL,OFL,HIE)...
  82. Preparing package 'AFL'...
  83. Installing SAP Application Function Libraries to /hana/shared/HXE/exe/linuxx86_64/plugins/afl_2.00.001.0000.1486494027_cbc2870b9f71dbd787522090ef82c6f5b7b8095a...
  84. Installing package 'AFL'...
  85. Stopping system...
  86. Stopping 6 processes on host 'hana1' (worker):
  87. Stopping on 'hana1': hdbcompileserver, hdbdaemon, hdbindexserver, hdbnameserver, hdbpreprocessor, hdbwebdispatcher
  88. All server processes stopped on host 'hana1' (worker).
  89. Activating plugin...
  90. Starting system...
  91. Starting 6 processes on host 'hana1' (worker):
  92. Starting on 'hana1': hdbcompileserver, hdbdaemon, hdbindexserver, hdbnameserver, hdbpreprocessor, hdbwebdispatcher
  93. Starting on 'hana1': hdbcompileserver, hdbdaemon, hdbindexserver, hdbpreprocessor, hdbwebdispatcher
  94. Starting on 'hana1': hdbdaemon, hdbindexserver, hdbpreprocessor, hdbwebdispatcher
  95. Starting on 'hana1': hdbdaemon, hdbindexserver, hdbwebdispatcher
  96. Starting on 'hana1': hdbdaemon, hdbwebdispatcher
  97. All server processes started on host 'hana1' (worker).
  98. Updating SAP HANA Express Edition Instance Integration on Local Host...
  99. Deploying SAP Host Agent configurations...
  100. Creating Component List...
  101. SAP HANA Express Edition System installed
  102. You can send feedback to SAP with this form: https://hana1:1129/lmsl/HDBLCM/HXE/feedback/feedback.html
  103. Log file written to '/var/tmp/hdb_HXE_hdblcm_install_2017-04-19_01.02.23/hdblcm.log' on host 'hana1'.
  104. Enable AFL...
  105. 0 rows affected (overall time 70.014 msec; server time 36.961 msec)
  106. Start "HXE" tenant database...
  107. Unset 'unload_upper_bound' configuration...
  108. Unset 'plan_cache_statistics_enabled' configuration...
  109. Turning off statistics server...
  110. Reclaiming log space...
  111. Reclaiming disk space...
  112. Restarting HDB...
  113. Impromptu CCC initialization by 'rscpCInit'.
  114. See SAP note 1266393.
  115. Do garbage collection...
  116. Collect garbage on "hdbnameserver"...
  117. Collect garbage on "hdbindexserver"...
  118. Collect garbage on "hdbcompileserver"...
  119. Collect garbage on "hdbpreprocessor"...
  120. Reclaim data volume...
  121. Release free log segments...
  122. Stop "HXE" tenant database...
  123. HDB is successfully optimized.
安装完成后,系统会自动添加一个用户,用户名为hxeadm,其中xx为上面配置的instance number.

四.hana的启停与连接

hana的启动,在hxeadm下:
  1. hxeadm@hana1:/usr/sap/HXE/HDB90> HDB start
  2. StartService
  3. Impromptu CCC initialization by 'rscpCInit'.
  4. See SAP note 1266393.
  5. OK
  6. OK
  7. Starting instance using: /usr/sap/HXE/SYS/exe/hdb/sapcontrol -prot NI_HTTP -nr 90 -function StartWait 2700 2
  8. 03.05.2017 11:35:02
  9. Start
  10. OK
  11. 03.05.2017 11:36:45
  12. StartWait
  13. OK
停止为:
  1. HDB stop

查看HDB 状态:
  1. hxeadm@hana1:/usr/sap/HXE/HDB90> HDB info
  2. USER PID PPID %CPU VSZ RSS COMMAND
  3. hxeadm 3279 3278 0.6 108488 1948 -bash
  4. hxeadm 2879 2878 0.0 108488 1944 -bash
  5. hxeadm 3574 2879 0.0 106252 1436 \_ /bin/sh /usr/sap/HXE/HDB90/HDB info
  6. hxeadm 3605 3574 1.0 110228 1036 \_ ps fx -U hxeadm -o user,pid,ppid,pcpu,vsz,rss,args
  7. hxeadm 3141 1 0.0 22876 1640 sapstart pf=/usr/sap/HXE/SYS/profile/HXE_HDB90_hana1
  8. hxeadm 3153 3141 1.3 250888 36828 \_ /usr/sap/HXE/HDB90/hana1/trace/hdb.sapHXE_HDB90 -d -nw -f /usr/sap/HXE/HDB90/hana1/daemon.ini pf=/usr/sap/HXE/SYS/p
  9. hxeadm 3169 3153 46.5 3164704 1306100 \_ hdbnameserver
  10. hxeadm 3407 3153 20.1 1238412 266900 \_ hdbcompileserver
  11. hxeadm 3409 3153 19.7 1442532 307360 \_ hdbpreprocessor
  12. hxeadm 3456 3153 42.4 1287672 477740 \_ hdbwebdispatcher
  13. hxeadm 3074 1 0.9 498116 26884 /usr/sap/HXE/HDB90/exe/sapstartsrv pf=/usr/sap/HXE/SYS/profile/HXE_HDB90_hana1 -D -u hxeadm
主要有hdbcompileserver, hdbdaemon, hdbindexserver, hdbnameserver, hdbpreprocessor, hdbwebdispatcher等进程.
连接hana,使用hdbsql来连接,类似于oracle中的sqlplus:
  1. hxeadm@hana1:/usr/sap/HXE/HDB90> hdbsql -n 127.0.0.1:39013 -u SYSTEM -p Password123
  2. Welcome to the SAP HANA Database interactive terminal.
  3. Type: \h for help with commands
  4. \q to quit
  5. hdbsql SYSTEMDB=> \q

其中需要注意的是hdb的端口号:

Note
The HANA JDBC port number for SAP HANA, express edition is different than the default port number 
30015 mentioned in the SHINE guide. You need to update the port parameter for the resources 
CrossSchemaSysand CrossSchemaSysBiin the mtaext file to 3<instance-number>13

express版本的的默认端口好为3[instance-nunber]13,而如果你安装的正式版,默认端口号为3[instance-number]15

五.安装hana client

hana client包含了hana的一些库文件,例如python的驱动,odbc,jdbc驱动等.安装也很简单.上传hdb clinet安装包:
  1. cd HDB_CLIENT_LINUX_X86_64
  2. ./hdbinst
安装产生的文件在/usr/sap/hdbclient/中
  1. [root@hana1 config]# cd /usr/sap/hdbclient/
  2. [root@hana1 hdbclient]# ls
  3. hdbalm hdbcli hdbodbc_cons hdbsqldbc_cons install libodbcHDB.a libSQLDBCHDB.so ngdbc.jar pyhdbcli.so regi rtt.sh sdk
  4. hdbalm.py hdbclient.lst hdbsql hdbuserstore libdbcapiHDB.so libodbcHDB.so manifest odbcreg Python rtt SAPCAR






















0 0
原创粉丝点击