找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
SAP亦橙网 首页 SAP技术 查看内容

SAP S4 HANA 安装部署记事六: S4HANA安装文件传到主机

2023-12-26 21:25| 发布者: 亦书| 查看: 93| 评论: 0

摘要: SAP S4 HANA 安装部署记事六:S4HANA安装文件传到主机前面的安装文件已经从sap网站上下载下来了,但是我们使用的是AWS云主机,需要将这些文件传到云端去。如果是自己购买硬件服务器的,可以不用管这个。传上去的方法 ...
 

SAP S4 HANA 安装部署记事六:S4HANA安装文件传到主机

前面的安装文件已经从sap网站上下载下来了,但是我们使用的是AWS云主机,需要将这些文件传到云端去。如果是自己购买硬件服务器的,可以不用管这个。
传上去的方法有很多,我选择的方式是采用了AWS的S3存储桶。

1.创建S3存储桶
我们可以通过FTP将sap的安装文件创导云服务器上的磁盘上。但如果是很多服务器要安装,则可以将安装文件传到S3存储桶中,方便共用。
2.1登录https://console.aws.amazon.com/s3控制台
2.2创建名字为 mymedia的存储桶,并在此存储桶里建立两个文件夹SAP_HANA 和 SAP_S4
2.3将下载后解压的文件夹传到HANA和S4上传到这两个文件夹中(最好用chromie浏览器)
然后你的主机访问这个路径就是 s3://mymedia/SAP HANA/
2.3IAM建一个专门的用户来访问此存储桶,我们在用户中见创建个用户交Clouduser,并在存储桶中设置好权限。并为该IAM用户创建访问密钥,同时设置这个用户 AmazonS3FullAccess权限

3.挂载S3存储同道云主机EC2上
创建好的存储桶要挂到EC2上还是挺麻烦的,可以参考如下这篇文章:https://aws.amazon.com/cn/blogs/china/s3fs-amazon-ec2-linux/
3.1使用ec2-user和ppk私钥登录EC2主机(使用putty工具),如果是win10也可以用ssh连接
ssh -i /path/my-key-pair.pem ec2-user@ec2-198-51-100-1.compute-1.amazonaws.com

3.2云主机上安装必要软件包(SUSE) 安装s3cmd
连接S3存储的方法有很多种,AWS推荐CLI,我开始最想用的是s3fs,可以直接挂载。
?命令格式:s3fs [S3存储桶名] [本地目录名] -o passwd_file=[密钥文件名] -o endpoint=[区域名]
命令举例:下面的例子将名为“s3fs-mount-bucket”的新加坡区域S3存储桶挂载到指定的本地目录“/home/ec2-user/s3mnt”。
s3fs s3fs-mount-bucket /home/ec2-user/s3mnt -o passwd_file=/home/ec2-user/.passwd-s3fs -o endpoint=ap-northeast-1
但是最后在suse系统上折腾了S3fs很久,没有成功,退而求其次,就用了s3cmd。
--获取s3cmd安装包
sapdev:/ # wget http://ufpr.dl.sourceforge.net/project/s3tools/s3cmd/1.6.1/s3cmd-1.6.1.tar.gz
--2019-03-22 13:04:21--  http://ufpr.dl.sourceforge.net/project/s3tools/s3cmd/1.6.1/s3cmd-1.6.1.tar.gz
Resolving ufpr.dl.sourceforge.net (ufpr.dl.sourceforge.net)... 200.236.31.2
Connecting to ufpr.dl.sourceforge.net (ufpr.dl.sourceforge.net)|200.236.31.2|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 102431 (100K) [application/x-gzip]
Saving to: ‘s3cmd-1.6.1.tar.gz’

100%[====================================================================================================================================>] 102,431      131KB/s   in 0.8s

