SAP Hybris管理后台(Hybris hmc)安装步骤

三步安装SAP Hybris HMC

1)安装JDK,安装数据库(MySQL\Oracle\HSQL\SQLServer)并创建database;
2)设置ANT的bin路径(path),ant clean all,hybrisserver.bat启动hybris;
3)http://localhost:9001登录hybris后台进行初始化即可。
需要注意:
1)如果用MySQL,则版本不要低于5.6,否则会出现莫名其妙的错误;
2)JDK版本不能太老旧,我用1.8安装成功了;
3)命令行会一直提示MySQL要求SSL连接的警告信息,对于暂时没有加密连接需求的情况、忽略即可、不会影响正常使用;
4)安装后默认有30天的试用期限,到期后在后台重新初始化即可。
以下为详细步骤,摘自网络:
How to: Install hybris on AWS

Create An Environment

  • Create an EC2 instance in AWS. The recommended server requirements Quad Core, e.g. i7, 16 GB memory and 20 GB of hard disk space, SSD recommended.
  • Please make sure the ports 9001 & 9002 are configured in the AWS Security Group to get access to this instance.
  • Connect to the AWS instance by Putty
  • Get root access and install all server components required for hybris
    • sudo -s #to gain root access
    • yum install java
    • yum install mysqld
    • service mysqld start #to start the service
  • Create a new user and set a password for this user. I prefer to install hybris in its own environment.
    • useradd hybris <enter>
    • passwd hybris <enter>
  • Switch to the hybris user
    • su hybris

Install And Build Hybris

  • Download the hybris installation file (hybris-commerce-suite-5.x.x.x.zip, 2GB) to your desktop (https://wiki.hybris.com/display/downloads/Download)
  • Download and open WinSCP (or Filezilla) to create an SCP connection to transfer the installation file to the hybris home directory
  • In my situation I could only connect with the EC2-user and therefor transfer the file only to the home directory of the EC2-user. But that is not the place I want hybris to be installed. So I used the following command to move the file to the hybris home directory before unzipping.
    • mv /home/ec2-user/hybris-commerce-suite-5.4.0.0.zip /home/hybris/hybris-commerce-suite-5.4.0.0.zip
  • Unzip the file
    • unzip /home/hybris/hybris-commerce-suite-5.4.0.0.zip
  • Clean up the installation file
    • rm hybris-commerce-suite-5.4.0.0.zip
  • Build the build the hybris Commerce Suite
    • cd /home/hybris/hybris/bin/platform
    • . ./setantenv.sh #please add the dot at first followed by a space
    • #If the setantenv.sh command is run properly, there will be no specific output
    • ant clean all #This will start building hybris
  • Press the Enter key to use the default, the develop configuration template.
  • Wait for the build to complete. It may take several minutes:
    • BUILD SUCCESSFUL
    • Total time: 2 minutes 5 seconds
  • Start hybris
    • cd /home/hybris/hybris/bin/platform
    • . ./hybrisserver.sh #please add the dot at first followed by a space
  • (!) Do not close the command window because the hybris Server must continue running in this window while you work in the hybris Commerce Suite. You may minimize it.
  • Wait for the hybris Server start-up to complete:
    • Dec 12, 2014 3:39:08 PM org.apache.catalina.startup.Catalina start
    • INFO: Server startup in 163949 ms
  • The hybris Commerce Suite is now ready for use. Open the hybris Administration Console, the default URL for which is http://localhost:9001

Configure Hybris As A Service

To auto-start hybris on boot we need to configure hybris as a service.
  • Stop the hybris server and get back to root access
    • CTRL-C
    • exit
  • Create a hybris service startup file
    • vi /etc/init.d/hybris
  • Copy the text from the following file into the new created file.
    hybris startup script
  • Set the correct value for the hybris installation directory
    • # Make sure the server starts as a non-root user, set that here.
    • RUNAS=”hybris”
    • # Set the base path to your hybris installation.
    • HYBRIS_HOME=”/home/hybris/hybris”
  • Save the file
  • To verify the file is saved correctly open the file
    • cat /etc/init.d/hybris
  • Make sure the file can be executed
    • chmod 755 /etc/init.d/hybris
  • Add the file to the server startup list
    • chkconfig –add hybris
    • chkconfig hybris on
    • service hybris start

Configure Hybris With A MySQL Database

  • Make sure the mysqld service will auto-start on boot
  • Create a mysql database for hybris
    • mysql -u root
    • CREATE DATABASE hybris_db;
    • GRANT all ON hybris_db.* TO ‘hybris’@’localhost’;
    • UPDATE mysql.user SET Password=PASSWORD(‘password’) WHERE User=’hybris’;
    • FLUSH PRIVILEGES;
    • SELECT user,host FROM mysql.user; #show all users
    • exit
    • mysql -u hybris -h localhost -p #to log in as the hybris user
    • SHOW DATABASES; #to show all databases
    • exit
  • Restart the mysql service
    • sudo /etc/init.d/mysqld stop
    • sudo /etc/init.d/mysqld start
  • Download the mysql db connector from http://dev.mysql.com/downloads/file.php?id=454397.
  • Put the jar-file in the  folder ${HYBRIS_BIN_DIR}/platform/lib/dbdriver/
    (yet again I need to copy the file from my ec2-user home directory as I cannot use FTP on my hybris user)

    • exit #to gain root access
    • mv /home/ec2-user/mysql-connector-java-5.1.34-bin.jar/home/hybris/hybris/bin/platform/lib/dbdriver/mysql-connector-java-5.1.34-bin.jar
    • chown hybris:hybris /home/hybris/hybris/bin/platform/lib/dbdriver/mysql-connector-java-5.1.34-bin.jar#to set the owner and group to hybris
  • Put the mysql properties file in
  • Set the correct values in the properties file to connect with the mysql database
    • su hybris
    • vi /home/hybris/hybris/bin/platform/project.properties
    • db.url=jdbc:mysql://localhost/hybris_db?useConfigs=maxPerformance
    • db.driver=com.mysql.jdbc.Driver
    • db.username=hybris
    • db.password={password}
    • db.tableprefix=hybris_db
    • mysql.allow.fractional.seconds=true
    • mysql.optional.tabledefs=CHARSET=utf8 COLLATE=utf8_bin
    • mysql.tabletype=InnoDB
    • #hsqldb.usecachedtables=true
  • Save the file
  • Edit the config and add the following
    • vi /etc/my.cnf
    • innodb_flush_log_at_trx_commit=0
  • Save the file
  • Rebuild hybris
    • cd /home/hybris/hybris/bin/platform
    • . ./setantenv.sh
    • ant clean all #rebuild

Initialize Hybris

  • Restart hybris
    • exit #to gain root access
    • service hybris restart
  • Open the hybris Administration Console, the default URL for which is http://{AWS IP}:9001

All Done!

如果还不清楚,可参考以下文章:

本文作者: GavinDong

版权属于: GavinDong博客

文章链接: https://gavindong.com/460.html

如果使用过程中遇到问题,可 **点击此处** 交流沟通。

版权所有,转载时必须以链接形式注明作者和原始出处及本声明。

(1)

发表回复

登录后才能评论

评论列表(1条)

  • ag的头像
    ag 2017.05.17 22:30

    最重要的命令(Windows下)
    #部属/重新部属
    cd D:\JavaDev\tomcat\webapps\hybris\hybris\bin\platform
    setantenv.bat
    ant clean all
    #启动Hybris
    cd D:\JavaDev\tomcat\webapps\hybris\hybris\bin\platform
    hybrisserver.bat
    #停止Hybris
    [Ctrl + C]
    #数据库连接配置文件
    D:\JavaDev\tomcat\webapps\hybris\hybris\bin\platform\project.properties
    注意:
    Do not close the command window because the hybris Server must continue running in this window while you work in the hybris Commerce Suite. You may minimize it.
    http://localhost:9001
    admin / nimda
    数据库初始化大概需要10分钟!!!
    注意mysql数据库用mysql-installer-community-5.7.14.0.msi
    版本不能太低,否则 会报莫名其妙的错误。