Showing posts with label setup. Show all posts
Showing posts with label setup. Show all posts

Wednesday, 1 June 2022

Setup Apache atlas in embedded mode

Step 1: Download latest release from below link.

https://github.com/apache/atlas/tags

 

Step 2: Open a terminal and navigate to the directory where atlas pom.xml file is located, execute below commands.

export MAVEN_OPTS="-Xmx1500m"

mvn clean -DskipTests package -Pdist,embedded-hbase-solr

Upon successful completion of mvn command, you can see below artifacts in distro/target folder.

distro/target/apache-atlas-{project.version}-bin.tar.gz   
distro/target/apache-atlas-{project.version}-impala-hook.tar.gz 
distro/target/apache-atlas-{project.version}-sqoop-hook.tar.gz
distro/target/apache-atlas-{project.version}-falcon-hook.tar.gz 
distro/target/apache-atlas-{project.version}-kafka-hook.tar.gz  
distro/target/apache-atlas-{project.version}-storm-hook.tar.gz
distro/target/apache-atlas-{project.version}-hbase-hook.tar.gz  
distro/target/apache-atlas-{project.version}-server.tar.gz
distro/target/apache-atlas-{project.version}-hive-hook.tar.gz 
distro/target/apache-atlas-{project.version}-sources.tar.gz

Step 3: Copy the file 'apache-atlas-{project.version}-server.tar.gz' to a folder where you would like to install  Apache Atlas, and run the following commands.

tar -xzvf apache-atlas-{project.version}-server.tar.gz
cd apache-atlas-{project.version}

Step 4: Start Apache atlas server.

To run Apache Atlas with local Apache HBase & Apache Solr instances that are started/stopped along with Atlas start/stop, run following commands:

export MANAGE_LOCAL_HBASE=true
export MANAGE_LOCAL_SOLR=true
bin/atlas_start.py

bash-3.2$ bin/atlas_start.py

Configured for local HBase.
Starting local HBase...
Local HBase started!

Configured for local Solr.
Starting local Solr...
solr.xml doesn't exist in /Users/krishna/Documents/softwares/atlas-exec/apache-atlas-2.2.0/data/solr, copying from /Users/krishna/Documents/softwares/atlas-exec/apache-atlas-2.2.0/solr/server/solr/solr.xml
Local Solr started!

Creating Solr collections for Atlas using config: /Users/krishna/Documents/softwares/atlas-exec/apache-atlas-2.2.0/conf/solr

Starting Atlas server on host: localhost
Starting Atlas server on port: 21000
...........................
Apache Atlas Server started!!!

 

Confirm whether apache atlas instance is running successfully or not

Execute below command.

curl -u admin:admin http://localhost:21000/api/atlas/admin/version

bash-3.2$ curl -u admin:admin http://localhost:21000/api/atlas/admin/version
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 503 Service Unavailable</title>
</head>
<body><h2>HTTP ERROR 503 Service Unavailable</h2>
<table>
<tr><th>URI:</th><td>/api/atlas/admin/version</td></tr>
<tr><th>STATUS:</th><td>503</td></tr>
<tr><th>MESSAGE:</th><td>Service Unavailable</td></tr>
<tr><th>SERVLET:</th><td>-</td></tr>
</table>

</body>
</html>


Oops, I got service unavailable error. When I check the log messages, I see below error.

 

org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://192.168.1.100:9838/solr: Can not find the specified config set: vertex_index
	at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:681)
	at 

 I stopped the server manually by executing the command ‘bin/atlas_stop.py’.

bash-3.2$ bin/atlas_stop.py 
stopping atlas.
Apache Atlas Server stopped!!!

Sending stop command to Solr running on port 9838 ... waiting up to 180 seconds to allow Jetty process 78818 to stop gracefully.
running master, logging to /Users/krishna/Documents/softwares/atlas-exec/apache-atlas-2.2.0/hbase/bin/../logs/hbase-krishna-master-m-c02g415mmd6n.out
stopping master.

 

Start the solr service manually

./solr/bin/solr start -c -z localhost:2181 -p 8984 -force

bash-3.2$ ./solr/bin/solr start -c -z localhost:2181 -p 8984 -force
*** [WARN] *** Your open file limit is currently 2560.  
 It should be set to 65000 to avoid operational disruption. 
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
*** [WARN] ***  Your Max Processes Limit is currently 2784. 
 It should be set to 65000 to avoid operational disruption. 
 If you no longer wish to see this warning, set SOLR_ULIMIT_CHECKS to false in your profile or solr.in.sh
Waiting up to 180 seconds to see Solr running on port 8984 [/]  
Started Solr server on port 8984 (pid=93588). Happy searching!

Create an initialization index library for solr by executing below command.