2019-03-22 13:04:26 (131 KB/s) - ‘s3cmd-1.6.1.tar.gz’ saved [102431/102431]
--解压缩
sapdev:/ # tar xzf s3cmd-1.6.1.tar.gz
--安装
sapdev:/ # ls
bin   config.bootoptions  dev  home        lib    mnt  proc  run          s3cmd-1.6.1.tar.gz  selinux  sys  usr
boot  config.partids      etc  kiwi-hooks  lib64  opt  root  s3cmd-1.6.1  sbin                srv      tmp  var
sapdev:/ # cd s3cmd-1.6.1
sapdev:/s3cmd-1.6.1 # ls
INSTALL  MANIFEST.in  NEWS  PKG-INFO  README.md  S3  s3cmd  s3cmd.1  s3cmd.egg-info  setup.cfg  setup.py
sapdev:/s3cmd-1.6.1 # sudo python setup.py install
Using xml.etree.ElementTree for XML processing
running install
running bdist_egg
running egg_info
writing requirements to s3cmd.egg-info/requires.txt
writing s3cmd.egg-info/PKG-INFO
writing top-level names to s3cmd.egg-info/top_level.txt
writing dependency_links to s3cmd.egg-info/dependency_links.txt
reading manifest file 's3cmd.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 's3cmd.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib
creating build/lib/S3
copying S3/Crypto.py -> build/lib/S3
copying S3/FileLists.py -> build/lib/S3
copying S3/__init__.py -> build/lib/S3
copying S3/S3.py -> build/lib/S3
copying S3/BidirMap.py -> build/lib/S3
copying S3/Exceptions.py -> build/lib/S3
copying S3/FileDict.py -> build/lib/S3
copying S3/Config.py -> build/lib/S3
copying S3/PkgInfo.py -> build/lib/S3
copying S3/MultiPart.py -> build/lib/S3
copying S3/HashCache.py -> build/lib/S3
copying S3/Utils.py -> build/lib/S3
copying S3/ExitCodes.py -> build/lib/S3
copying S3/Progress.py -> build/lib/S3
copying S3/CloudFront.py -> build/lib/S3
copying S3/AccessLog.py -> build/lib/S3
copying S3/ConnMan.py -> build/lib/S3
copying S3/ACL.py -> build/lib/S3
copying S3/S3Uri.py -> build/lib/S3
copying S3/SortedDict.py -> build/lib/S3
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/Crypto.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/FileLists.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/__init__.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/S3.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/BidirMap.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/Exceptions.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/FileDict.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/Config.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/PkgInfo.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/MultiPart.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/HashCache.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/Utils.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/ExitCodes.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/Progress.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/CloudFront.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/AccessLog.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/ConnMan.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/ACL.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/S3Uri.py -> build/bdist.linux-x86_64/egg/S3
copying build/lib/S3/SortedDict.py -> build/bdist.linux-x86_64/egg/S3
byte-compiling build/bdist.linux-x86_64/egg/S3/Crypto.py to Crypto.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/FileLists.py to FileLists.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/S3.py to S3.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/BidirMap.py to BidirMap.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/Exceptions.py to Exceptions.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/FileDict.py to FileDict.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/Config.py to Config.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/PkgInfo.py to PkgInfo.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/MultiPart.py to MultiPart.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/HashCache.py to HashCache.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/Utils.py to Utils.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/ExitCodes.py to ExitCodes.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/Progress.py to Progress.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/CloudFront.py to CloudFront.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/AccessLog.py to AccessLog.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/ConnMan.py to ConnMan.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/ACL.py to ACL.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/S3Uri.py to S3Uri.pyc
byte-compiling build/bdist.linux-x86_64/egg/S3/SortedDict.py to SortedDict.pyc
installing package data to build/bdist.linux-x86_64/egg
running install_data
creating build/bdist.linux-x86_64/egg/share
creating build/bdist.linux-x86_64/egg/share/doc
creating build/bdist.linux-x86_64/egg/share/doc/packages
creating build/bdist.linux-x86_64/egg/share/doc/packages/s3cmd
copying README.md -> build/bdist.linux-x86_64/egg/share/doc/packages/s3cmd
copying INSTALL -> build/bdist.linux-x86_64/egg/share/doc/packages/s3cmd
copying NEWS -> build/bdist.linux-x86_64/egg/share/doc/packages/s3cmd
creating build/bdist.linux-x86_64/egg/share/man
creating build/bdist.linux-x86_64/egg/share/man/man1
copying s3cmd.1 -> build/bdist.linux-x86_64/egg/share/man/man1
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/scripts-2.7
copying and adjusting s3cmd -> build/scripts-2.7
changing mode of build/scripts-2.7/s3cmd from 644 to 755
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/s3cmd -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/s3cmd to 755
copying s3cmd.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying s3cmd.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying s3cmd.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying s3cmd.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying s3cmd.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/s3cmd-1.6.1-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing s3cmd-1.6.1-py2.7.egg
Copying s3cmd-1.6.1-py2.7.egg to /usr/lib/python2.7/site-packages
Adding s3cmd 1.6.1 to easy-install.pth file
Installing s3cmd script to /usr/bin

