OKdevTV Docs
Home OKdevTV
ESC
yona 2 min read 3.2 KB Raw Markdown
On this page (8)

1,5: # Yona @Deprecated # use gitlab or github

In AWS install Yona

Prerequisite

  • MariaDB
    • CentOS
text
sudo dnf update -y
# for aws ec2 with 10.2.16
rpm -ev --nodeps mariadb-libs-5.5.56-2.amzn2.x86_64
wget https://rpmfind.net/linux/Mandriva/official/2010.0/x86_64/media/main/release/lib64boost5-1.39.0-2mdv2010.0.x86_64.rpm
rpm -iv --nodeps lib64boost5-1.39.0-2mdv2010.0.x86_64.rpm
sudo vi /etc/yum.repos.d/MariaDB.repo
- MariaDB.repo
text
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
- MariaDB config
text
sudo dnf install MariaDB-server
text
sudo service mysql start
sudo mysql_secure_installation
text
mysql -uroot -p
text
GRANT ALL PRIVILEGES ON yona.* TO yona@localhost
IDENTIFIED BY 'yonadan' WITH GRANT OPTION;

set global innodb_file_format = BARRACUDA;
set global innodb_large_prefix = ON;
create database yona DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_bin;
  • Server config
text
sudo vi /etc/my.cnf.d/server.cnf
- ubuntu : `sudo vi /etc/mysql/my.cnf`
text
[mysqld]
collation-server=utf8mb4_unicode_ci
init-connect='SET NAMES utf8mb4'
character-set-server=utf8mb4
lower_case_table_names=1
innodb_file_format=barracuda
innodb_large_prefix=on
  • Client config
text
sudo vi /etc/my.cnf.d/mysql-clients.cnf
text
[mysql]
default-character-set=utf8mb4

Install Yona

  • Yona installation
text
mkdir local && cd local
# MariaDB 10.2 required
wget https://github.com/yona-projects/yona/releases/download/v1.11.0/yona-v1.11.0-bin.zip

unzip yona-v1.11.0-bin.zip
ln -s yona-1.11.0/ yona
cd yona
bin/yona # first for unarchive folders
vi conf/application.conf
  • DB info in conf/application.conf
text
# MariaDB
db.default.driver=org.mariadb.jdbc.Driver
db.default.url="jdbc:mariadb://127.0.0.1:3306/yona?useServerPrepStmts=true"
db.default.user=yona
db.default.password="yonadan"
  • run yona
text
bin/yona

Run Yona in Background

text
nohup bin/yona &

Errors

  • [error] play - Specified key was too long; max key length is 767 bytes [ERROR:1071, SQLSTATE:42000] If you see this, delete MariaDB and reinstall
  • sudo dnf uninstall -y MariaDB-server MariaDB-client

Yona in Windows

  • env variables
text
SET YONA_HOME=c:\yona\yona-1.11.0
SET JAVA_OPTS=-Dyona.home=%YONA_HOME% -Dconfig.file=%YONA_HOME%\conf\application.conf -Dlogger.file=%YONA_HOME%\conf\application-logger.xml

Yona restart shell

text
#!/bin/bash
source /home/ec2-user/.bash_profile

cd /home/ec2-user/local/yona
sudo kill -9 `cat RUNNING_PID`
sudo rm -rf RUNNING_PID
sleep 5
/usr/bin/nohup /home/ec2-user/local/yona/bin/yona &

ref