{"id":18676649,"url":"https://github.com/mikeghen/unomi-tutorial","last_synced_at":"2025-04-12T02:20:31.690Z","repository":{"id":81764564,"uuid":"153702865","full_name":"mikeghen/unomi-tutorial","owner":"mikeghen","description":"Install and use Apache Unomi on Ubuntu 18","archived":false,"fork":false,"pushed_at":"2022-07-19T02:06:04.000Z","size":4,"stargazers_count":8,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T21:51:22.555Z","etag":null,"topics":["apache-unomi","elasticsearch","java","python","ubuntu"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikeghen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-19T00:10:19.000Z","updated_at":"2021-11-28T17:12:24.000Z","dependencies_parsed_at":"2023-03-12T14:00:24.232Z","dependency_job_id":null,"html_url":"https://github.com/mikeghen/unomi-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeghen%2Funomi-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeghen%2Funomi-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeghen%2Funomi-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeghen%2Funomi-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeghen","download_url":"https://codeload.github.com/mikeghen/unomi-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505921,"owners_count":21115354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache-unomi","elasticsearch","java","python","ubuntu"],"created_at":"2024-11-07T09:30:19.255Z","updated_at":"2025-04-12T02:20:31.680Z","avatar_url":"https://github.com/mikeghen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Installing Apache Unomi 1.3 on Ubuntu\nApache Unomi is a customer data platform built on top of Apache Karaf and ElasticSearch. Unomi provides a REST API and is extendible using Java.\n\n:warning: This is not a production setup. Command executed in the tutorial were done as root.\n\n## Install Java 8\n```\napt install openjdk-8-jdk\n```\nSet you `JAVA_HOME` by editing `/etc/environment`:\n```\nvi /etc/environment\n```\nand add these two lines below what is already there:\n```\nJAVA_HOME=\"/usr/lib/jvm/java-8-openjdk-amd64/\"\nPATH=$JAVA_HOME/bin:$PATH\n```\nReload environment:\n```\nsource /etc/environment\n```\n:warning: Your `JAVA_HOME` may vary. You can review the output of the `apt install` command to see where Java was installed.\n\n## Installing ElasticSearch 5.6.3\n```\napt-get update \u0026\u0026 apt-get -y install apt-transport-https curl wget\nwget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.3.deb\ndpkg -i elasticsearch-5.6.3.deb\n```\nNext, edit the ElasticSearch configuration:\n```\nvi /etc/elasticsearch/elasticsearch.yml\n```\nAdd uncomment and edit the line with `cluster.name` to:\n```\ncluster.name: contextElasticSearch\n```\nUnomi expects the cluster name to be `contextElasticSearch`.\n\nNow start and check the status of ElasticSearch to confirm it is running:\n```\nservice elasticsearch start\nservice elasticsearch status\n```\n\n## Installing Unomi 1.3\nYou can install a binary distribution from any of [these](https://www.apache.org/dyn/closer.lua/incubator/unomi/1.3.0-incubating/unomi-1.3.0-incubating-bin.tar.gz) mirrors. Just download and extract the files, the run it using Karaf.\n\nDownload and extract Unomi from binary distribution:\n```\nwget http://apache.mirrors.pair.com/incubator/unomi/1.3.0-incubating/unomi-1.3.0-incubating-bin.tar.gz\ntar -xzf unomi-1.3.0-incubating-bin.tar.gz\n```\nAfter it is extracted, I prefer to move it into `/opt/unomi`, just my preference to put installed software into `/opt`:\n```\nmkdir /opt/unomi\nmv unomi-1.3.0-incubating/*\n```\n\n## Start Unomi\nTo start Unomi from the terminal:\n```\n/opt/unomi/bin/karaf\n```\nIn the Karaf terminal, run `unomi:start`:\n```\nkaraf@root()\u003e unomi:start\n```\nAfter you run the command, Unomi will be available.\n\n## Test Unomi\nThere are some Python programs in this project that demostrate how to interface with Unomi.\n\nYou can check some endpoints in a web browser, the default username and password is `karaf` and `karaf`:\n```\nhttps://localhost:9443/cxs/cluster\nhttp://localhost:8181/context.js?sessionId=1234\n```\n:warning: You may need to change localhost if you installed this on a remote server.\n\n### Create a New Profile\nRun the Python file to create a new profile (use Python 3):\n```\npython new_profile.py\n```\nThis creates a profile with ID 10. You can view this profile with a [GET /profile endpoint](https://unomi.incubator.apache.org/rest-api-doc/#-1185500428) in the browser:\n```\nhttp://localhost:8181/cxs/profile/10\n```\n\n### Create a New Profile and Session\nRun the Python file to create a new profile (use Python 3):\n```\npython new_profile_and_session.py\n```\nThis creates a session with ID 101 and profile with ID 10. You can view this profile with a [GET /profile/{profile_id}/sessions endpoint](https://unomi.incubator.apache.org/rest-api-doc/#1764110248) in the browser:\n```\nhttp://localhost:8181/cxs/profiles/10/sessions/\n```\n\n### Create a New Rule\nRun the python file to create a new rule (use Python 3):\n```\npython new_rule.py\n```\nThis creates a rule with ID eligibilityRule and a profile with ID 10. You can view this rule with a [GET /rule/{rule_id} endpoint](https://unomi.incubator.apache.org/rest-api-doc/#-1505954579) in the browser:\n```\nhttp://localhost:8181/cxs/rules/eligibilityRule/\n```\nand you can view the profile which has been marked as eligible = \"yes\":\n```\nhttp://localhost:8181/cxs/profile/10\n```\n\n## Installing Unomi as a Service\nYou can install Unomi as a service using Karaf's [Service Wrapper](http://karaf.apache.org/manual/latest/#_service_wrapper).\n\nFrom the Karaf command line:\n```\nkaraf@root()\u003e feature:install wrapper\nkaraf@root()\u003e wrapper:install\n```\nThe output from the `wrapper:install` command will include instructions for finishing the installation and starting/stoping Karaf.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeghen%2Funomi-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeghen%2Funomi-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeghen%2Funomi-tutorial/lists"}