Installed /usr/lib/python2.7/site-packages/s3cmd-1.6.1-py2.7.egg
Processing dependencies for s3cmd==1.6.1
Searching for python-magic
Reading https://pypi.python.org/simple/python-magic/
Best match: python-magic 0.4.15
Downloading https://files.pythonhosted.org/packages/84/30/80932401906eaf787f2e9bd86dc458f1d2e75b064b4c187341f29516945c/python-magic-0.4.15.tar.gz#sha256=f3765c0f582d2dfc72c15f3b5a82aecfae9498bd29ca840d72f37d7bd38bfcd5
Processing python-magic-0.4.15.tar.gz
Writing /tmp/easy_install-2L5bcU/python-magic-0.4.15/setup.cfg
Running python-magic-0.4.15/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2L5bcU/python-magic-0.4.15/egg-dist-tmp-1AIRry
zip_safe flag not set; analyzing archive contents...
Moving python_magic-0.4.15-py2.7.egg to /usr/lib/python2.7/site-packages
Adding python-magic 0.4.15 to easy-install.pth file

Installed /usr/lib/python2.7/site-packages/python_magic-0.4.15-py2.7.egg
Searching for python-dateutil==2.6.1
Best match: python-dateutil 2.6.1
Adding python-dateutil 2.6.1 to easy-install.pth file

Using /usr/lib/python2.7/site-packages
Searching for six==1.11.0
Best match: six 1.11.0
Adding six 1.11.0 to easy-install.pth file

Using /usr/lib/python2.7/site-packages
Finished processing dependencies for s3cmd==1.6.1
sapdev:/s3cmd-1.6.1 #

3.3配置s3cmd的连接
sapdev:/s3cmd-1.6.1 # s3cmd --configure

Enter new values or accept defaults in brackets with Enter.
Refer to user manual for detailed description of all options.

Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.
Access Key: 3MNYQ
Secret Key: g7fXf8gVmZx
Default Region [US]:

Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
Encryption password:
Path to GPG program [/usr/bin/gpg]:

When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
slower than plain HTTP, and can only be proxied with Python 2.7 or newer
Use HTTPS protocol [Yes]:

On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can't connect to S3 directly
HTTP Proxy server name:

New settings:
  Access Key: AKIAJDXC
  Secret Key: g7fXf8gVmZx
  Default Region: US
  Encryption password: 
  Path to GPG program: /usr/bin/gpg
  Use HTTPS protocol: True
  HTTP Proxy server name:
  HTTP Proxy server port: 0

Test access with supplied credentials? [Y/n] y
Please wait, attempting to list all buckets...
Success. Your access key and secret key worked fine :-)

Now verifying that encryption works...
Success. Encryption and decryption worked fine :-)

Save settings? [y/N] y
Configuration saved to '/root/.s3cfg'
到这里主机连接S3的配置就完成了,如果还有主机要联这个S3存储桶,同样的流程做一遍就可以了。

4.管理s3存储桶

--查看s3存储桶
sapdev:/s3cmd-1.6.1 # s3cmd ls
2019-03-21 01:16  s3://newbucket

--创建
3scmd mb s3://newbucket

--传文件
s3cmd put file.txt s3://newbucket

--传目录
s3cmd put -r backup s3://newbucket

--下载
s3cmd get s3://newbucket/file.txt

--同步
s3cmd sync s3://newbucket/ /HANA/

--删除文件
s3cmd del s3://newbucket/file.txt

--删除存储桶
s3cmd rb s3://newbucket

我最喜欢的使用:s3cmd sync s3://newbucket/ /softwaremedia/,将S3的安装包同步到云端主机的一个盘中,然后这个安装盘可以随意挂到其他主机上。

 

特别声明:文章或部分素材来源于网络,仅供SAPERP从业伙伴们交流学习使用,如果侵犯了您的权益,请联系网站管理人员删减!



路过

雷人

握手

鲜花

鸡蛋
返回顶部