./solr/bin/solr create -c vertex_index -shards 1 -replicationFactor 1 -force

bash-3.2$ ./solr/bin/solr create -c vertex_index -shards 1 -replicationFactor 1 -force
WARNING: Using _default configset with data driven schema functionality. NOT RECOMMENDED for production use.
         To turn off: bin/solr config -c vertex_index -p 8984 -action set-user-property -property update.autoCreateFields -value false
Created collection 'vertex_index' with 1 shard(s), 1 replica(s) with config-set 'vertex_index'

Stop solr server.

bash-3.2$ ./solr/bin/solr stop
Sending stop command to Solr running on port 8984 ... waiting up to 180 seconds to allow Jetty process 93588 to stop gracefully.
bash-3.2$

Start apache atlas server again

bash-3.2$ bin/atlas_start.py

Configured for local HBase.
Starting local HBase...
Local HBase started!

Configured for local Solr.
Starting local Solr...
Local Solr started!

Creating Solr collections for Atlas using config: /Users/krishna/Documents/softwares/atlas-exec/apache-atlas-2.2.0/conf/solr

Starting Atlas server on host: localhost
Starting Atlas server on port: 21000
........
Apache Atlas Server started!!!

Execute the command ‘curl -u admin:admin http://localhost:21000/api/atlas/admin/version’ to confirm whether apache atlas running successfully or not.

bash-3.2$ curl -u admin:admin http://localhost:21000/api/atlas/admin/version
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 503 Service Unavailable</title>
</head>
<body><h2>HTTP ERROR 503 Service Unavailable</h2>
<table>
<tr><th>URI:</th><td>/api/atlas/admin/version</td></tr>
<tr><th>STATUS:</th><td>503</td></tr>
<tr><th>MESSAGE:</th><td>Service Unavailable</td></tr>
<tr><th>SERVLET:</th><td>-</td></tr>
</table>

</body>
</html>

Come on…..not again..

 

When I check application.log file, I seen below error.

org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://192.168.1.100:9838/solr: Can not find the specified config set: edge_index

Stop atlas server

bin/atlas_stop.py

 

Start solr server

./solr/bin/solr start -c -z localhost:2181 -p 8984 -force

 

Create edge_index collection

./solr/bin/solr create -c edge_index -shards 1 -replicationFactor 1 -force

 

Now stop solr server and start apache atlas again

./solr/bin/solr stop

bin/atlas_start.py

 

Reexecute the curl command to confirm

$ curl -u admin:admin http://localhost:21000/api/atlas/admin/version
{"Description":"Metadata Management and Data Governance Platform over Hadoop","Revision":"release","Version":"2.2.0","Name":"apache-atlas"}

Get all the types

curl -u admin:admin http://localhost:21000/api/atlas/v2/types/typedefs/headers

 

 

That’s it, you are done…..


Previous                                                    Next                                                    Home

Thursday, 24 June 2021

Install and setup ArangoDB on MacOS

Step 1: Open terminal and execute below command.

brew install arangodb

 

At the end of installation, you will see a summary like below.

==> Summary
🍺  /usr/local/Cellar/openssl@1.1/1.1.1k: 8,071 files, 18.5MB
==> Installing arangodb
==> Pouring arangodb--3.7.11_1.catalina.bottle.tar.gz
==> Caveats
An empty password has been set. Please change it by executing
  /usr/local/opt/arangodb/sbin/arango-secure-installation

To have launchd start arangodb now and restart at login:
  brew services start arangodb
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/arangodb/sbin/arangod
==> Summary

 

Step 2: Set the password for aronogDB by executing below command.

/usr/local/opt/arangodb/sbin/arango-secure-installation

$ /usr/local/opt/arangodb/sbin/arango-secure-installation
Please enter a new password for the ArangoDB root user: 
Repeat password: 
2021-05-04T09:23:05Z [80444] INFO [a1c60] {syscall} file-descriptors (nofiles) hard limit is unlimited, soft limit is 8192
2021-05-04T09:23:06Z [80444] INFO [c1b63] {arangosearch} ArangoSearch maintenance: [2..2] commit thread(s), [2..2] consolidation thread(s)
2021-05-04T09:23:06Z [80444] INFO [95cab] Password changed.
2021-05-04T09:23:06Z [80444] INFO [7da27] {startup} server will now shut down due to upgrade, database initialization or admin restoration.

 

I set the password as tiger.

 

Step 3: Start arongodb server by executing below command.

 

/usr/local/opt/arangodb/sbin/arangod

$ /usr/local/opt/arangodb/sbin/arangod
2021-05-04T09:24:04Z [82436] INFO [e52b0] ArangoDB 3.7.11 [darwin] 64bit, using build , VPack 0.1.33, RocksDB 6.8.0, ICU 64.2, V8 7.9.317, OpenSSL 1.1.1k  25 Mar 2021
2021-05-04T09:24:04Z [82436] INFO [43396] {authentication} Jwt secret not specified, generating...
2021-05-04T09:24:04Z [82436] INFO [144fe] using storage engine 'rocksdb'
2021-05-04T09:24:04Z [82436] INFO [3bb7d] {cluster} Starting up with role SINGLE
2021-05-04T09:24:04Z [82436] INFO [a1c60] {syscall} file-descriptors (nofiles) hard limit is unlimited, soft limit is 8192
2021-05-04T09:24:04Z [82436] INFO [3844e] {authentication} Authentication is turned on (system only), authentication for unix sockets is turned on
2021-05-04T09:24:05Z [82436] INFO [c1b63] {arangosearch} ArangoSearch maintenance: [2..2] commit thread(s), [2..2] consolidation thread(s)
2021-05-04T09:24:05Z [82436] INFO [6ea38] using endpoint 'http+tcp://127.0.0.1:8529' for non-encrypted requests
2021-05-04T09:24:05Z [82436] INFO [cf3f4] ArangoDB (version 3.7.11 [darwin]) is ready for business. Have fun!

 

Open the url ‘http://127.0.0.1:8529/’ in browser.

 

 


Login with user name as root and password as tiger.




 

_system is the default database that comes with arongoDB installation. Click on the button ‘Select DB:_system.




Connection to aronogoDB using aronogshell

Execute below command to connect to arongoDB server from command line client.

/usr/local/opt/arangodb/bin/arangosh

$ /usr/local/opt/arangodb/bin/arangosh
Please specify a password: 

                                       _     
  __ _ _ __ __ _ _ __   __ _  ___  ___| |__  
 / _` | '__/ _` | '_ \ / _` |/ _ \/ __| '_ \ 
| (_| | | | (_| | | | | (_| | (_) \__ \ | | |
 \__,_|_|  \__,_|_| |_|\__, |\___/|___/_| |_|
                       |___/                 

arangosh (ArangoDB 3.7.11 [darwin] 64bit, using build , VPack 0.1.33, RocksDB 6.8.0, ICU 64.2, V8 7.9.317, OpenSSL 1.1.1k  25 Mar 2021)
Copyright (c) ArangoDB GmbH

Command-line history will be persisted when the shell is exited. You can use `--console.history false` to turn this off
Connected to ArangoDB 'http+tcp://127.0.0.1:8529, version: 3.7.11 [SINGLE, server], database: '_system', username: 'root'

Type 'tutorial' for a tutorial or 'help' to see common examples
127.0.0.1:8529@_system>

 

Add arango commands path to system path

Add following statements to ~/.bash_profile file.

 

export PATH=$PATH:/usr/local/opt/arangodb/sbin

export PATH=$PATH:/usr/local/opt/arangodb/bin

  

Reference

https://www.arangodb.com/docs/devel/installation-mac-osx.html

 

 

Previous                                                    Next                                                    Home

Sunday, 14 March 2021

Setting up Environment for hibernate-validator

I am going to use Hibernate validator '6.0.10.Final'.

		<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-validator -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-validator</artifactId>
			<version>6.0.10.Final</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/javax.validation/validation-api -->
		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<version>2.0.1.Final</version>
		</dependency>

 

Since Hibernate validator requires an implementation of Unified Expression Language (JSR 341) specification. If you are using Hibernate-validator in standalone servlet container such as tomcat, jboss then these dependencies are already provided. But if you are using Hibernate-validator in standalone application, then you need to provide below JSR 341 dependencies manually.

		<!-- https://mvnrepository.com/artifact/javax.el/javax.el-api -->
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>javax.el-api</artifactId>
			<version>3.0.1-b04</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.glassfish.web/javax.el -->
		<dependency>
			<groupId>org.glassfish.web</groupId>
			<artifactId>javax.el</artifactId>
			<version>2.2.6</version>
		</dependency>

My pom.xml looks like below.

<project xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>hibernateValidator</groupId>
	<artifactId>hibernateValidator</artifactId>
	<version>1</version>

	<dependencies>
		<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-validator -->
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-validator</artifactId>
			<version>6.0.10.Final</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/javax.validation/validation-api -->
		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<version>2.0.1.Final</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/javax.el/javax.el-api -->
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>javax.el-api</artifactId>
			<version>3.0.1-b04</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.glassfish.web/javax.el -->
		<dependency>
			<groupId>org.glassfish.web</groupId>
			<artifactId>javax.el</artifactId>
			<version>2.2.6</version>
		</dependency>

	</dependencies>
</project>




 

 

 

Previous                                                    Next                                                    Home