Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
cba5f762
Commit
cba5f762
authored
Aug 26, 2017
by
Richard Ding
Committed by
Madhan Neethiraj
Aug 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1218: Atlas says it is started but does not accept REST requests
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
c6155816
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
2 deletions
+53
-2
atlas_config.py
distro/src/bin/atlas_config.py
+51
-0
atlas_start.py
distro/src/bin/atlas_start.py
+2
-2
No files found.
distro/src/bin/atlas_config.py
View file @
cba5f762
...
...
@@ -23,6 +23,7 @@ import subprocess
import
sys
import
time
import
errno
import
socket
from
re
import
split
from
time
import
sleep
...
...
@@ -65,6 +66,11 @@ SOLR_INDEX_CONF_ENTRY="atlas.graph.index.search.backend\s*=\s*solr5"
SOLR_INDEX_LOCAL_CONF_ENTRY
=
"atlas.graph.index.search.solr.zookeeper-url
\
s*=
\
s*localhost"
SOLR_INDEX_ZK_URL
=
"atlas.graph.index.search.solr.zookeeper-url"
TOPICS_TO_CREATE
=
"atlas.notification.topics"
ATLAS_HTTP_PORT
=
"atlas.server.http.port"
ATLAS_HTTPS_PORT
=
"atlas.server.https.port"
DEFAULT_ATLAS_HTTP_PORT
=
"21000"
DEFAULT_ATLAS_HTTPS_PORT
=
"21443"
ATLAS_ENABLE_TLS
=
"atlas.enableTLS"
DEBUG
=
False
...
...
@@ -442,6 +448,45 @@ def get_topics_to_create(confdir):
topics
=
[
"ATLAS_HOOK"
,
"ATLAS_ENTITIES"
]
return
topics
def
get_atlas_url_port
(
confdir
):
port
=
None
if
'-port'
in
sys
.
argv
:
port
=
sys
.
argv
[
sys
.
argv
.
index
(
'-port'
)
+
1
]
if
port
is
None
:
confdir
=
os
.
path
.
join
(
confdir
,
CONF_FILE
)
enable_tls
=
getConfig
(
confdir
,
ATLAS_ENABLE_TLS
)
if
enable_tls
is
not
None
and
enable_tls
.
lower
()
==
'true'
:
port
=
getConfigWithDefault
(
confdir
,
ATLAS_HTTPS_PORT
,
DEFAULT_ATLAS_HTTPS_PORT
)
else
:
port
=
getConfigWithDefault
(
confdir
,
ATLAS_HTTP_PORT
,
DEFAULT_ATLAS_HTTP_PORT
)
print
"starting atlas on port
%
s"
%
port
return
port
def
wait_for_startup
(
confdir
,
wait
):
count
=
0
port
=
get_atlas_url_port
(
confdir
)
while
True
:
try
:
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
settimeout
(
1
)
s
.
connect
((
'localhost'
,
int
(
port
)))
s
.
close
()
break
except
Exception
as
e
:
# Wait for 1 sec before next ping
sys
.
stdout
.
write
(
'.'
)
sys
.
stdout
.
flush
()
sleep
(
1
)
if
count
>
wait
:
s
.
close
()
break
count
=
count
+
1
sys
.
stdout
.
write
(
'
\n
'
)
def
run_solr
(
dir
,
action
,
zk_url
=
None
,
port
=
None
,
logdir
=
None
,
wait
=
True
):
...
...
@@ -525,6 +570,12 @@ def getConfig(file, key):
return
line
.
split
(
'='
)[
1
]
.
strip
()
return
None
def
getConfigWithDefault
(
file
,
key
,
defaultValue
):
value
=
getConfig
(
file
,
key
)
if
value
is
None
:
value
=
defaultValue
return
value
def
isCygwin
():
return
platform
.
system
()
.
startswith
(
"CYGWIN"
)
...
...
distro/src/bin/atlas_start.py
View file @
cba5f762
...
...
@@ -131,6 +131,8 @@ def main():
web_app_path
=
mc
.
convertCygwinPath
(
web_app_path
)
if
not
is_setup
:
start_atlas_server
(
atlas_classpath
,
atlas_pid_file
,
jvm_logdir
,
jvm_opts_list
,
web_app_path
)
mc
.
wait_for_startup
(
confdir
,
300
)
print
"Apache Atlas Server started!!!
\n
"
else
:
process
=
mc
.
java
(
"org.apache.atlas.web.setup.AtlasSetup"
,
[],
atlas_classpath
,
jvm_opts_list
,
jvm_logdir
)
return
process
.
wait
()
...
...
@@ -141,8 +143,6 @@ def start_atlas_server(atlas_classpath, atlas_pid_file, jvm_logdir, jvm_opts_lis
args
.
extend
(
sys
.
argv
[
1
:])
process
=
mc
.
java
(
"org.apache.atlas.Atlas"
,
args
,
atlas_classpath
,
jvm_opts_list
,
jvm_logdir
)
mc
.
writePid
(
atlas_pid_file
,
process
)
print
"Apache Atlas Server started!!!
\n
"
if
__name__
==
'__main__'
:
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment