Поиск по блогу

среда, 13 мая 2015 г.

Устанавливаем RapidMiner Server на Debian в соответсвии с видео

Здесь я потерял час на том, что установил переменные окружения в одной консоли, а установку дистрибутива запустил в другой, в результате у меня все время устанавливалась java 6 вместо 7. Причина невнимательности в том, что я прерывал процесс дня на два (Вспоминал LAMP и наоткрывал консолей... поупражнялся, а потом "вернулся", но не туда...) Пост получился длинным, но последовательным.


Опубликовано: 29 июня 2014 г.

How to install RapidMiner Server on an Ubuntu 12.04 machine. Bonus feature, how to install RapidMiner extensions on the server.
How to correct JAVA_HOME which should point to a JDK not a JRE folder?
JAVA_HOME does not point to the JDK
3.3 Creating and Using a Database
Chapter 3 Tutorial This chapter provides a tutorial introduction to MySQL by showing how to use the mysql client program to create and use a simple database. mysql (sometimes referred to as the “terminal monitor” or just “monitor”) is an interactive program that enables you to connect to a MySQL server, run queries, and view the results. mysql may also be used in batch mode: you place your queries in a file beforehand, then tell mysql to execute the contents of the file. Both ways of using mysql are covered here.
How To Create a New User and Grant Permissions in MySQL
Installing and Starting RapidMiner Server

Разархивируем дистрибутив

Куда заливать сайт на Java? Устанавливаю первый раз..., Искать рекомендации некогда, потому припомним рекомендации для Python... и распакуем все в домашнюю поддиректорию.

In [ ]:
# Я сначала посмотрел, что содержится в архиве, 
# но копипаст из консоли (ниже) подробнее 
!unzip -l /home/kiss/Downloads/rapidminer-server-installer-2.4.0.zip
In [ ]:
kiss@kali:~/jServer$ unzip /home/kiss/Downloads/rapidminer-server-installer-2.4.0.zip
Archive:  /home/kiss/Downloads/rapidminer-server-installer-2.4.0.zip
   creating: rapidminer-server-installer-2.4.0/
   creating: rapidminer-server-installer-2.4.0/lib/
  inflating: rapidminer-server-installer-2.4.0/lib/rapidminer-server-installer-2.4.0.jar  
  inflating: rapidminer-server-installer-2.4.0/lib/rapidminer-license-core-3.0.2-SNAPSHOT.jar  
  inflating: rapidminer-server-installer-2.4.0/lib/rapidminer-license-api-3.0.0.jar  
  inflating: rapidminer-server-installer-2.4.0/lib/jackson-core-2.4.0.jar  
  inflating: rapidminer-server-installer-2.4.0/lib/jackson-databind-2.4.0.jar  
  inflating: rapidminer-server-installer-2.4.0/lib/jackson-annotations-2.4.0.jar  
   creating: rapidminer-server-installer-2.4.0/bin/
  inflating: rapidminer-server-installer-2.4.0/bin/rapidminer-server-installer.bat  
  inflating: rapidminer-server-installer-2.4.0/bin/rapidminer-server-installer  
  inflating: rapidminer-server-installer-2.4.0/EULA.txt  
   creating: rapidminer-server-installer-2.4.0/data/
   creating: rapidminer-server-installer-2.4.0/data/native_x86/
  inflating: rapidminer-server-installer-2.4.0/data/native_x86/README-service.txt  
  inflating: rapidminer-server-installer-2.4.0/data/native_x86/service.bat  
  inflating: rapidminer-server-installer-2.4.0/data/native_x86/jbossweb.exe  
  inflating: rapidminer-server-installer-2.4.0/data/native_x86/jbosswebw.exe  
  inflating: rapidminer-server-installer-2.4.0/data/native_x86/jbosssvc.exe  
   creating: rapidminer-server-installer-2.4.0/data/native_x86/native/
  inflating: rapidminer-server-installer-2.4.0/data/native_x86/native/tcnative-1.dll  
  inflating: rapidminer-server-installer-2.4.0/data/native_x86/native/openssl.exe  
   creating: rapidminer-server-installer-2.4.0/data/native_x64/
  inflating: rapidminer-server-installer-2.4.0/data/native_x64/README-service.txt  
  inflating: rapidminer-server-installer-2.4.0/data/native_x64/service.bat  
  inflating: rapidminer-server-installer-2.4.0/data/native_x64/jbossweb.x64.exe  
  inflating: rapidminer-server-installer-2.4.0/data/native_x64/jbosswebw.x64.exe  
  inflating: rapidminer-server-installer-2.4.0/data/native_x64/jbosssvc.exe  
   creating: rapidminer-server-installer-2.4.0/data/native_x64/native/
  inflating: rapidminer-server-installer-2.4.0/data/native_x64/native/tcnative-1.dll  
  inflating: rapidminer-server-installer-2.4.0/data/native_x64/native/openssl.exe  
  inflating: rapidminer-server-installer-2.4.0/data/RapidMiner-Server-JBoss-Bundle.zip  
   creating: rapidminer-server-installer-2.4.0/data/jdbc/
  inflating: rapidminer-server-installer-2.4.0/data/jdbc/mysql-connector-java-5.1.31.jar  
  inflating: rapidminer-server-installer-2.4.0/data/jdbc/postgresql-9.3-1101-jdbc4.jar  
  inflating: rapidminer-server-installer-2.4.0/data/jdbc/sqljdbc4-4.0.jar  
  inflating: rapidminer-server-installer-2.4.0/data/jdbc/ojdbc7-12.1.0.1.jar  

Пробуем сделать все по-взрослому. Не спешим работать с правами супервользователя

In [14]:
!ls -lR ~/jServer/rapidminer-server-installer-2.4.0/
/home/kiss/jServer/rapidminer-server-installer-2.4.0/:
total 44
drwxr-xr-x 2 kiss kiss  4096 May  4 10:45 bin
drwxr-xr-x 5 kiss kiss  4096 May  4 10:45 data
-rw-r--r-- 1 kiss kiss 30217 Apr 29 15:54 EULA.txt
drwxr-xr-x 2 kiss kiss  4096 May  4 10:45 lib

/home/kiss/jServer/rapidminer-server-installer-2.4.0/bin:
total 12
-rwxr-xr-x 1 kiss kiss 5361 May  4 10:45 rapidminer-server-installer
-rwxr-xr-x 1 kiss kiss 2736 May  4 10:45 rapidminer-server-installer.bat

/home/kiss/jServer/rapidminer-server-installer-2.4.0/data:
total 342396
drwxr-xr-x 2 kiss kiss      4096 May  4 10:45 jdbc
drwxr-xr-x 3 kiss kiss      4096 May  4 10:44 native_x64
drwxr-xr-x 3 kiss kiss      4096 May  4 10:44 native_x86
-rw-r--r-- 1 kiss kiss 350594502 May  4 10:44 RapidMiner-Server-JBoss-Bundle.zip

/home/kiss/jServer/rapidminer-server-installer-2.4.0/data/jdbc:
total 5412
-rw-r--r-- 1 kiss kiss  964879 Oct 16  2014 mysql-connector-java-5.1.31.jar
-rw-r--r-- 1 kiss kiss 3397734 Oct 16  2014 ojdbc7-12.1.0.1.jar
-rw-r--r-- 1 kiss kiss  588974 Oct 16  2014 postgresql-9.3-1101-jdbc4.jar
-rw-r--r-- 1 kiss kiss  584207 Oct 16  2014 sqljdbc4-4.0.jar

/home/kiss/jServer/rapidminer-server-installer-2.4.0/data/native_x64:
total 392
-rw-r--r-- 1 kiss kiss  53760 May  4 10:44 jbosssvc.exe
-rw-r--r-- 1 kiss kiss 188416 May  4 10:44 jbosswebw.x64.exe
-rw-r--r-- 1 kiss kiss 141824 May  4 10:44 jbossweb.x64.exe
drwxr-xr-x 2 kiss kiss   4096 May  4 10:44 native
-rw-r--r-- 1 kiss kiss   1892 May  4 10:44 README-service.txt
-rw-r--r-- 1 kiss kiss   3270 May  4 10:44 service.bat

/home/kiss/jServer/rapidminer-server-installer-2.4.0/data/native_x64/native:
total 2856
-rw-r--r-- 1 kiss kiss 1763840 May  4 10:44 openssl.exe
-rw-r--r-- 1 kiss kiss 1156096 May  4 10:44 tcnative-1.dll

/home/kiss/jServer/rapidminer-server-installer-2.4.0/data/native_x86:
total 404
-rw-r--r-- 1 kiss kiss  61440 May  4 10:44 jbosssvc.exe
-rw-r--r-- 1 kiss kiss 151552 May  4 10:44 jbossweb.exe
-rw-r--r-- 1 kiss kiss 188416 May  4 10:44 jbosswebw.exe
drwxr-xr-x 2 kiss kiss   4096 May  4 10:44 native
-rw-r--r-- 1 kiss kiss   1892 May  4 10:44 README-service.txt
-rw-r--r-- 1 kiss kiss   3270 May  4 10:44 service.bat

/home/kiss/jServer/rapidminer-server-installer-2.4.0/data/native_x86/native:
total 2164
-rw-r--r-- 1 kiss kiss 1339392 May  4 10:44 openssl.exe
-rw-r--r-- 1 kiss kiss  876544 May  4 10:44 tcnative-1.dll

/home/kiss/jServer/rapidminer-server-installer-2.4.0/lib:
total 3740
-rw-r--r-- 1 kiss kiss   38605 Oct 16  2014 jackson-annotations-2.4.0.jar
-rw-r--r-- 1 kiss kiss  225305 Oct 16  2014 jackson-core-2.4.0.jar
-rw-r--r-- 1 kiss kiss 1073743 Oct 16  2014 jackson-databind-2.4.0.jar
-rw-r--r-- 1 kiss kiss   35381 Feb 16 10:48 rapidminer-license-api-3.0.0.jar
-rw-r--r-- 1 kiss kiss   61460 Apr 29 16:05 rapidminer-license-core-3.0.2-SNAPSHOT.jar
-rw-r--r-- 1 kiss kiss 2376391 May  4 10:45 rapidminer-server-installer-2.4.0.jar
In [ ]:
####Теперь проверим версию Java (нам нуна 7-я)
In [ ]:
root@kali:/home/kiss# java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-1~deb7u1)
OpenJDK Server VM (build 24.79-b02, mixed mode)

Напомню, что в Kali эта версию надо подключать, т.к. по умолчанию грузится 6-ая. Для этого пришлось выполнить вот эти команды:

In [ ]:
root@kali:/home/kiss# update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                           Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode
In [ ]:
Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java to provide /usr/bin/java (java) in manual mode

Задаем переменную окружения

Нужно задать путь к jdk (а не к jre). ошибок здесь много, потому в начале поста есть ссылки на случай возникновения ошибок.

In [ ]:
root@kali:/home/kiss# JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
root@kali:/home/kiss# export JAVA_HOME
root@kali:/home/kiss# echo $JAVA_HOME
/usr/lib/jvm/java-7-openjdk-i386
In [ ]:
####Создаем базуданных
In [ ]:
root@kali:/var/www/revive-adserver# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 766
Server version: 5.5.43-0+deb7u1 (Debian)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> status
--------------
mysql  Ver 14.14 Distrib 5.5.43, for debian-linux-gnu (i686) using readline 6.2

Connection id:  766
Current database: 
Current user:  root@localhost
SSL:   Not in use
Current pager:  stdout
Using outfile:  ''
Using delimiter: ;
Server version:  5.5.43-0+deb7u1 (Debian)
Protocol version: 10
Connection:  Localhost via UNIX socket
Server characterset: latin1
Db     characterset: latin1
Client characterset: utf8
Conn.  characterset: utf8
UNIX socket:  /var/run/mysqld/mysqld.sock
Uptime:   7 days 15 hours 23 min 42 sec

Threads: 1  Questions: 26912  Slow queries: 0  Opens: 392  Flush tables: 1  Open tables: 109  Queries per second avg: 0.040
In [ ]:
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| openx_1            |
| openx_2            |
| performance_schema |
+--------------------+
5 rows in set (0.00 sec)
In [ ]:
mysql> create database srminer;
Query OK, 1 row affected (0.00 sec)
In [ ]:
mysql> create user 'miner'@'localhost' identified by 'digg';
Query OK, 0 rows affected (0.11 sec)
In [ ]:
mysql> grant all privileges on srminer.* to 'miner'@'localhost';
Query OK, 0 rows affected (0.02 sec)
In [ ]:
show grants for miner
In [ ]:
mysql>create user 'newuser'@'localhost' IDENTIFIED BY 'password'; #has no permissions to do anything with the databases
mysql>GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; # to all databases !!! like root?
FLUSH PRIVILEGES; # update 
In [ ]:
 GRANT [type of permission] ON [database name].[table name] TO [username]’@'localhost’;
In [ ]:
REVOKE [type of permission] ON [database name].[table name] FROM [username]’@‘localhost;
In [ ]:
mysql> help show
Name: 'SHOW'
Description:
SHOW has many forms that provide information about databases, tables,
columns, or status information about the server. This section describes
those following:

SHOW AUTHORS
SHOW {BINARY | MASTER} LOGS
SHOW BINLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count]
SHOW CHARACTER SET [like_or_where]
SHOW COLLATION [like_or_where]
SHOW [FULL] COLUMNS FROM tbl_name [FROM db_name] [like_or_where]
SHOW CONTRIBUTORS
SHOW CREATE DATABASE db_name
SHOW CREATE EVENT event_name
SHOW CREATE FUNCTION func_name
SHOW CREATE PROCEDURE proc_name
SHOW CREATE TABLE tbl_name
SHOW CREATE TRIGGER trigger_name
SHOW CREATE VIEW view_name
SHOW DATABASES [like_or_where]
SHOW ENGINE engine_name {STATUS | MUTEX}
SHOW [STORAGE] ENGINES
SHOW ERRORS [LIMIT [offset,] row_count]
SHOW EVENTS
SHOW FUNCTION CODE func_name
SHOW FUNCTION STATUS [like_or_where]
SHOW GRANTS FOR user
SHOW INDEX FROM tbl_name [FROM db_name]
SHOW MASTER STATUS
SHOW OPEN TABLES [FROM db_name] [like_or_where]
SHOW PLUGINS
SHOW PROCEDURE CODE proc_name
SHOW PROCEDURE STATUS [like_or_where]
SHOW PRIVILEGES
SHOW [FULL] PROCESSLIST
SHOW PROFILE [types] [FOR QUERY n] [OFFSET n] [LIMIT n]
SHOW PROFILES
SHOW SLAVE HOSTS
SHOW SLAVE STATUS
SHOW [GLOBAL | SESSION] STATUS [like_or_where]
SHOW TABLE STATUS [FROM db_name] [like_or_where]
SHOW [FULL] TABLES [FROM db_name] [like_or_where]
SHOW TRIGGERS [FROM db_name] [like_or_where]
SHOW [GLOBAL | SESSION] VARIABLES [like_or_where]
SHOW WARNINGS [LIMIT [offset,] row_count]

like_or_where:
    LIKE 'pattern'
  | WHERE expr

If the syntax for a given SHOW statement includes a LIKE 'pattern'
part, 'pattern' is a string that can contain the SQL "%" and "_"
wildcard characters. The pattern is useful for restricting statement
output to matching values.

Several SHOW statements also accept a WHERE clause that provides more
flexibility in specifying which rows to display. See
http://dev.mysql.com/doc/refman/5.5/en/extended-show.html.

URL: http://dev.mysql.com/doc/refman/5.5/en/show.html

Далее автор собщил, что скрипт установки rapidminer-server-installer

В нашем дистрибутиве он в папке bin

In [ ]:
root@kali:/home/kiss/jServer/rapidminer-server-installer-2.4.0/lib# java -jar rapidminer-server-installer-2.4.0.jar
no main manifest attribute, in rapidminer-server-installer-2.4.0.jar
In [ ]:
localhost
In [17]:
!cat /tmp/RMS_installer.xml
cat: /tmp/RMS_installer.xml: No such file or directory
In [ ]:
RapidMiner Server was successfully installed!
  To start RapidMiner Server,
go to '/var/jserver/bin' and execute the 'standalone.sh' file.
  To manage RapidMiner Server
after it has been started, visit the following URL with your browser: 'http://kali:8585'. 
    The initial password for the user "admin" is "changeit". Please do so immediately.
In [ ]:
kiss@kali:/var/jserver/bin$ bash standalone.sh
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /var/jserver

  JAVA: /usr/lib/jvm/java-6-openjdk-i386/bin/java

  JAVA_OPTS:  -server -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml

=========================================================================

java.lang.IllegalArgumentException: Failed to instantiate class "org.jboss.logmanager.handlers.PeriodicRotatingFileHandler" for handler "FILE"
 at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:118)
 at org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:333)
 at org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:290)
 at org.jboss.logmanager.config.LogContextConfigurationImpl.commit(LogContextConfigurationImpl.java:299)
 at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:505)
 at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:96)
 at org.jboss.as.logging.logmanager.ConfigurationPersistence.configure(ConfigurationPersistence.java:128)
 at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:300)
 at org.jboss.logmanager.LogManager.readConfiguration(LogManager.java:262)
 at java.util.logging.LogManager$2.run(LogManager.java:294)
 at java.util.logging.LogManager$2.run(LogManager.java:292)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:292)
 at java.util.logging.LogManager.getLogManager(LogManager.java:275)
 at java.util.logging.Logger.<init>(Logger.java:254)
 at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1327)
 at java.util.logging.LogManager$RootLogger.<init>(LogManager.java:1325)
 at java.util.logging.LogManager$1.run(LogManager.java:196)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.util.logging.LogManager.<clinit>(LogManager.java:173)
 at org.jboss.modules.Main.main(Main.java:313)
Caused by: java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:534)
 at org.jboss.logmanager.config.AbstractPropertyConfiguration$ConstructAction.validate(AbstractPropertyConfiguration.java:116)
 ... 20 more
Caused by: java.io.FileNotFoundException: /var/jserver/standalone/log/server.log (No such file or directory)
 at java.io.FileOutputStream.openAppend(Native Method)
 at java.io.FileOutputStream.<init>(FileOutputStream.java:210)
 at org.jboss.logmanager.handlers.FileHandler.setFile(FileHandler.java:154)
 at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.setFile(PeriodicRotatingFileHandler.java:105)
 at org.jboss.logmanager.handlers.FileHandler.setFileName(FileHandler.java:192)
 at org.jboss.logmanager.handlers.FileHandler.<init>(FileHandler.java:122)
 at org.jboss.logmanager.handlers.PeriodicRotatingFileHandler.<init>(PeriodicRotatingFileHandler.java:73)
 ... 25 more
In [16]:
!java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-1~deb7u1)
OpenJDK Server VM (build 24.79-b02, mixed mode)
In [19]:
!echo $JAVA_HOME

Как могла потеряться ппеременная окружения $JAVA_HOME, е же ее устанавливал, но это было вчера..., потом я переводил компьютер в спящий режим... неужели пожтому? ? Знаний не хватает, объяснить не могу... Просто смотрим скрипт, да, там есть эта переменная окружения:

In [18]:
!cat /var/jserver/bin/standalone.sh
#!/bin/sh

# Use --debug to activate debug mode with an optional argument to specify the port.
# Usage : standalone.bat --debug
#         standalone.bat --debug 9797

# By default debug mode is disable.
DEBUG_MODE=false
DEBUG_PORT="8787"
SERVER_OPTS=""
while [ "$#" -gt 0 ]
do
    case "$1" in
      --debug)
          DEBUG_MODE=true
          shift
          if [ -n "$1" ] && [ "${1#*-}" = "$1" ]; then
              DEBUG_PORT=$1
          else
              SERVER_OPTS="$SERVER_OPTS $1"
          fi
          ;;
      --)
          shift 
          break;;
      *)
          SERVER_OPTS="$SERVER_OPTS \"$1\""
          ;;
    esac
    shift
done

DIRNAME=`dirname "$0"`
PROGNAME=`basename "$0"`
GREP="grep"

# Use the maximum available, or set MAX_FD != -1 to use that
MAX_FD="maximum"

# OS specific support (must be 'true' or 'false').
cygwin=false;
darwin=false;
linux=false;
case "`uname`" in
    CYGWIN*)
        cygwin=true
        ;;

    Darwin*)
        darwin=true
        ;;

    Linux)
        linux=true
        ;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
    [ -n "$JBOSS_HOME" ] &&
        JBOSS_HOME=`cygpath --unix "$JBOSS_HOME"`
    [ -n "$JAVA_HOME" ] &&
        JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
    [ -n "$JAVAC_JAR" ] &&
        JAVAC_JAR=`cygpath --unix "$JAVAC_JAR"`
fi

# Setup JBOSS_HOME
RESOLVED_JBOSS_HOME=`cd "$DIRNAME/.."; pwd`
if [ "x$JBOSS_HOME" = "x" ]; then
    # get the full path (without any relative bits)
    JBOSS_HOME=$RESOLVED_JBOSS_HOME
else
 SANITIZED_JBOSS_HOME=`cd "$JBOSS_HOME"; pwd`
 if [ "$RESOLVED_JBOSS_HOME" != "$SANITIZED_JBOSS_HOME" ]; then
   echo ""
   echo "   WARNING:  JBOSS_HOME may be pointing to a different installation - unpredictable results may occur."
   echo ""
   echo "             JBOSS_HOME: $JBOSS_HOME"
   echo ""
   sleep 2s
 fi
fi
export JBOSS_HOME

# Read an optional running configuration file
if [ "x$RUN_CONF" = "x" ]; then
    RUN_CONF="$DIRNAME/standalone.conf"
fi
if [ -r "$RUN_CONF" ]; then
    . "$RUN_CONF"
fi

# Set debug settings if not already set
if [ "$DEBUG_MODE" = "true" ]; then
    DEBUG_OPT=`echo $JAVA_OPTS | $GREP "\-agentlib:jdwp"`
    if [ "x$DEBUG_OPT" = "x" ]; then
        JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=$DEBUG_PORT,server=y,suspend=n"
    else
        echo "Debug already enabled in JAVA_OPTS, ignoring --debug argument"
    fi
fi

# Setup the JVM
if [ "x$JAVA" = "x" ]; then
    if [ "x$JAVA_HOME" != "x" ]; then
        JAVA="$JAVA_HOME/bin/java"
    else
        JAVA="java"
    fi
fi

if [ "$PRESERVE_JAVA_OPTS" != "true" ]; then
    # Check for -d32/-d64 in JAVA_OPTS
    JVM_D64_OPTION=`echo $JAVA_OPTS | $GREP "\-d64"`
    JVM_D32_OPTION=`echo $JAVA_OPTS | $GREP "\-d32"`

    # Check If server or client is specified
    SERVER_SET=`echo $JAVA_OPTS | $GREP "\-server"`
    CLIENT_SET=`echo $JAVA_OPTS | $GREP "\-client"`

    if [ "x$JVM_D32_OPTION" != "x" ]; then
        JVM_OPTVERSION="-d32"
    elif [ "x$JVM_D64_OPTION" != "x" ]; then
        JVM_OPTVERSION="-d64"
    elif $darwin && [ "x$SERVER_SET" = "x" ]; then
        # Use 32-bit on Mac, unless server has been specified or the user opts are incompatible
        "$JAVA" -d32 $JAVA_OPTS -version > /dev/null 2>&1 && PREPEND_JAVA_OPTS="-d32" && JVM_OPTVERSION="-d32"
    fi

    CLIENT_VM=false
    if [ "x$CLIENT_SET" != "x" ]; then
        CLIENT_VM=true
    elif [ "x$SERVER_SET" = "x" ]; then
        if $darwin && [ "$JVM_OPTVERSION" = "-d32" ]; then
            # Prefer client for Macs, since they are primarily used for development
            CLIENT_VM=true
            PREPEND_JAVA_OPTS="$PREPEND_JAVA_OPTS -client"
        else
            PREPEND_JAVA_OPTS="$PREPEND_JAVA_OPTS -server"
        fi
    fi

    if [ $CLIENT_VM = false ]; then
        NO_COMPRESSED_OOPS=`echo $JAVA_OPTS | $GREP "\-XX:\-UseCompressedOops"`
        if [ "x$NO_COMPRESSED_OOPS" = "x" ]; then
            "$JAVA" $JVM_OPTVERSION -server -XX:+UseCompressedOops -version >/dev/null 2>&1 && PREPEND_JAVA_OPTS="$PREPEND_JAVA_OPTS -XX:+UseCompressedOops"
        fi
    fi

    JAVA_OPTS="$PREPEND_JAVA_OPTS $JAVA_OPTS"
fi

if [ "x$JBOSS_MODULEPATH" = "x" ]; then
    JBOSS_MODULEPATH="$JBOSS_HOME/modules"
fi

if $linux; then
    # consolidate the server and command line opts
    CONSOLIDATED_OPTS="$JAVA_OPTS $SERVER_OPTS"
    # process the standalone options
    for var in $CONSOLIDATED_OPTS
    do
       case $var in
         -Djboss.server.base.dir=*)
              JBOSS_BASE_DIR=`readlink -m ${var#*=}`
              ;;
         -Djboss.server.log.dir=*)
              JBOSS_LOG_DIR=`readlink -m ${var#*=}`
              ;;
         -Djboss.server.config.dir=*)
              JBOSS_CONFIG_DIR=`readlink -m ${var#*=}`
              ;;
       esac
    done
fi
# determine the default base dir, if not set
if [ "x$JBOSS_BASE_DIR" = "x" ]; then
   JBOSS_BASE_DIR="$JBOSS_HOME/standalone"
fi
# determine the default log dir, if not set
if [ "x$JBOSS_LOG_DIR" = "x" ]; then
   JBOSS_LOG_DIR="$JBOSS_BASE_DIR/log"
fi
# determine the default configuration dir, if not set
if [ "x$JBOSS_CONFIG_DIR" = "x" ]; then
   JBOSS_CONFIG_DIR="$JBOSS_BASE_DIR/configuration"
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
    JBOSS_HOME=`cygpath --path --windows "$JBOSS_HOME"`
    JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
    JBOSS_MODULEPATH=`cygpath --path --windows "$JBOSS_MODULEPATH"`
    JBOSS_BASE_DIR=`cygpath --path --windows "$JBOSS_BASE_DIR"`
    JBOSS_LOG_DIR=`cygpath --path --windows "$JBOSS_LOG_DIR"`
    JBOSS_CONFIG_DIR=`cygpath --path --windows "$JBOSS_CONFIG_DIR"`
fi

# Display our environment
echo "========================================================================="
echo ""
echo "  JBoss Bootstrap Environment"
echo ""
echo "  JBOSS_HOME: $JBOSS_HOME"
echo ""
echo "  JAVA: $JAVA"
echo ""
echo "  JAVA_OPTS: $JAVA_OPTS"
echo ""
echo "========================================================================="
echo ""

while true; do
   if [ "x$LAUNCH_JBOSS_IN_BACKGROUND" = "x" ]; then
      # Execute the JVM in the foreground
      eval \"$JAVA\" -D\"[Standalone]\" $JAVA_OPTS \
         \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/server.log\" \
         \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \
         -Xbootclasspath/a:\"$JBOSS_HOME/jboss-modules.jar\" \
         -jar \"$JBOSS_HOME/jboss-modules.jar\" \
         -mp \"${JBOSS_MODULEPATH}\" \
         -jaxpmodule "javax.xml.jaxp-provider" \
         org.jboss.as.standalone \
         -Djboss.home.dir=\"$JBOSS_HOME\" \
         -Djboss.server.base.dir=\"$JBOSS_BASE_DIR\" \
         "$SERVER_OPTS"
      JBOSS_STATUS=$?
   else
      # Execute the JVM in the background
      eval \"$JAVA\" -D\"[Standalone]\" $JAVA_OPTS \
         \"-Dorg.jboss.boot.log.file=$JBOSS_LOG_DIR/server.log\" \
         \"-Dlogging.configuration=file:$JBOSS_CONFIG_DIR/logging.properties\" \
         -Xbootclasspath/a:\"$JBOSS_HOME/jboss-modules.jar\" \
         -jar \"$JBOSS_HOME/jboss-modules.jar\" \
         -mp \"${JBOSS_MODULEPATH}\" \
         -jaxpmodule "javax.xml.jaxp-provider" \
         org.jboss.as.standalone \
         -Djboss.home.dir=\"$JBOSS_HOME\" \
         -Djboss.server.base.dir=\"$JBOSS_BASE_DIR\" \
         "$SERVER_OPTS" "&"
      JBOSS_PID=$!
      # Trap common signals and relay them to the jboss process
      trap "kill -HUP  $JBOSS_PID" HUP
      trap "kill -TERM $JBOSS_PID" INT
      trap "kill -QUIT $JBOSS_PID" QUIT
      trap "kill -PIPE $JBOSS_PID" PIPE
      trap "kill -TERM $JBOSS_PID" TERM
      if [ "x$JBOSS_PIDFILE" != "x" ]; then
        echo $JBOSS_PID > $JBOSS_PIDFILE
      fi
      # Wait until the background process exits
      WAIT_STATUS=128
      while [ "$WAIT_STATUS" -ge 128 ]; do
         wait $JBOSS_PID 2>/dev/null
         WAIT_STATUS=$?
         if [ "$WAIT_STATUS" -gt 128 ]; then
            SIGNAL=`expr $WAIT_STATUS - 128`
            SIGNAL_NAME=`kill -l $SIGNAL`
            echo "*** JBossAS process ($JBOSS_PID) received $SIGNAL_NAME signal ***" >&2
         fi
      done
      if [ "$WAIT_STATUS" -lt 127 ]; then
         JBOSS_STATUS=$WAIT_STATUS
      else
         JBOSS_STATUS=0
      fi
      if [ "$JBOSS_STATUS" -ne 10 ]; then
            # Wait for a complete shudown
            wait $JBOSS_PID 2>/dev/null
      fi
      if [ "x$JBOSS_PIDFILE" != "x" ]; then
            grep "$JBOSS_PID" $JBOSS_PIDFILE && rm $JBOSS_PIDFILE
      fi
   fi
   if [ "$JBOSS_STATUS" -eq 10 ]; then
      echo "Restarting JBoss..."
   else
      exit $JBOSS_STATUS
   fi
done

Выставим все снова

In [ ]:
root@kali:/home/kiss/jServer/rapidminer-server-installer-2.4.0/bin# JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386
root@kali:/home/kiss/jServer/rapidminer-server-installer-2.4.0/bin# export JAVA_HOME
root@kali:/home/kiss/jServer/rapidminer-server-installer-2.4.0/bin# echo $JAVA_HOME
/usr/lib/jvm/java-7-openjdk-i386

И снова получаем же ошибку

In [ ]:
kiss@kali:/var/jserver/bin$ bash standalone.sh
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /var/jserver

  JAVA: /usr/lib/jvm/java-6-openjdk-i386/bin/java

  JAVA_OPTS:  -server -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml
In [ ]:
!update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                           Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java   1061      manual mode
* 2            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode

Press enter to keep the current choice[*], or type selection number: 
In [ ]:
! bash standalone.sh

И тут до меня доходит, что переменную окружения я назначил в одной консоли, а скрипт выполнял в другой... Типичная ошибка невнивательного чайника. Запустился откуда надо и получил огромный вывод в консоль, но при загрузке страницы:

Попробовал занрузить в браузере http://kali:8585 и был переадресоан на http://kali:8585/RA/faces/restricted/index.xhtml

In [ ]:
JBWEB000065: HTTP Status 404 - /RA/faces/restricted/index.xhtml

JBWEB000309: type JBWEB000067: Status report

JBWEB000068: message /RA/faces/restricted/index.xhtml

JBWEB000069: description JBWEB000124: The requested resource is not available.
JBoss Web/7.2.0.Final

Потом еще раз заглянул в консоль, там по прежнему грузится java6, решил вручную назначить переменную окружения JAVA

In [ ]:
root@kali:/var/jserver/bin# JAVA=/usr/lib/jvm/java-7-openjdk-i386/bin/java
root@kali:/var/jserver/bin# export JAVA
root@kali:/var/jserver/bin# echo $JAVA
/usr/lib/jvm/java-7-openjdk-i386/bin/java
root@kali:/var/jserver/bin# echo $JAVA_HOME
/usr/lib/jvm/java-7-openjdk-i386
root@kali:/var/jserver/bin# java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-1~deb7u1)
OpenJDK Server VM (build 24.79-b02, mixed mode)
root@kali:/var/jserver/bin# bash standalone.sh
=========================================================================

  JBoss Bootstrap Environment

  JBOSS_HOME: /var/jserver

  JAVA: /usr/lib/jvm/java-7-openjdk-i386/bin/java

  JAVA_OPTS:  -server -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+UseG1GC -XX:MaxGCPauseMillis=50 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml

И вот все заработало, правда пришлось заменить kali на localhost

In [ ]:
http://localhost:8585/RA/faces/login.xhtml;jsessionid=OZEtMVwTKlYkCOMHFikVALVA
In [ ]:
Нужно было ввести юзера admin и пароль  changeit, появилась страница с доп. настройками:
In [ ]:
RapidMiner Server Installation - Step 1

Your RapidMiner Server installation is not yet complete. The following steps must be executed before RapidMiner Server can be used for the first time.

INFO: Result of SQL dialect autodetection: MYSQL.
INFO: Quartz tables must be created.
INFO: com.rapidanalytics.uploaddir not set.
INFO: com.rapidanalytics.plugindir not set. 
  

SQL Dialect  
Create SQL tables for the Quartz scheduler automatically  
RapidMiner Server can automatically create tables that are required for the Quartz scheduler automatically. If you would like to create these tables yourself, uncheck this box. You will then be shown an SQL script that you must run in your database.
Plugin directory  
Upload directory
In [ ]:
Сначала создал папки, а потом в браузере их назначил
In [ ]:
/tmp/jserver/plugins
/tmp/jserver/upload
In [ ]:
ПОлучается, что всего у нас три места , вот третье
In [ ]:
/var/jserver
In [ ]:
Нажал на кнопку "Продолжить"  в браузере и получил:
In [ ]:
RapidMiner Server Installation - Step 2
box_software.png RapidMiner Server Installation - Step 2

Executing installation.

INFO: Quartz tables successfully created.
INFO: SQL dialect specified: MYSQL.
INFO: Quartz tables found.
INFO: Quartz started
INFO: Startup complete. 
  


Посты чуть ниже также могут вас заинтересовать

Комментариев нет:

Отправить комментарий